Class TaggingPresetMenu
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.tagging.presets.TaggingPreset
-
- org.openstreetmap.josm.gui.tagging.presets.TaggingPresetMenu
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Predicate<IPrimitive>
,Action
,AdaptableAction
,MainLayerManager.ActiveLayerChangeListener
public class TaggingPresetMenu extends TaggingPreset
Menu that groups several presets from one topic.Used, to create the nested directory structure in the preset main menu entry.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TaggingPresetMenu.PresetTextComparator
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPreset
TaggingPreset.ToolbarButtonAction
-
-
Field Summary
Fields Modifier and Type Field Description JMenu
menu
-
Fields inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPreset
data, DIALOG_ANSWER_APPLY, DIALOG_ANSWER_CANCEL, DIALOG_ANSWER_NEW_RELATION, group, iconName, itemGuiSupport, locale_name, matchExpression, name, name_context, nameTemplate, nameTemplateFilter, OPTIONAL_TOOLTIP_TEXT, PRESET_ICON_ERROR_MSG_PREFIX, preset_name_label, roles, types, USE_VALIDATOR
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Constructor Description TaggingPresetMenu()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
private static Component
copyMenuComponent(Component menuComponent)
boolean
equals(Object o)
TaggingPresetMenu
are considered equivalent if (and only if) theirTaggingPreset.getRawName()
match.private static void
handleMenuItem(JMenu menu, TaggingPresetMenu.PresetTextComparator comp, List<JMenuItem> sortarray, int lastSeparator)
int
hashCode()
void
setDisplayName()
Change the display name without changing the toolbar value.void
sortMenu()
Sorts the menu items using the translated item textstatic void
sortMenu(JMenu menu)
Sorts the menu items using the translated item text-
Methods inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPreset
activeOrEditLayerChanged, createCommand, createPanel, createSelection, getChangedTags, getIcon, getIcon, getIconLoadingTask, getImageResource, getLocaleName, getName, getRawName, getToolbarString, isShowable, matches, setIcon, setMatch_expression, setName_template, setName_template_filter, setType, showAndApply, showDialog, suggestRoleForOsmPrimitive, test, toString, typeMatches, typeMatches, updateEnabledState
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
TaggingPresetMenu
public TaggingPresetMenu()
-
-
Method Detail
-
equals
public boolean equals(Object o)
TaggingPresetMenu
are considered equivalent if (and only if) theirTaggingPreset.getRawName()
match.
-
setDisplayName
public void setDisplayName()
Description copied from class:TaggingPreset
Change the display name without changing the toolbar value.- Overrides:
setDisplayName
in classTaggingPreset
-
copyMenuComponent
private static Component copyMenuComponent(Component menuComponent)
-
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in classTaggingPreset
-
sortMenu
public void sortMenu()
Sorts the menu items using the translated item text
-
sortMenu
public static void sortMenu(JMenu menu)
Sorts the menu items using the translated item text- Parameters:
menu
- menu to sort
-
handleMenuItem
private static void handleMenuItem(JMenu menu, TaggingPresetMenu.PresetTextComparator comp, List<JMenuItem> sortarray, int lastSeparator)
-
-