org.jfree.report.modules.gui.config.editor
Class DefaultModuleEditor

java.lang.Object
  |
  +--org.jfree.report.modules.gui.config.editor.DefaultModuleEditor

public class DefaultModuleEditor
extends java.lang.Object
implements ModuleEditor

The default module editor provides a simple default implementation to edit all configuration keys for a given module.

Author:
Thomas Morgner

Constructor Summary
DefaultModuleEditor()
          Creates a new, uninitialized module editor.
 
Method Summary
protected  void build()
          Initializes all component for the module editor and creates and layouts all keyeditors.
 boolean canHandle(org.jfree.base.modules.Module module)
          Checks, whether this module editor can handle the given module.
 ModuleEditor createInstance(org.jfree.base.modules.Module module, org.jfree.base.config.HierarchicalConfiguration config, ConfigDescriptionEntry[] keyNames)
          Creates a new, initialized instance of the default module editor.
 javax.swing.JComponent getComponent()
          Returns the editor component of the module.
protected  org.jfree.base.config.HierarchicalConfiguration getConfig()
          Returns the report configuration used when loading values for this editor.
protected  ConfigDescriptionEntry[] getKeyNames()
          Returns the key names used in this editor.
protected  org.jfree.base.modules.Module getModule()
          Returns the currently edited module.
 void reset()
          Resets all keys to the values from the report configuration.
protected  void setConfig(org.jfree.base.config.HierarchicalConfiguration config)
          Defines the report configuration for this editor.
protected  void setKeyNames(ConfigDescriptionEntry[] keyNames)
          Defines the suggested key names for the module editor.
protected  void setModule(org.jfree.base.modules.Module module)
          Defines the module for this editor.
 void store()
          Stores all values for the editor's keys into the report configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModuleEditor

public DefaultModuleEditor()
Creates a new, uninitialized module editor.
Method Detail

createInstance

public ModuleEditor createInstance(org.jfree.base.modules.Module module,
                                   org.jfree.base.config.HierarchicalConfiguration config,
                                   ConfigDescriptionEntry[] keyNames)
Creates a new, initialized instance of the default module editor.
Specified by:
createInstance in interface ModuleEditor
Parameters:
module - the module that should be edited.
config - the report configuration used to fill the values of the editors.
keyNames - the list of keynames this module editor should handle.
Returns:
the created new editor instance.
See Also:
ModuleEditor.createInstance(Module, HierarchicalConfiguration, ConfigDescriptionEntry[])

getModule

protected org.jfree.base.modules.Module getModule()
Returns the currently edited module.
Returns:
the module of this editor.

setModule

protected void setModule(org.jfree.base.modules.Module module)
Defines the module for this editor.
Parameters:
module - the module, which should be handled by this editor.

canHandle

public boolean canHandle(org.jfree.base.modules.Module module)
Checks, whether this module editor can handle the given module.
Specified by:
canHandle in interface ModuleEditor
Parameters:
module - the module to be edited.
Returns:
true, if this editor may be used to edit the module, false otherwise.
See Also:
ModuleEditor.canHandle(Module)

getConfig

protected org.jfree.base.config.HierarchicalConfiguration getConfig()
Returns the report configuration used when loading values for this editor.
Returns:
the report configuration.

setConfig

protected void setConfig(org.jfree.base.config.HierarchicalConfiguration config)
Defines the report configuration for this editor.
Parameters:
config - the report configuration.

getKeyNames

protected ConfigDescriptionEntry[] getKeyNames()
Returns the key names used in this editor.
Returns:
the keynames.

setKeyNames

protected void setKeyNames(ConfigDescriptionEntry[] keyNames)
Defines the suggested key names for the module editor. This implementation will use these keys to build the key editors.
Parameters:
keyNames - the key names for the editor.

getComponent

public javax.swing.JComponent getComponent()
Returns the editor component of the module. Calling this method is only valid on instances created with createInstance.
Specified by:
getComponent in interface ModuleEditor
Returns:
the editor component for the GUI.

build

protected void build()
Initializes all component for the module editor and creates and layouts all keyeditors.

reset

public void reset()
Resets all keys to the values from the report configuration.
Specified by:
reset in interface ModuleEditor

store

public void store()
Stores all values for the editor's keys into the report configuration.
Specified by:
store in interface ModuleEditor