Class DefaultModuleEditor
- java.lang.Object
-
- org.pentaho.reporting.tools.configeditor.editor.DefaultModuleEditor
-
- All Implemented Interfaces:
ModuleEditor
public class DefaultModuleEditor extends 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
Constructors Constructor Description DefaultModuleEditor()
Creates a new, uninitialized module editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
build()
Initializes all component for the module editor and creates and layouts all keyeditors.boolean
canHandle(org.pentaho.reporting.libraries.base.boot.Module module)
Checks whether this module editor can handle the given module.ModuleEditor
createInstance(org.pentaho.reporting.libraries.base.boot.Module module, org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration config, ConfigDescriptionEntry[] keyNames)
Creates a new, initialized instance of the default module editor.JComponent
getComponent()
Returns the editor component of the module.protected org.pentaho.reporting.libraries.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.pentaho.reporting.libraries.base.boot.Module
getModule()
Returns the currently edited module.void
reset()
Resets all keys to the values from the report configuration.protected void
setConfig(org.pentaho.reporting.libraries.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.pentaho.reporting.libraries.base.boot.Module module)
Defines the module for this editor.void
store()
Stores all values for the editor's keys into the report configuration.
-
-
-
Method Detail
-
createInstance
public ModuleEditor createInstance(org.pentaho.reporting.libraries.base.boot.Module module, org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration config, ConfigDescriptionEntry[] keyNames)
Creates a new, initialized instance of the default module editor.- Specified by:
createInstance
in interfaceModuleEditor
- 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.pentaho.reporting.libraries.base.boot.Module getModule()
Returns the currently edited module.- Returns:
- the module of this editor.
-
setModule
protected void setModule(org.pentaho.reporting.libraries.base.boot.Module module)
Defines the module for this editor.- Parameters:
module
- the module, which should be handled by this editor.
-
canHandle
public boolean canHandle(org.pentaho.reporting.libraries.base.boot.Module module)
Checks whether this module editor can handle the given module.- Specified by:
canHandle
in interfaceModuleEditor
- 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.pentaho.reporting.libraries.base.config.HierarchicalConfiguration getConfig()
Returns the report configuration used when loading values for this editor.- Returns:
- the report configuration.
-
setConfig
protected void setConfig(org.pentaho.reporting.libraries.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 JComponent getComponent()
Returns the editor component of the module. Calling this method is only valid on instances created with createInstance.- Specified by:
getComponent
in interfaceModuleEditor
- 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 interfaceModuleEditor
-
store
public void store()
Stores all values for the editor's keys into the report configuration.- Specified by:
store
in interfaceModuleEditor
-
-