public class SwingEnumProperty<E> extends AbstractBasicSimpleEditableChangeableItem implements EnumProperty<E>
Modifier and Type | Class and Description |
---|---|
static interface |
SwingEnumProperty.EnumValueComparator<T>
Comparator used for enum value sorting.
|
Constructor and Description |
---|
SwingEnumProperty(EnumValue<E> startValue,
boolean autoSave,
java.lang.String basicName,
java.lang.String baseTag,
java.util.Collection<EnumValue<E>> values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
boolean autoSave,
java.lang.String basicName,
java.lang.String baseTag,
EnumValue<E>... values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
boolean autoSave,
java.lang.String basicName,
java.lang.String baseTag,
SwingEnumProperty.EnumValueComparator<E> enumValueComparator,
java.util.Collection<EnumValue<E>> values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
boolean autoSave,
java.lang.String basicName,
java.lang.String baseTag,
SwingEnumProperty.EnumValueComparator<E> enumValueComparator,
EnumValue<E>... values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
java.lang.String basicName,
java.lang.String baseTag,
java.util.Collection<EnumValue<E>> values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
java.lang.String basicName,
java.lang.String baseTag,
EnumValue<E>... values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
java.lang.String basicName,
java.lang.String baseTag,
SwingEnumProperty.EnumValueComparator<E> enumValueComparator,
java.util.Collection<EnumValue<E>> values)
Constructor.
|
SwingEnumProperty(EnumValue<E> startValue,
java.lang.String basicName,
java.lang.String baseTag,
SwingEnumProperty.EnumValueComparator<E> enumValueComparator,
EnumValue<E>... values)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.swing.JMenuItem |
createMenuItem(java.util.Locale l)
Create a menu item for this boolean property.
|
EditorProvider |
getEditorProvider(java.util.Locale l)
Get the editor provider which provides editor components for editing this preference property.
|
(package private) SwingEnumProperty.EnumValueComparator<E> |
getEnumValueComparator()
Get the enum value comparator.
|
protected java.util.List<EnumValue<E>> |
getEnumValues()
Get the enum values.
|
java.util.List<EnumValue<E>> |
getEnumValues(java.util.Locale l)
Get the possible values.
|
static <T> SwingEnumProperty.EnumValueComparator<T> |
getShortNameEnumValueComparator()
Get an enum value comparator suitable to be used in the
SwingEnumProperty(de.caff.util.settings.EnumValue, String, String, de.caff.util.settings.swing.SwingEnumProperty.EnumValueComparator, de.caff.util.settings.EnumValue[])
constructor, which sorts the enum values by their short names. |
EnumValue<E> |
getValue()
Get the current value.
|
void |
setValue(EnumValue<E> value)
Set a new value.
|
getBaseTag, getLabelString, getMenuString, getName, getString
addValueChangeListener, addValueChangeListenerWeakly, firePropertyChange, fireValueChange, fireValueChange, fireValueChange, getBasicName, getPropertyName, removeValueChangeListener, removeValueChangeListenerWeakly
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
addValueChangeListener, addValueChangeListenerWeakly, removeValueChangeListener, removeValueChangeListenerWeakly
public SwingEnumProperty(@NotNull EnumValue<E> startValue, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull EnumValue<E>... values)
startValue
- the start value of this propertybasicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, boolean autoSave, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull EnumValue<E>... values)
startValue
- the start value of this propertyautoSave
- auto save changes?basicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull java.util.Collection<EnumValue<E>> values)
startValue
- the start value of this propertybasicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, boolean autoSave, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull java.util.Collection<EnumValue<E>> values)
startValue
- the start value of this propertyautoSave
- auto save changes?basicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull SwingEnumProperty.EnumValueComparator<E> enumValueComparator, @NotNull EnumValue<E>... values)
startValue
- the start value of this propertybasicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyenumValueComparator
- comparator for EnumValue
s used to sort the values for displayvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, boolean autoSave, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull SwingEnumProperty.EnumValueComparator<E> enumValueComparator, @NotNull EnumValue<E>... values)
startValue
- the start value of this propertyautoSave
- auto save values?basicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyenumValueComparator
- comparator for EnumValue
s used to sort the values for displayvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull SwingEnumProperty.EnumValueComparator<E> enumValueComparator, @NotNull java.util.Collection<EnumValue<E>> values)
startValue
- the start value of this propertybasicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyenumValueComparator
- comparator for EnumValue
s used to sort the values for displayvalues
- the possible values of this propertypublic SwingEnumProperty(@NotNull EnumValue<E> startValue, boolean autoSave, @NotNull java.lang.String basicName, @NotNull java.lang.String baseTag, @NotNull SwingEnumProperty.EnumValueComparator<E> enumValueComparator, @NotNull java.util.Collection<EnumValue<E>> values)
startValue
- the start value of this propertyautoSave
- auto save values?basicName
- the name of this propertybaseTag
- the basic i18n tag of this propertyenumValueComparator
- comparator for EnumValue
s used to sort the values for displayvalues
- the possible values of this property@NotNull public EditorProvider getEditorProvider(@Nullable java.util.Locale l)
getEditorProvider
in interface EditableProperty
l
- locale used for i18n@NotNull public EnumValue<E> getValue()
getValue
in interface EnumProperty<E>
@NotNull public java.util.List<EnumValue<E>> getEnumValues(java.util.Locale l)
getEnumValues
in interface EnumProperty<E>
l
- locale to use@NotNull protected java.util.List<EnumValue<E>> getEnumValues()
SwingEnumProperty.EnumValueComparator<E> getEnumValueComparator()
null
if they are displayed in their natural orderpublic javax.swing.JMenuItem createMenuItem(java.util.Locale l)
l
- localepublic static <T> SwingEnumProperty.EnumValueComparator<T> getShortNameEnumValueComparator()
SwingEnumProperty(de.caff.util.settings.EnumValue, String, String, de.caff.util.settings.swing.SwingEnumProperty.EnumValueComparator, de.caff.util.settings.EnumValue[])
constructor, which sorts the enum values by their short names.T
- enum type