DESY ACOP Beans Home

com.cosylab.gui.components.customizer
Class EditorChooser

java.lang.Object
  extended by com.cosylab.gui.components.customizer.EditorChooser
All Implemented Interfaces:
Editor

public class EditorChooser
extends java.lang.Object
implements Editor

EditorChooser is convenience implementation, which trys to find one active editor form list of available editorList.

Since:
Jul 15, 2003.
Version:
$id$ EditorChooser.java,v 1.3 2003/07/19 11:52:10 jkamenik Exp $$
Author:
Igor Kriznar, Jernej Kamenik

Field Summary
 
Fields inherited from interface com.cosylab.gui.components.customizer.Editor
ASPECTS
 
Constructor Summary
EditorChooser()
          Default constructor.
 
Method Summary
 void addEditor(Editor editor)
          Adds editor to the list of available editorList.
 void applySettings()
          Applies current settings to the edited displayer.
 boolean canEdit(java.lang.Object displayer, java.lang.String aspect)
          Test if this editor can edit given displayer with given aspect.
 Editor getActiveEditor()
          Returns active editor.
 javax.swing.JComponent getEditorComponent(java.lang.Object displayer, java.lang.String aspect)
          Starts editing session and returns conponent, which will provide GUI for editing some aspect, given with parameter, of the given displayer.
 Editor[] getEditors()
          Returns list of all registered editors.
 void removeEditor(Editor editor)
          Removes provided editor from this list.
 void revertSettings()
          Reverts editor values to currently used settings.
 void stopEditing()
          Stop current editing session and release edited displayer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorChooser

public EditorChooser()
Default constructor.

Method Detail

getEditorComponent

public javax.swing.JComponent getEditorComponent(java.lang.Object displayer,
                                                 java.lang.String aspect)
                                          throws java.lang.IllegalArgumentException
Description copied from interface: Editor
Starts editing session and returns conponent, which will provide GUI for editing some aspect, given with parameter, of the given displayer. IF displayer is not design to edit given component in given aspect, IllegalArgumentException is thrown.

Specified by:
getEditorComponent in interface Editor
aspect - the aspect in which displayer will be edited
Returns:
editor editor component
Throws:
java.lang.IllegalArgumentException

canEdit

public boolean canEdit(java.lang.Object displayer,
                       java.lang.String aspect)
Description copied from interface: Editor
Test if this editor can edit given displayer with given aspect.

Specified by:
canEdit in interface Editor
aspect - the aspect in which displayer should be edited
Returns:
true if this editor can edit given displayer

applySettings

public void applySettings()
Description copied from interface: Editor
Applies current settings to the edited displayer. This does not stop current editing session.

Specified by:
applySettings in interface Editor

revertSettings

public void revertSettings()
Description copied from interface: Editor
Reverts editor values to currently used settings. This does not stop current editing session.

Specified by:
revertSettings in interface Editor

stopEditing

public void stopEditing()
Description copied from interface: Editor
Stop current editing session and release edited displayer.

Specified by:
stopEditing in interface Editor

getActiveEditor

public Editor getActiveEditor()
Returns active editor.

Returns:
returns active editor

getEditors

public Editor[] getEditors()
Returns list of all registered editors.

Returns:
all registered editors

addEditor

public void addEditor(Editor editor)
Adds editor to the list of available editorList.

Parameters:
editor - new available editor

removeEditor

public void removeEditor(Editor editor)
Removes provided editor from this list.

Parameters:
editor - to beremoved


Copyright © 2010. All Rights Reserved.