org.springframework.richclient.application.support
Class SimpleViewDescriptor

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.application.support.SimpleViewDescriptor
All Implemented Interfaces:
PropertyChangePublisher, PageComponentDescriptor, ViewDescriptor, DescribedElement, VisualizedElement

public class SimpleViewDescriptor
extends Object
implements ViewDescriptor

ViewDescriptor implementation for internal purposes (mostly testing).

This class accepts an existing View instance, and returns this in the createPageComponent() method.

Normally you should never use this class directly.

Author:
Peter De Bruycker

Field Summary
 
Fields inherited from interface org.springframework.richclient.core.DescribedElement
CAPTION_PROPERTY, DESCRIPTION_PROPERTY, DISPLAY_NAME_PROPERTY
 
Constructor Summary
SimpleViewDescriptor(String id, View view)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Register a listener to all properties of this publisher.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Register a listener to a specific property.
 PageComponent createPageComponent()
          Creates the page component defined by this descriptor.
 ActionCommand createShowViewCommand(ApplicationWindow window)
          Create a command that when executed, will attempt to show the page component described by this descriptor in the provided application window.
 String getCaption()
          Returns the caption for this object.
 String getDescription()
          Returns a description of this object.
 String getDisplayName()
          Returns the display name of this object.
 Icon getIcon()
          Returns the icon associated with the application component, or null.
 String getId()
          Returns the identifier of this descriptor.
 Image getImage()
          Returns the image associated with the application component, or null.
 CommandButtonLabelInfo getShowViewCommandLabel()
           
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove the listener from all properties of this publisher.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove the listener from a specific property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleViewDescriptor

public SimpleViewDescriptor(String id,
                            View view)
Method Detail

createShowViewCommand

public ActionCommand createShowViewCommand(ApplicationWindow window)
Description copied from interface: ViewDescriptor
Create a command that when executed, will attempt to show the page component described by this descriptor in the provided application window.

Specified by:
createShowViewCommand in interface ViewDescriptor
Parameters:
window - The window
Returns:
The show page component command.

getShowViewCommandLabel

public CommandButtonLabelInfo getShowViewCommandLabel()
Specified by:
getShowViewCommandLabel in interface ViewDescriptor

createPageComponent

public PageComponent createPageComponent()
Description copied from interface: PageComponentDescriptor
Creates the page component defined by this descriptor.

Specified by:
createPageComponent in interface PageComponentDescriptor
Returns:
The page component, never null.

getId

public String getId()
Description copied from interface: PageComponentDescriptor
Returns the identifier of this descriptor.

Specified by:
getId in interface PageComponentDescriptor
Returns:
The descriptor id.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Register a listener to all properties of this publisher.

Specified by:
addPropertyChangeListener in interface PropertyChangePublisher
Parameters:
listener - the PropertyChangeListener to register.

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Register a listener to a specific property.

Specified by:
addPropertyChangeListener in interface PropertyChangePublisher
Parameters:
propertyName - the property to monitor.
listener - the PropertyChangeListener to register.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Remove the listener from all properties of this publisher.

Specified by:
removePropertyChangeListener in interface PropertyChangePublisher
Parameters:
listener - the PropertyChangeListener to remove.

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Description copied from interface: PropertyChangePublisher
Remove the listener from a specific property.

Specified by:
removePropertyChangeListener in interface PropertyChangePublisher
Parameters:
propertyName - the property that was being monitored.
listener - the PropertyChangeListener to remove.

getCaption

public String getCaption()
Description copied from interface: DescribedElement
Returns the caption for this object.

Specified by:
getCaption in interface DescribedElement
Returns:
The caption, or null.

getDescription

public String getDescription()
Description copied from interface: DescribedElement
Returns a description of this object.

Specified by:
getDescription in interface DescribedElement
Returns:
The description, or null.

getDisplayName

public String getDisplayName()
Description copied from interface: DescribedElement
Returns the display name of this object.

Specified by:
getDisplayName in interface DescribedElement
Returns:
The display name, or null.

getIcon

public Icon getIcon()
Description copied from interface: VisualizedElement
Returns the icon associated with the application component, or null.

Specified by:
getIcon in interface VisualizedElement

getImage

public Image getImage()
Description copied from interface: VisualizedElement
Returns the image associated with the application component, or null.

Specified by:
getImage in interface VisualizedElement


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.