classdef TSPriority
  % Toolstrip component priority on FlowToolSection sections.
  %
  % See also toolpack.component.TSButton, toolpack.desktop.FlowToolSection
  
  % Author(s): Bora Eryilmaz
  % Revised:
  % Copyright 2011 The MathWorks, Inc.
  
  % ----------------------------------------------------------------------------
  enumeration
    % Component priority (default = NORMAL)
    NORMAL (com.mathworks.toolstrip.components.TSPriority.NORMAL)
    LOW (com.mathworks.toolstrip.components.TSPriority.LOW)
    TOP (com.mathworks.toolstrip.components.TSPriority.TOP)
  end
  
  % ----------------------------------------------------------------------------
  properties
    % Matching Java enum TSPriority.
    JavaEnum
  end
  
  % ----------------------------------------------------------------------------
  methods
    function this = TSPriority(data)
      this.JavaEnum = data;
    end
  end
  
  methods (Static)
    function priority = getPriority(javaPriority)
      % Return matching enumeration for specified Java TSPriority.
      if (javaPriority == toolpack.component.TSPriority.NORMAL.JavaEnum)
        priority = toolpack.component.TSPriority.NORMAL;
      elseif (javaPriority == toolpack.component.TSPriority.LOW.JavaEnum)
        priority = toolpack.component.TSPriority.LOW;
      else
        priority = toolpack.component.TSPriority.TOP;
      end
    end
  end
end
