net.sourceforge.geeboss.model.editors
Class EditorHandler

java.lang.Object
  extended by net.sourceforge.geeboss.model.editors.EditorHandler
All Implemented Interfaces:
LoadConfigurationSupport
Direct Known Subclasses:
MemoryObjectEditorHandler

public abstract class EditorHandler
extends java.lang.Object
implements LoadConfigurationSupport

Base handler class for Editors

Author:
Frederic BORRY

Field Summary
protected  GeebossContainer mContainer
          Reference to the container
 
Constructor Summary
EditorHandler(org.apache.avalon.framework.configuration.Configuration configuration, GeebossContainer container)
          Create an new EditorHandler given an editor's configuration
 
Method Summary
 void activate()
          Activate the editor associated to this handler
 void addParameterChangeListener(ParameterChangeListener listener)
          Register a parameter change listener
abstract  Parameter createParameterInstance(org.apache.avalon.framework.configuration.Configuration configuration, GeebossContainer container)
          Create a parameter instance for this handler given the parameter name
 void fireParameterChanged(Parameter parameter)
          Fire a parameter change event for the provided parameter
 void fireParameterChanged(java.lang.String parameterName)
          Fire a parameter change event for the named parameter
 Editor getEditor()
          Returns the editor instance associated to this handler
 java.lang.String getName()
          Returns this editor's name
 Parameter getParameter(java.lang.String parameterName)
          Get a parameter given it's name
 Parameter[] getParameters()
          Returns the parameters of this editor
 void loadConfiguration(org.apache.avalon.framework.configuration.Configuration configuration, GeebossContainer container)
          Load this EditorHandler's configuration
 void removeParameterChangeListener(ParameterChangeListener listener)
          Remove a parameter change listener
abstract  void requestUpdate()
          Request an update for this editor's values
 Editor setupEditor(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.graphics.Image background)
          Instanciate the editor for this handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mContainer

protected GeebossContainer mContainer
Reference to the container

Constructor Detail

EditorHandler

public EditorHandler(org.apache.avalon.framework.configuration.Configuration configuration,
                     GeebossContainer container)
              throws org.apache.avalon.framework.configuration.ConfigurationException
Create an new EditorHandler given an editor's configuration

Parameters:
configuration - the editor's configuration
container - the geeboss container
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
Method Detail

createParameterInstance

public abstract Parameter createParameterInstance(org.apache.avalon.framework.configuration.Configuration configuration,
                                                  GeebossContainer container)
                                           throws org.apache.avalon.framework.configuration.ConfigurationException
Create a parameter instance for this handler given the parameter name

Parameters:
configuration - the parameter configuraion
container - the geeboss container
Returns:
the created Parameter instance
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

getEditor

public Editor getEditor()
Returns the editor instance associated to this handler

Returns:
the editor instance associated to this handler

getName

public java.lang.String getName()
Returns this editor's name

Returns:
this editor's name

setupEditor

public Editor setupEditor(org.eclipse.swt.widgets.Composite parent,
                          int style,
                          org.eclipse.swt.graphics.Image background)
Instanciate the editor for this handler

Parameters:
parent - the parent component
style - the style flag
background - the background the pedal will be displayed on

loadConfiguration

public void loadConfiguration(org.apache.avalon.framework.configuration.Configuration configuration,
                              GeebossContainer container)
                       throws org.apache.avalon.framework.configuration.ConfigurationException
Load this EditorHandler's configuration

Specified by:
loadConfiguration in interface LoadConfigurationSupport
Parameters:
configuration - the configuration object
container - the geeboss container
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

getParameter

public Parameter getParameter(java.lang.String parameterName)
Get a parameter given it's name

Parameters:
parameterName - the name of the paramter
Returns:
the parameter or null if no parameter has the specified name

getParameters

public Parameter[] getParameters()
Returns the parameters of this editor

Returns:
the parameters of this editor

addParameterChangeListener

public void addParameterChangeListener(ParameterChangeListener listener)
Register a parameter change listener

Parameters:
listener - the parameter change listener to register

removeParameterChangeListener

public void removeParameterChangeListener(ParameterChangeListener listener)
Remove a parameter change listener

Parameters:
listener - the parameter change listener to remove

fireParameterChanged

public void fireParameterChanged(java.lang.String parameterName)
Fire a parameter change event for the named parameter

Parameters:
parameterName - the name of the parameter

fireParameterChanged

public void fireParameterChanged(Parameter parameter)
Fire a parameter change event for the provided parameter

Parameters:
parameter - the parameter

activate

public void activate()
Activate the editor associated to this handler


requestUpdate

public abstract void requestUpdate()
Request an update for this editor's values



Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.