dsto.dfc.swing.forms
Class AbstractShowCustomizerCommand

java.lang.Object
  extended by dsto.dfc.swing.commands.AbstractCommand
      extended by dsto.dfc.swing.commands.AbstractMutableCommand
          extended by dsto.dfc.swing.commands.BasicPropertiesCommand
              extended by dsto.dfc.swing.forms.AbstractShowCustomizerCommand
All Implemented Interfaces:
Command, Iconic, Copyable, PropertyEventSource, ActionListener, Cloneable, EventListener
Direct Known Subclasses:
CmdCustomize, CmdCustomize

public abstract class AbstractShowCustomizerCommand
extends BasicPropertiesCommand

Base implementation of the properties command that attempts to show a JavaBean's FormEditor-compliant customizer.

Version:
$Revision$
Author:
Matthew

Field Summary
protected  Component client
           
protected  Class editorClass
           
 
Fields inherited from class dsto.dfc.swing.commands.BasicPropertiesCommand
ICON
 
Fields inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
listeners
 
Fields inherited from class dsto.dfc.swing.commands.AbstractCommand
displayName, icon
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
AbstractShowCustomizerCommand(Component client)
           
 
Method Summary
protected  void customizeDialog(FormDialog dialog)
          Customize the form dialog that holds the editor before display.
protected  void customizerValueChanged()
          Subclasses should call this when the customizerValue property changes.
 void execute()
          Execute the command.
abstract  Object getCustomizerValue()
          The value to be loaded into the customizer.
protected  String getDialogTitle()
          The title displayed on the property dialog.
protected  Class getEditorClass(Object value)
          Get the editor class for a particular value.
protected  void handleEditorCreateError(Throwable ex)
          Handle an exception thrown when trying to instantiate the editor.
abstract  boolean isDirectEdit()
          Return true if the value returned by getCustomizerValue () should be directly loaded into its form (the form will be set to deferred commit mode).
abstract  void setCustomizerValue(Object newValue)
          Save a new value edited by the customizer.
 
Methods inherited from class dsto.dfc.swing.commands.BasicPropertiesCommand
getDescription, getGroupInView, getIcon, getMnemonic, getName, isInteractive
 
Methods inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
addPropertyChangeListener, clone, isEnabled, removePropertyChangeListener, setEnabled, setIcon
 
Methods inherited from class dsto.dfc.swing.commands.AbstractCommand
actionPerformed, canReplace, getAccelerator, getDefaultDisplayName, getDisplayName, getLargeIcon, getLogString, setDisplayName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

protected Component client

editorClass

protected Class editorClass
Constructor Detail

AbstractShowCustomizerCommand

public AbstractShowCustomizerCommand(Component client)
Method Detail

isDirectEdit

public abstract boolean isDirectEdit()
Return true if the value returned by getCustomizerValue () should be directly loaded into its form (the form will be set to deferred commit mode).


getCustomizerValue

public abstract Object getCustomizerValue()
The value to be loaded into the customizer.


setCustomizerValue

public abstract void setCustomizerValue(Object newValue)
Save a new value edited by the customizer. Only needed when isDirectEdit () is false.


execute

public void execute()
Description copied from interface: Command
Execute the command.

Specified by:
execute in interface Command
Overrides:
execute in class BasicPropertiesCommand

customizerValueChanged

protected void customizerValueChanged()
Subclasses should call this when the customizerValue property changes.


getEditorClass

protected Class getEditorClass(Object value)
Get the editor class for a particular value. The default is to use the editor indicated by BeanDescriptor.getCustomizerClass (), but subclasses may choose to override this.

Returns:
The editor class for value. May return null for no editor.

handleEditorCreateError

protected void handleEditorCreateError(Throwable ex)
Handle an exception thrown when trying to instantiate the editor.


getDialogTitle

protected String getDialogTitle()
The title displayed on the property dialog. Default title is based on the editor value's class name.


customizeDialog

protected void customizeDialog(FormDialog dialog)
Customize the form dialog that holds the editor before display.



Copyright © 2008 Commonwealth of Australia