Package com.luciad.lucy.gui
Class TLcyActionBarItemComparator
java.lang.Object
com.luciad.lucy.gui.TLcyActionBarItemComparator
- All Implemented Interfaces:
Comparator<TLcyActionBarItem>
Comparator that allows to sort items within a single
TLcyGroupDescriptor
. Those
items can be ILcdAction
s or ILcyActiveSettables
, but also
Component
s or sub-menus. Some predefined sort methods are to sort alphabetically,
or to add the most recently inserted item at the top (useful for say a recent items list).
All available predefined sort strategies are defined as constants in this class
(e.g. ABC
), the syntax is defined in lucy.cfg (above TLcyMain.menuBar.groupPriorities).-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the order that order items alphabetically.static final String
Name of the order that puts new items always at the end.static final String
Name of the order that puts items as configured in the configuration file.static final String
Name of the order that puts new items always at the start.static final String
Name of the order that puts sub menu items before other items.static final String
Name of the order that puts sub menu items after other items.static final String
Name of the order that order items inverse alphabetically. -
Constructor Summary
ConstructorDescriptionTLcyActionBarItemComparator
(String[] aGroupDescriptors) Creates a newTLcyActionBarItemComparator
that parses the group descriptor names for sort orders. -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(TLcyActionBarItem aO1, TLcyActionBarItem aO2) protected Comparator
<TLcyActionBarItem> createComparator
(String aSortOrderName) Creates aComparator
for the given sort order name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
ABC
Name of the order that order items alphabetically.- See Also:
-
ZYX
Name of the order that order items inverse alphabetically.- See Also:
-
SUB_MENUS_LAST
Name of the order that puts sub menu items after other items.- See Also:
-
SUB_MENUS_FIRST
Name of the order that puts sub menu items before other items.- See Also:
-
FIXED
Name of the order that puts items as configured in the configuration file.- See Also:
-
END
Name of the order that puts new items always at the end. This is the default order.- See Also:
-
START
Name of the order that puts new items always at the start.- See Also:
-
-
Constructor Details
-
TLcyActionBarItemComparator
Creates a newTLcyActionBarItemComparator
that parses the group descriptor names for sort orders. The syntax is defined in lucy.cfg (above TLcyMain.menuBar.groupPriorities).- Parameters:
aGroupDescriptors
- The names for the group descriptors, including the sort orders.
-
-
Method Details
-
createComparator
Creates aComparator
for the given sort order name. Overwrite this method to support additional sort orders.- Parameters:
aSortOrderName
- The name of the sort order.- Returns:
- The
Comparator
for the given sort order name.
-
compare
- Specified by:
compare
in interfaceComparator<TLcyActionBarItem>
-