|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction com.ephox.editlive.java2.editor.actionhandler.EphoxAction
public class EphoxAction
An extension of Action
that provides support for tracking selection and other useful settings.
Field Summary | |
---|---|
static String |
ALLOW_TEXT
Whether or not to allow text on Toolbar Buttons |
static String |
BACKGROUND_COLOR
The key to indicate the background color for the action. |
static String |
BORDER
Whether or not to paint a border when this action is in a combo box or menu. |
static String |
COLOR
The key to indicate the color to paint the item. |
static String |
FONT
The key to indicate the font face for the action. |
static String |
FOREGROUND_COLOR
The key to indicate the foreground color for the action. |
static String |
ID
The "name" attribute specified in the configuration file. |
static String |
SELECTED
The property name used for property change events when the selected state of the action changes. |
static String |
SHOW_CHECKMARK
Whether or not to show the checkmark when selected. |
static String |
SHOW_WHEN_DISABLED
In the context menu disabled actions are normally hidden. |
static String |
SUB_ITEMS
The property name used when the sub items for this action change. |
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 | |
---|---|
EphoxAction()
|
|
EphoxAction(String name)
Creates a new EphoxAction. |
|
EphoxAction(String name,
Icon icon)
Creates a new EphoxAction. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
void |
addActionListener(ActionListener listener)
Add an action listener to notify when this action is performed. |
void |
addEnabledFilter(EnabledFilter filter)
Add an enabled filter to this action. |
void |
addEnabledFilters(EnabledFilter... filters)
|
boolean |
allowsText()
|
int |
compareTo(EphoxAction o)
Simple comparator to implement standard string sorting based on the action name |
protected List<EphoxAction> |
createStaticSubItems()
Create the static list of sub items for this action. |
boolean |
equals(Object obj)
|
List<ActionListener> |
getActionListeners()
Get the list of action listeners added to this action |
List<EnabledFilter> |
getEnabledFilters()
Get the list of enabled filters that have been added to this action. |
Font |
getFont()
|
Icon |
getIcon()
|
List<EphoxAction> |
getSubItems()
Get the sub items for this action. |
String |
getText()
|
int |
hashCode()
|
boolean |
hasSubItems()
|
boolean |
isEnabled()
|
boolean |
isSelected()
Get whether or not the action is selected (ie: toggled on). |
void |
removeActionListener(ActionListener listener)
Remove an action listener from this action. |
void |
setMnemonicFromName()
|
void |
setMnemonicFromString(String mnemonic)
|
void |
setSelected(boolean selected)
Set whether or not the action is selected. |
void |
setSubItems(List<EphoxAction> subItems)
Set the sub items for this action. |
String |
toString()
|
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String SHOW_WHEN_DISABLED
public static final String SELECTED
public static final String COLOR
public static final String FONT
public static final String FOREGROUND_COLOR
public static final String BACKGROUND_COLOR
public static final String BORDER
public static final String ID
public static final String SUB_ITEMS
public static final String SHOW_CHECKMARK
public static final String ALLOW_TEXT
Constructor Detail |
---|
public EphoxAction()
public EphoxAction(String name)
name
- the name of the action.public EphoxAction(String name, Icon icon)
name
- the name of the action.icon
- the icon for the action.Method Detail |
---|
public void addActionListener(ActionListener listener)
listener
- the listener to notify.public void removeActionListener(ActionListener listener)
listener
- the listener to remove.public List<ActionListener> getActionListeners()
public void addEnabledFilter(EnabledFilter filter)
filter
- the filter to add.public void addEnabledFilters(EnabledFilter... filters)
public List<EnabledFilter> getEnabledFilters()
EnabledFilter
instances that apply to this action.public boolean isEnabled()
isEnabled
in interface Action
isEnabled
in class AbstractAction
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public boolean isSelected()
public void setSelected(boolean selected)
selected
- true to select the action, otherwise false.public List<EphoxAction> getSubItems()
Override this method if dynamic subitems are required. For static items, instead override
createStaticSubItems()
.
protected List<EphoxAction> createStaticSubItems()
public void setSubItems(List<EphoxAction> subItems)
subItems
- the sub items for the action.public String toString()
toString
in class Object
public int compareTo(EphoxAction o)
compareTo
in interface Comparable<EphoxAction>
o
- EphoxAction to compare to
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public boolean hasSubItems()
public boolean allowsText()
public void setMnemonicFromName()
public void setMnemonicFromString(String mnemonic)
public Font getFont()
ClassCastException
- if FONT
value is not a Font
object.public Icon getIcon()
ClassCastException
- if Action.SMALL_ICON
value is not a Icon
object.public String getText()
ClassCastException
- if Action.NAME
value is not a String
.
|
Copyright (c) 2005-2013 Ephox Pty Ltd. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |