public class TLcyActionBarItemComparator extends Object implements Comparator<TLcyActionBarItem>
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).Modifier and Type | Field and Description |
---|---|
static String |
ABC
Name of the order that order items alphabetically.
|
static String |
END
Name of the order that puts new items always at the end.
|
static String |
FIXED
Name of the order that puts items as configured in the
configuration file.
|
static String |
START
Name of the order that puts new items always at the start.
|
static String |
SUB_MENUS_FIRST
Name of the order that puts sub menu items before other
items.
|
static String |
SUB_MENUS_LAST
Name of the order that puts sub menu items after other
items.
|
static String |
ZYX
Name of the order that order items inverse alphabetically.
|
Constructor and Description |
---|
TLcyActionBarItemComparator(String[] aGroupDescriptors)
Creates a new
TLcyActionBarItemComparator that parses the group descriptor names
for sort orders. |
Modifier and Type | Method and Description |
---|---|
int |
compare(TLcyActionBarItem aO1,
TLcyActionBarItem aO2) |
protected Comparator<TLcyActionBarItem> |
createComparator(String aSortOrderName)
Creates a
Comparator for the given sort order name. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final String ABC
public static final String ZYX
public static final String SUB_MENUS_LAST
public static final String SUB_MENUS_FIRST
public static final String FIXED
public static final String END
public static final String START
public TLcyActionBarItemComparator(String[] aGroupDescriptors)
TLcyActionBarItemComparator
that parses the group descriptor names
for sort orders. The syntax is defined in lucy.cfg (above TLcyMain.menuBar.groupPriorities).aGroupDescriptors
- The names for the group descriptors, including the sort orders.protected Comparator<TLcyActionBarItem> createComparator(String aSortOrderName)
Comparator
for the given sort order name. Overwrite this method
to support additional sort orders.aSortOrderName
- The name of the sort order.Comparator
for the given sort order name.public int compare(TLcyActionBarItem aO1, TLcyActionBarItem aO2)
compare
in interface Comparator<TLcyActionBarItem>