com.jgoodies.skeleton.view.editor
Class EditorView

java.lang.Object
  extended by com.jgoodies.uif.AbstractView
      extended by com.jgoodies.skeleton.view.editor.EditorView

public final class EditorView
extends com.jgoodies.uif.AbstractView

A container that wraps Editor instances with a JScrollPane, which in turn is wrapped by a SimpleInternalFrame.

It keeps track of a collection of editors to be able to update the UIs of invisible editors when the look&feel changes. SwingUtilities#updateComponentTreeUI updates only editors that are in the component tree. Since we have only the active editor in the component tree, we must update other editors by hand. An alternative implementation is to use a CardPanel that has all editors in the component tree, but displays one of them and hides all others.

Refers to a PresentationChooser that selects an Editor appropriate for the currently selected domain object.

Version:
$Revision: 1.14 $
Author:
Karsten Lentzsch
See Also:
NavigationModel, Editor, SwingUtilities.updateComponentTreeUI(java.awt.Component)

Constructor Summary
EditorView(MainModel mainModel)
          Constructs an EditorView for the given main model.
 
Method Summary
 void addEditor(Class domainType, Editor editor)
          Adds an Editor to this EditorView.
protected  JComponent buildPanel()
           
 void setActiveEditor(Editor newEditor)
          Shows the specified Editor: sets the icon, title, tool bar, and finally switches the viewport's view.
 
Methods inherited from class com.jgoodies.uif.AbstractView
getPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorView

public EditorView(MainModel mainModel)
Constructs an EditorView for the given main model.

Parameters:
mainModel - used to observe selection changes
Method Detail

buildPanel

protected JComponent buildPanel()
Specified by:
buildPanel in class com.jgoodies.uif.AbstractView

addEditor

public void addEditor(Class domainType,
                      Editor editor)
Adds an Editor to this EditorView.

Parameters:
domainType - the key used to register the editor for lookup
editor - the editor to add

setActiveEditor

public void setActiveEditor(Editor newEditor)
Shows the specified Editor: sets the icon, title, tool bar, and finally switches the viewport's view.

Parameters:
newEditor - the editor to be set


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