|
Sweet Home 3D 4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.eteks.sweethome3d.plugin.PluginAction
public abstract class PluginAction
An action made available to application users through a plugin.
Nested Class Summary | |
---|---|
static class |
PluginAction.Property
Enumeration of the various properties this action may define. |
Constructor Summary | |
---|---|
PluginAction()
Creates a disabled plug-in action. |
|
PluginAction(String resourceBaseName,
String actionPrefix,
ClassLoader pluginClassLoader)
Creates a disabled plug-in action with properties retrieved from a resource bundle in which key starts with actionPrefix . |
|
PluginAction(String resourceBaseName,
String actionPrefix,
ClassLoader pluginClassLoader,
boolean enabled)
Creates an action with properties retrieved from a resource bundle in which key starts with actionPrefix . |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds the property change listener in parameter to this plugin action. |
abstract void |
execute()
Executes this action. |
Object |
getPropertyValue(PluginAction.Property property)
Returns a property value of this action. |
boolean |
isEnabled()
Returns the enabled state of this action. |
void |
putPropertyValue(PluginAction.Property property,
Object value)
Sets a property value of this action, and fires a PropertyChangeEvent
if the value changed. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the property change listener in parameter from this plugin action. |
void |
setEnabled(boolean enabled)
Sets the enabled state of this action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginAction()
public PluginAction(String resourceBaseName, String actionPrefix, ClassLoader pluginClassLoader)
actionPrefix
.
new PluginAction("com.mycompany.mypackage.MyResources", "EXPORT", plugin.getPluginClassLoader())
will retrieve its property values from the /com/mycompany/mypackage/MyResources.properties
file
bundled with the plug-in class, and this file may describe the action EXPORT
with the following keys:
EXPORT.NAME=Export EXPORT.SHORT_DESCRIPTION=Export home data EXPORT.SMALL_ICON=/com/mycompany/mypackage/resources/export.png EXPORT.MNEMONIC=X EXPORT.IN_TOOL_BAR=true EXPORT.MENU=File
resourceBaseName
- the base name of a resource bundleactionPrefix
- prefix used in resource bundle to search action propertiespluginClassLoader
- the class loader that will be used to search the resource bundle
MissingResourceException
- if no resource bundle could be found from
resourceBaseName
.public PluginAction(String resourceBaseName, String actionPrefix, ClassLoader pluginClassLoader, boolean enabled)
actionPrefix
.
resourceBaseName
- the base name of a resource bundleactionPrefix
- prefix used in resource bundle to search action propertiespluginClassLoader
- the class loader that will be used to search the resource bundleenabled
- true
if the action should be enabled at creation.
MissingResourceException
- if no resource bundle could be found from
resourceBaseName
.Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
in parameter to this plugin action.
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
in parameter from this plugin action.
public Object getPropertyValue(PluginAction.Property property)
public void putPropertyValue(PluginAction.Property property, Object value)
PropertyChangeEvent
if the value changed.
public void setEnabled(boolean enabled)
execute
method.
If the value has changed, a PropertyChangeEvent
is sent
to listeners. By default, an action is disabled.
public boolean isEnabled()
true
if this action is enabled.public abstract void execute()
|
Sweet Home 3D 4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() |
© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License |