|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.alchemist.configbuilder.ConfigElement
public abstract class ConfigElement
This is the abstract ConfigElement.
Implementations are used in ConfigBuilderPanel,
both JLists are filled with ConfigElements.
The list of ConfigElements is representing
a sequence of actions in the output xml
ConfigElement acts like a model, where the
corresponding ConfigElementEditor is the editor.
| Field Summary | |
|---|---|
static java.awt.datatransfer.DataFlavor |
flavor
object data flavor |
static java.lang.String |
PROPERTY_KEY_DEFAULTICON
property key for default icon attribute |
static java.lang.String |
PROPERTY_KEY_EDITABLE
property key for editable state |
static java.lang.String |
PROPERTY_KEY_HELPTEXT
property key for helptext attribute |
static java.lang.String |
PROPERTY_KEY_ICON
property key for icon attribute |
static java.lang.String |
PROPERTY_KEY_ID
property key for id attribute |
static java.lang.String |
PROPERTY_KEY_NAME
property key for name attribute |
static java.lang.String |
PROPERTY_KEY_TOOLTIP
property key for tooltip attribute |
static java.lang.String |
PROPERTY_KEY_VALID
property key for valid state |
protected javax.swing.event.SwingPropertyChangeSupport |
propertyChangeSupport
property change support |
| Constructor Summary | |
|---|---|
ConfigElement()
Constructs a config element. |
|
ConfigElement(java.lang.String id)
Constructs a config element with the specified id |
|
ConfigElement(java.lang.String id,
java.lang.String name)
Constructs a config element with the specified id and name |
|
ConfigElement(java.lang.String id,
java.lang.String name,
javax.swing.ImageIcon icon)
Constructs a config element with the specified id, name and icon |
|
ConfigElement(java.lang.String id,
java.lang.String name,
javax.swing.ImageIcon icon,
java.lang.String tooltip)
Constructs a config element with the specified id, name, icon and tooltip |
|
ConfigElement(java.lang.String id,
java.lang.String name,
javax.swing.ImageIcon icon,
java.lang.String tooltip,
java.lang.String helpText)
Constructs a config element with the specified id, name, icon and tooltip |
|
| Method Summary | |
|---|---|
void |
addGroup(java.lang.String groupName)
Sets this element as a member of given group |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. |
protected abstract java.lang.Object |
clone()
|
ConfigElement |
cloneElement()
Returns a clone of the element, or null if clone not supported |
protected void |
copyAttributes(ConfigElement source)
Copies the default attributes from source |
javax.swing.ImageIcon |
getDefaultIcon()
Returns the default icon of the element |
java.lang.String[] |
getGroups()
Returns the group names this element is a member of |
java.lang.String |
getHelpText()
Returns the help text of the element |
javax.swing.ImageIcon |
getIcon()
Returns the icon of the element, or the warning icon if element is at invalid state |
java.lang.String |
getId()
Returns the id of the element |
java.lang.String |
getLicenseName()
Returns the name of required license, or null |
java.lang.String |
getName()
Returns the name of the element |
java.lang.String |
getTooltip()
Returns the tooltip of the element |
java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
|
java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
boolean |
hasGroup(java.lang.String groupName)
Returns true if element is in group |
boolean |
hasGroups()
Returns true if element has any groups |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
|
abstract boolean |
isDefault()
Returns if config element is at default state |
boolean |
isEditable()
Returns if config element is editable |
boolean |
isLicensed()
Returns true if the action represented
by this element with current license settings can be used |
boolean |
isValid()
Returns the current validity state |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. |
void |
setDefaultIcon(javax.swing.ImageIcon icon)
Sets the icon of the element |
void |
setEditable(boolean editable)
Sets if config element is editable |
void |
setHelpText(java.lang.String helpText)
Sets the help text of the element |
void |
setId(java.lang.String id)
Sets the id of the element |
void |
setLicensed(boolean licensed)
Sets if the action represented by this element with current license settings can be used |
void |
setLicenseName(java.lang.String licenseName)
Sets the license name required for this element |
void |
setName(java.lang.String name)
Sets the name of the element |
void |
setTooltip(java.lang.String tooltip)
Sets the tooltip of the element |
protected void |
setValid(boolean valid)
Sets the validity state Property change event for PROPERTY_KEY_VALID |
void |
store(org.dom4j.Element parent)
This method adds the xml representation of ConfigElement to the parent element |
protected org.dom4j.Element |
store(org.dom4j.Element parent,
java.lang.String xmlTag)
This method adds the xml representation of ConfigElement to the parent element with the specified name |
protected abstract void |
validate()
This method should be called after modifications occured in model. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.awt.datatransfer.DataFlavor flavor
public static final java.lang.String PROPERTY_KEY_VALID
public static final java.lang.String PROPERTY_KEY_EDITABLE
public static final java.lang.String PROPERTY_KEY_ID
public static final java.lang.String PROPERTY_KEY_NAME
public static final java.lang.String PROPERTY_KEY_ICON
public static final java.lang.String PROPERTY_KEY_DEFAULTICON
public static final java.lang.String PROPERTY_KEY_TOOLTIP
public static final java.lang.String PROPERTY_KEY_HELPTEXT
protected javax.swing.event.SwingPropertyChangeSupport propertyChangeSupport
| Constructor Detail |
|---|
public ConfigElement()
public ConfigElement(java.lang.String id)
id - is the element id
public ConfigElement(java.lang.String id,
java.lang.String name)
id - is the element idname - is the name of the element
public ConfigElement(java.lang.String id,
java.lang.String name,
javax.swing.ImageIcon icon)
id - is the element idname - is the name of the elementicon - is the icon of the element
public ConfigElement(java.lang.String id,
java.lang.String name,
javax.swing.ImageIcon icon,
java.lang.String tooltip)
id - is the element idname - is the name of the elementicon - is the icon of the elementtooltip - is the tooltip of the element
public ConfigElement(java.lang.String id,
java.lang.String name,
javax.swing.ImageIcon icon,
java.lang.String tooltip,
java.lang.String helpText)
id - is the element idname - is the name of the elementicon - is the icon of the elementtooltip - is the tooltip of the elementhelpText - is the detailed help text of the element| Method Detail |
|---|
protected void copyAttributes(ConfigElement source)
source
source - is the ConfigElement copy attributes frompublic java.lang.String getName()
public void setName(java.lang.String name)
name - is the new namepublic javax.swing.ImageIcon getIcon()
public void setDefaultIcon(javax.swing.ImageIcon icon)
icon - is the new iconpublic javax.swing.ImageIcon getDefaultIcon()
getIcon()public java.lang.String getTooltip()
public void setTooltip(java.lang.String tooltip)
tooltip - is the new tooltippublic java.lang.String getId()
public void setId(java.lang.String id)
id - is the new idpublic java.lang.String getHelpText()
public void setHelpText(java.lang.String helpText)
helpText - is the new helptextpublic boolean isEditable()
public void setEditable(boolean editable)
editable - is the new value
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
getTransferData in interface java.awt.datatransfer.Transferablejava.awt.datatransfer.UnsupportedFlavorException
java.io.IOExceptionpublic java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface java.awt.datatransfer.Transferablepublic boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported in interface java.awt.datatransfer.Transferablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener to be added
public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
propertyName - The name of the property to listen onlistener - The PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - The PropertyChangeListener to be removed
public void removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
propertyName - The name of the property that was listened onlistener - The PropertyChangeListener to be removedpublic boolean isValid()
protected void setValid(boolean valid)
PROPERTY_KEY_VALID property will be fired
if necessary.
- Parameters:
valid - is the new validity state
protected abstract void validate()
setValid(boolean)
public void store(org.dom4j.Element parent)
parent - is the parent element of this tag
protected org.dom4j.Element store(org.dom4j.Element parent,
java.lang.String xmlTag)
parent - is the parent elementxmlTag - is the name which is used to add this element
public abstract boolean isDefault()
public void addGroup(java.lang.String groupName)
groupName - is the name of the grouppublic java.lang.String[] getGroups()
public boolean hasGroup(java.lang.String groupName)
true if element is in group
groupName - is the name of the group
true if element is in grouppublic boolean hasGroups()
true if element has any groups
true if element has any groups
protected abstract java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic boolean isLicensed()
true if the action represented
by this element with current license settings can be used
- Returns:
true if license is available, or not needed at all.
public void setLicensed(boolean licensed)
licensed - is the new valuepublic java.lang.String getLicenseName()
null
public void setLicenseName(java.lang.String licenseName)
licenseName - public ConfigElement cloneElement()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||