|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.util.BasicPropertyEventSource dsto.dfc.swt.commands.AbstractCommand dsto.dfc.swt.commands.CmdChangeDataObjectProperty
public class CmdChangeDataObjectProperty
Command to change a property of one or more target data objects. It becomes enabled only when one or more target bjects have property values different from the target value.
NOTE: this command must be disposed after use since it adds listeners to the target targetObjects.
Field Summary | |
---|---|
protected UIPropertyListener |
listener
|
protected ListDataObject |
objectList
|
protected Object |
property
|
protected IDataObject[] |
targetObjects
|
protected Object |
value
|
Fields inherited from class dsto.dfc.swt.commands.AbstractCommand |
---|
NO_ICON |
Constructor Summary | |
---|---|
CmdChangeDataObjectProperty(String name,
Object property,
Object value,
String group,
String description,
Icon icon)
Create a new instance. |
|
CmdChangeDataObjectProperty(String name,
Object property,
Object value,
String group,
String description,
String iconName)
Create a new instance. |
Method Summary | |
---|---|
void |
dispose()
Dispose of the object (unregister listeners, close open resources etc). |
void |
execute()
Execute the command. |
IDataObject[] |
getTargetObjects()
|
protected boolean |
hasDifferentValue()
|
void |
propertyValueChanged(PropertyEvent e)
|
void |
setTargetObjects(IDataObject[] targetObjects)
Set the target objects to be changed. |
protected Object |
targetValue(int n)
Get the value from the n'th target object. |
protected boolean |
testShouldEnable()
Called when target property changes to see if the command should be enabled. |
Methods inherited from class dsto.dfc.swt.commands.AbstractCommand |
---|
addCommandListener, clone, createDefaultDisplayName, fireCommandExecuted, fireCommandExecuted, getAccelerator, getContextMenuGroup, getDescription, getDisplayName, getGroupInView, getIcon, getLogString, getMainMenuGroup, getMnemonic, getName, getToolbarGroup, isEnabled, isInteractive, removeCommandListener, setAccelerator, setContextMenuGroup, setDescription, setDisplayName, setEnabled, setIcon, setInteractive, setMainMenuGroup, setMnemonic, setName, setToolbarGroup |
Methods inherited from class dsto.dfc.util.BasicPropertyEventSource |
---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener, setPropertyChangeSource |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface dsto.dfc.swt.commands.Command |
---|
addCommandListener, getAccelerator, getDescription, getDisplayName, getGroupInView, getIcon, getLogString, getMnemonic, getName, isEnabled, isInteractive, removeCommandListener, setAccelerator, setContextMenuGroup, setDescription, setDisplayName, setEnabled, setIcon, setMainMenuGroup, setMnemonic, setToolbarGroup |
Methods inherited from interface dsto.dfc.util.PropertyEventSource |
---|
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
protected IDataObject[] targetObjects
protected Object property
protected Object value
protected ListDataObject objectList
protected UIPropertyListener listener
Constructor Detail |
---|
public CmdChangeDataObjectProperty(String name, Object property, Object value, String group, String description, String iconName)
name
- The command name.property
- The property to set on the target objects.value
- The vaue to set.group
- The command group.description
- The command description.iconName
- The command icon resource name.public CmdChangeDataObjectProperty(String name, Object property, Object value, String group, String description, Icon icon)
name
- The command name.property
- The property to set on the target objects.value
- The vaue to set.group
- The command group.description
- The command description.icon
- The command icon.Method Detail |
---|
public void dispose()
Disposable
dispose
in interface Disposable
public void setTargetObjects(IDataObject[] targetObjects)
public IDataObject[] getTargetObjects()
protected boolean testShouldEnable()
protected boolean hasDifferentValue()
protected Object targetValue(int n)
public void execute()
Command
CommandListener.commandExecuted(CommandEvent)
when executed.
execute
in interface Command
execute
in class AbstractCommand
public void propertyValueChanged(PropertyEvent e)
propertyValueChanged
in interface PropertyListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |