Package org.openstreetmap.josm.actions
Class ExpertToggleAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.ToggleAction
org.openstreetmap.josm.actions.ExpertToggleAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,Destroyable
This action toggles the Expert mode.
- Since:
- 4840
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis listener is notified whenever the expert mode setting changed.Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ExpertToggleActionprivate static final ListenerList<ExpertToggleAction.ExpertModeChangeListener>private static final BooleanPropertyprivate static final ListenerList<Component>Fields inherited from class org.openstreetmap.josm.actions.JosmAction
scFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic voidRegister a expert mode change listener.static voidaddExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener, boolean fireWhenAdding) Register a expert mode change listener, and optionally fires it.static voidMarks a component to be only visible when expert mode is enabled.private static voidfireExpertModeChanged(boolean isExpert) static ExpertToggleActionReplies the unique instance of this action.static booleanDetermines if the given component tracks visibility changes.static booleanisExpert()Determines if expert mode is enabled.protected final voidstatic voidRemoves a expert mode change listenerstatic voidStops tracking visibility changes for the given component.voidsetExpert(boolean isExpert) Forces the expert mode state to the given state.Methods inherited from class org.openstreetmap.josm.actions.ToggleAction
addButtonModel, isSelected, removeButtonModel, setSelected, toggleSelectedStateMethods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFutureMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
listeners
-
visibilityToggleListeners
-
PREF_EXPERT
-
INSTANCE
-
-
Constructor Details
-
ExpertToggleAction
public ExpertToggleAction()Constructs a newExpertToggleAction.
-
-
Method Details
-
fireExpertModeChanged
-
addExpertModeChangeListener
public static void addExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener) Register a expert mode change listener.- Parameters:
listener- the listener. Ignored if null.
-
addExpertModeChangeListener
public static void addExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener, boolean fireWhenAdding) Register a expert mode change listener, and optionally fires it.- Parameters:
listener- the listener. Ignored if null.fireWhenAdding- if true, the listener will be fired immediately after added
-
removeExpertModeChangeListener
public static void removeExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener) Removes a expert mode change listener- Parameters:
listener- the listener. Ignored if null.
-
addVisibilitySwitcher
Marks a component to be only visible when expert mode is enabled. The visibility of the component is changed automatically.- Parameters:
c- The component.
-
removeVisibilitySwitcher
Stops tracking visibility changes for the given component.- Parameters:
c- The component.- See Also:
-
hasVisibilitySwitcher
Determines if the given component tracks visibility changes.- Parameters:
c- The component.- Returns:
trueif the given component tracks visibility changes- Since:
- 15649
-
notifySelectedState
- Overrides:
notifySelectedStatein classToggleAction
-
setExpert
Forces the expert mode state to the given state.- Parameters:
isExpert- if expert mode should be used.- Since:
- 11224
-
actionPerformed
-
getInstance
Replies the unique instance of this action.- Returns:
- The unique instance of this action
-
isExpert
Determines if expert mode is enabled.- Returns:
trueif expert mode is enabled,falseotherwise.
-