org.scopemvc.model.beans
Class BeansEditorManager

java.lang.Object
  |
  +--org.scopemvc.core.ModelManager
        |
        +--org.scopemvc.core.EditorManager
              |
              +--org.scopemvc.model.beans.BeansEditorManager

public class BeansEditorManager
extends EditorManager

BeansEditorManager is a EditorManager that handles creation of editors and viewer for properties of JavaBean model objects.

Currently this ignores BeanInfo and uses the defaults in PropertyEditorFactory since the BeanInfo API has no way to distinguish different View implementations and doesn't have a getter for a viewer, just an editor. We could handle this a little better by type-checking the BeanInfo property editor for instanceof JComponent (and View) to see if it has a Swing impl, however that doesn't really work for arbitrary view types.

Version:
$Revision: 1.7 $ $Date: 2002/09/12 10:51:03 $
Author:
Steve Meyfroidt

Constructor Summary
BeansEditorManager()
           
 
Method Summary
 View getEditor(java.lang.String inViewType, java.lang.Object inModel, Selector inSelector)
          Get the editor for the view type and the property in the model.
 View getViewer(java.lang.String inViewType, java.lang.Object inModel, Selector inSelector)
          Get the viewer for the view type and the property in the model.
 
Methods inherited from class org.scopemvc.core.EditorManager
getInstance, getInstance
 
Methods inherited from class org.scopemvc.core.ModelManager
getModelClass, make
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeansEditorManager

public BeansEditorManager()
Method Detail

getEditor

public View getEditor(java.lang.String inViewType,
                      java.lang.Object inModel,
                      Selector inSelector)
Get the editor for the view type and the property in the model.

Specified by:
getEditor in class EditorManager
Parameters:
inViewType - type of view this editor is needed for. Defaults are provided for "swing" in DefaultScopeConfig that the BeansEditorManager uses.
inModel - model for whose property the editor is required.
inSelector - identify the property that the editor is needed for.
Returns:
a View used to edit the passed model's property for the passed view type.

getViewer

public View getViewer(java.lang.String inViewType,
                      java.lang.Object inModel,
                      Selector inSelector)
Get the viewer for the view type and the property in the model.

Specified by:
getViewer in class EditorManager
Parameters:
inViewType - type of view this viewer is needed for. Defaults are provided for "swing" in DefaultScopeConfig that the BeansEditorManager uses.
inModel - model for whose property the viewer is required.
inSelector - identify the property that the viewer is needed for.
Returns:
a View used to view the passed model's property for the passed view type.


Copyright © 2000-2002 The Scope Team. All Rights Reserved.