chemaxon.alchemist.configbuilder
Class AbstractConfigElementEditor

java.lang.Object
  extended by chemaxon.alchemist.configbuilder.AbstractConfigElementEditor
All Implemented Interfaces:
ConfigElementEditor
Direct Known Subclasses:
BasicConfigElementEditor

public abstract class AbstractConfigElementEditor
extends java.lang.Object
implements ConfigElementEditor

A ConfigElementEditor implementation with customizable editor component.
The main editor component is a JPanel instance. The layout used by main editor component is defined in getMainLayout(). Component creation is done in addComponents(). To perform custom initialization, override initialize() method.

Author:
Istvan Cseh

Field Summary
protected  ConfigElement element
          the element being edited
protected  javax.swing.JPanel mainPanel
          the main editor component
 
Constructor Summary
AbstractConfigElementEditor()
           
 
Method Summary
protected abstract  void addComponents()
          Creates and adds components for mainPanel
 java.awt.Component getEditorComponent(ConfigElement value)
          Sets an initial value for the editor.
 ConfigElement getEditorValue()
          Returns the ConfigElement contained in the editor
protected abstract  java.awt.LayoutManager getMainLayout()
          Returns a LayoutManager instance for mainPanel
protected  javax.swing.JPanel getMainPanel()
          Creates a mainPanel instance (if not initialized) sets layout, and calls addComponents
protected  javax.swing.JLabel getTitle(java.lang.String text)
          Returns a customized JLabel for title
protected  void initialize()
          Initializes and sets editor components to represent element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mainPanel

protected javax.swing.JPanel mainPanel
the main editor component


element

protected ConfigElement element
the element being edited

Constructor Detail

AbstractConfigElementEditor

public AbstractConfigElementEditor()
Method Detail

getTitle

protected javax.swing.JLabel getTitle(java.lang.String text)
Returns a customized JLabel for title

Parameters:
text - is the title text
Returns:
a customized JLabel

getEditorComponent

public java.awt.Component getEditorComponent(ConfigElement value)
Description copied from interface: ConfigElementEditor
Sets an initial value for the editor. Returns the component that should be added to the client's Component hierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input.

Specified by:
getEditorComponent in interface ConfigElementEditor
Parameters:
value - is the initial value being set
Returns:
the component for editing

getEditorValue

public ConfigElement getEditorValue()
Description copied from interface: ConfigElementEditor
Returns the ConfigElement contained in the editor

Specified by:
getEditorValue in interface ConfigElementEditor
Returns:
the ConfigElement contained in the editor

initialize

protected void initialize()
Initializes and sets editor components to represent element


getMainLayout

protected abstract java.awt.LayoutManager getMainLayout()
Returns a LayoutManager instance for mainPanel

Returns:
a LayoutManager instance for mainPanel

getMainPanel

protected javax.swing.JPanel getMainPanel()
Creates a mainPanel instance (if not initialized) sets layout, and calls addComponents

Returns:
initialized mainPanel
See Also:
getMainLayout(), addComponents()

addComponents

protected abstract void addComponents()
Creates and adds components for mainPanel