com.tensegrity.generic.attribute
Interface CustomAttributeEditor

All Known Implementing Classes:
CompositeTableSpanEditor, DirectoryLocationEditor, ItemListAttributeEditor

public interface CustomAttributeEditor

The CustomAttributeEditor interface defines the default behaviour of an editor for (custom) attributes. The setValue method is needed during the initialization phase, while the getValue is used to retrieve the edited value.

Editor's can be in-place, that means, they reside within the AttributeTable, or standalone like Dialogs, Windows or Frames.

Each editor receives a call to the show method to indicate the start of the editing process. Window/Frame based Editors should be modal.

The order of calls is like this:

Version:
$Id: CustomAttributeEditor.java,v 1.9 2005/03/17 12:50:02 BurkhardWick Exp $
Author:
Gilles Iachelini, Burkhard Wick

Method Summary
 java.lang.Object getComponent(CustomAttributeEditorEnvironment environment)
          All those editors which return false in the isStandalone method *must* return a valid instance of a Component here to let the AttributeTable layout it as an in-place editor.
 java.lang.Object getValue()
          Returns the currently edited value of the editor.
 boolean isStandalone()
          Returns true for all editors that display a modal dialog for editing of the value.
 void setValue(java.lang.Object value)
          Sets the value on the editor.
 void showEditor(CustomAttributeEditorEnvironment environment)
          This method will be invoked to initiate the editing process.
 boolean wasCanceled()
          This method is checked right after the showEditor method returns.
 

Method Detail

setValue

public void setValue(java.lang.Object value)
Sets the value on the editor.

Parameters:
value - the value to be edited.

getValue

public java.lang.Object getValue()
Returns the currently edited value of the editor.

Returns:
the currently edited value.

isStandalone

public boolean isStandalone()
Returns true for all editors that display a modal dialog for editing of the value. It returns false if the editor will provide an in-place editor which will be shown inside of the AttributeEditor.

Returns:
true for editors that are using a modal dialog for editing

getComponent

public java.lang.Object getComponent(CustomAttributeEditorEnvironment environment)
All those editors which return false in the isStandalone method *must* return a valid instance of a Component here to let the AttributeTable layout it as an in-place editor. If isStandalone returns true, this method is ignored.

NOTE: the implementation of CustomAttributeEditor is then responsible to delegate the setValue and getValue calls to this Component.

Parameters:
environment - The environment with information about where the editor will be used.
Returns:
an instance of Component to be used as an editor.

showEditor

public void showEditor(CustomAttributeEditorEnvironment environment)
This method will be invoked to initiate the editing process. For all those editors which are standalone this call is useful to open the frame, window,dialog or whatever is used to realize the editor. This method has to be synchronous, so that the method will return after editing is completely finished.

Parameters:
environment - The environment with information about where the editor will be used.

wasCanceled

public boolean wasCanceled()
This method is checked right after the showEditor method returns. If an editor returns true, no further changes are made to the value and the whole editing process is treated as it was canceled by the user.

Returns:
true, if the editor was canceled.


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