com.jgoodies.skeleton.view.editor
Interface Editor

All Known Implementing Classes:
AbstractEditor, DescriptionEditor, FlangeEditor, SegmentEditor, ShaftEditor, WelcomeView

public interface Editor

This interface describes general editors that have an Icon, title, ToolBar, and that can set and return a model.

Version:
$Revision: 1.11 $
Author:
Karsten Lentzsch
See Also:
AbstractEditor

Method Summary
 void activate()
          Activates this editor.
 void deactivate()
          Deactivates the editor.
 Icon getIcon()
          Returns this editor's icon.
 JComponent getPanel()
          Returns this editor's panel.
 String getTitle()
          Returns this editor's title.
 JToolBar getToolBar()
          Returns this editor's tool bar.
 void updateModel(Object model)
          Reads the values from this editor's components and sets them in the given model.
 void updateView(Object model)
          Reads the values from the given model and sets them in this editor's components.
 

Method Detail

getIcon

Icon getIcon()
Returns this editor's icon. The icon can be shared by all editors for a domain type, or it can change for every individual edited domain object.

Returns:
this editor's icon

getTitle

String getTitle()
Returns this editor's title. The title can be shared by all editors for a domain type, or it can change with every individual edited domain object.

Returns:
this editor's title.

getToolBar

JToolBar getToolBar()
Returns this editor's tool bar.

Returns:
this editor's tool bar

getPanel

JComponent getPanel()
Returns this editor's panel.

Returns:
this editor's built panel

activate

void activate()
Activates this editor. This method is invoked if this editor shall become the active editor. In Skeleton (Pro) this happens whenever the selection type in the navigation panel has changed and this editor is associated with the new selection. For example if the selection changes from type Flange to type Shaft, this method will be invoked. It will not be invoked if the selection changes from Flange1 to Flange2.

Implementors may choose to do nothing or update the view. This depends on who can change domain objects. If only editors can change the domain, you likely need not update the view on editor activation. If the domain objects can be changed by third parties, you may need to update the view if an editor gets activated.

Implementors may also need to perform additional actions on activation. For example, scroll a list or table to make the current selection visible.


deactivate

void deactivate()
Deactivates the editor. This method is invoked if the selection type in the navigation panel has changed and this editor is associated with the old selection.

Typically an implementor needs to update the model data by copying values from this editor's components to the model.


updateModel

void updateModel(Object model)
Reads the values from this editor's components and sets them in the given model.

Parameters:
model - the object to write this editor's value to

updateView

void updateView(Object model)
Reads the values from the given model and sets them in this editor's components.

Parameters:
model - the object to read the values from


Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.