public abstract class AbstractToolAction extends Object implements ToolAction
ToolAction.Flag
Constructor and Description |
---|
AbstractToolAction(String menuNameIn)
Creates a new AbstractToolAction.
|
AbstractToolAction(String menuNameIn,
String toolNameIn,
String toolTipIn,
AutosizedIcon toolIconIn)
Creates a new AbstractToolAction.
|
AbstractToolAction(String menuNameIn,
String toolNameIn,
String toolTipIn,
AutosizedIcon toolIconIn,
EnumSet<ToolAction.Flag> flagsIn)
Creates a new AbstractToolAction.
|
Modifier and Type | Method and Description |
---|---|
String |
getMenuName()
Gets the menu name for this action.
|
String |
getToolbarHint()
Gets the toolbar item tool hint for this action.
|
AutosizedIcon |
getToolbarIcon()
Gets the toolbar icon for this action.
|
String |
getToolbarLabel()
Gets the toolbar item label for this action.
|
boolean |
hasFlag(ToolAction.Flag f)
Determines if the action has a flag.
|
boolean |
showMenuItem()
Determines if a menu item for the action should be shown.
|
boolean |
showToolbarItem()
Determines if a toolbar item for the action should be shown.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
public AbstractToolAction(String menuNameIn)
menuNameIn
- the menu name, or null if no menu item should be shown.
If showMenuItem()
is overridden to return true, a null menu name
will be shown as a separator.public AbstractToolAction(String menuNameIn, String toolNameIn, String toolTipIn, AutosizedIcon toolIconIn)
menuNameIn
- the menu name, or null if no menu item should be shown.toolNameIn
- the toolbar button name, or null if no toolbar button
should be shown.toolTipIn
- the tool tip text. This may be null.toolIconIn
- the toolbar button icon. This may be null.public AbstractToolAction(String menuNameIn, String toolNameIn, String toolTipIn, AutosizedIcon toolIconIn, EnumSet<ToolAction.Flag> flagsIn)
menuNameIn
- the menu name, or null if no menu item should be shown.toolNameIn
- the toolbar button name, or null if no toolbar button
should be shown.toolTipIn
- the tool tip text. This may be null.toolIconIn
- the toolbar button icon. This may be null.flagsIn
- the action flags.public String getMenuName()
getMenuName
in interface ToolAction
public String getToolbarHint()
getToolbarHint
in interface ToolAction
public AutosizedIcon getToolbarIcon()
getToolbarIcon
in interface ToolAction
public String getToolbarLabel()
getToolbarLabel
in interface ToolAction
public boolean hasFlag(ToolAction.Flag f)
hasFlag
in interface ToolAction
f
- the flag of interest.public boolean showMenuItem()
Implemented to return true if the menu name is non-null and false if it is null.
showMenuItem
in interface ToolAction
public boolean showToolbarItem()
Implemented to return true if the toolbar name is non-null and false if it is null.
showToolbarItem
in interface ToolAction