com.tensegrity.gui.inplaceediting
Class InplaceEditor

java.lang.Object
  extended bycom.tensegrity.gui.inplaceediting.InplaceEditor
Direct Known Subclasses:
InplaceComboEditor, InplaceEditComponent, InplaceTextEditor

public abstract class InplaceEditor
extends java.lang.Object

Abstract class which describes a typical inplace editor. It is meant to be extended by classes which provide an editor control. For more information see getControl().
A class which is interested in editor events can register an InplaceEditorListener to get notified about aborted, cancelled or committed editings.

Version:
$Id: InplaceEditor.java,v 1.2 2006/04/13 10:10:58 MichaelKegel Exp $
Author:
Arnd Houben

Field Summary
protected  BaseComposite bComp
          BaseComposite to which inplace editing is applied
protected  GraphPanel gPanel
          GraphPanel containing the underlying inplace editing element
protected  Label2D label
          Label2D to which inplace editing is applied
 
Constructor Summary
InplaceEditor(Label2D label, BaseComposite bComp, GraphPanel gPanel)
          Constructor which creates a new InplaceEditor instance.
 
Method Summary
protected  void abortEditing()
          Is called in case an editing was aborted.
 void addInplaceEditorListener(InplaceEditorListener l)
          Adding given InplaceEditorListener which gets notified on editing events.
 void commitChanges()
          Is called on normal edit commits.
protected  void editingCancelled()
          Is called in case an editing was cancelled.
abstract  java.lang.Object getControl()
          Returns the editor control, i.e. its visual component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gPanel

protected GraphPanel gPanel
GraphPanel containing the underlying inplace editing element


bComp

protected BaseComposite bComp
BaseComposite to which inplace editing is applied


label

protected Label2D label
Label2D to which inplace editing is applied

Constructor Detail

InplaceEditor

public InplaceEditor(Label2D label,
                     BaseComposite bComp,
                     GraphPanel gPanel)
Constructor which creates a new InplaceEditor instance.

Parameters:
label - Primitive to apply inplace editing to
bComp - Composite to apply inplace editing to
gPanel - contains the underlying element which requests inplace editing
Method Detail

getControl

public abstract java.lang.Object getControl()
Returns the editor control, i.e. its visual component.
For a Swing based editor this is usually an instance of a JComponent class and for an SWT based editor this is usually an extend of Control.

Returns:
the visual editor component for placing into a GUI environment.

addInplaceEditorListener

public final void addInplaceEditorListener(InplaceEditorListener l)
Adding given InplaceEditorListener which gets notified on editing events.

Parameters:
l - the InplaceEditorListener to notify

commitChanges

public void commitChanges()
Is called on normal edit commits. This method notifies the registered InplaceEditorListener.
Overwriting classes should call this method afterwards to notify a registered class.


editingCancelled

protected void editingCancelled()
Is called in case an editing was cancelled. This method notifies the registered InplaceEditorListener.
Overwriting classes should call this method afterwards to notify a registered class.


abortEditing

protected void abortEditing()
Is called in case an editing was aborted. This method notifies the registered InplaceEditorListener.
Overwriting classes should call this method afterwards to notify a registered class.



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.