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 ILcdActions or ILcyActiveSettables, but also
Components 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
FieldsModifier and TypeFieldDescriptionstatic final StringName of the order that order items alphabetically.static final StringName of the order that puts new items always at the end.static final StringName of the order that puts items as configured in the configuration file.static final StringName of the order that puts new items always at the start.static final StringName of the order that puts sub menu items before other items.static final StringName of the order that puts sub menu items after other items.static final StringName of the order that order items inverse alphabetically. -
Constructor Summary
ConstructorsConstructorDescriptionTLcyActionBarItemComparator(String[] aGroupDescriptors) Creates a newTLcyActionBarItemComparatorthat parses the group descriptor names for sort orders. -
Method Summary
Modifier and TypeMethodDescriptionintcompare(TLcyActionBarItem aO1, TLcyActionBarItem aO2) protected Comparator<TLcyActionBarItem> createComparator(String aSortOrderName) Creates aComparatorfor the given sort order name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 newTLcyActionBarItemComparatorthat 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 aComparatorfor the given sort order name. Overwrite this method to support additional sort orders.- Parameters:
aSortOrderName- The name of the sort order.- Returns:
- The
Comparatorfor the given sort order name.
-
compare
- Specified by:
comparein interfaceComparator<TLcyActionBarItem>
-