org.springframework.richclient.application.support
Class LookupViewDescriptor

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.core.LabeledObjectSupport
          extended by org.springframework.richclient.application.support.LookupViewDescriptor
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, PropertyChangePublisher, PageComponentDescriptor, ViewDescriptor, CommandLabelConfigurable, DescribedElement, DescriptionConfigurable, TitleConfigurable, VisualizedElement, ImageConfigurable

public class LookupViewDescriptor
extends LabeledObjectSupport
implements ViewDescriptor, BeanNameAware, BeanFactoryAware, InitializingBean

An implementation of ViewDescriptor that instantiates new Views by looking them up in a Spring BeanFactory. You must set the bean name to lookup in the BeanFactory via setViewPrototypeBeanName(String), and the referenced bean must be a declared non-singleton in the BeanFactory (a prototype bean).

Author:
Andy DePue

Field Summary
 
Fields inherited from class org.springframework.richclient.core.LabeledObjectSupport
logger
 
Fields inherited from interface org.springframework.richclient.core.DescribedElement
CAPTION_PROPERTY, DESCRIPTION_PROPERTY, DISPLAY_NAME_PROPERTY
 
Constructor Summary
LookupViewDescriptor()
           
 
Method Summary
 void afterPropertiesSet()
           
 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.
protected  View createView()
           
 BeanFactory getBeanFactory()
           
 String getId()
          Returns the identifier of this descriptor.
 CommandButtonLabelInfo getShowViewCommandLabel()
           
 String getViewPrototypeBeanName()
           
protected  void initViewDescriptor()
          Subclasses may override this method to perform intialization after properties have been set.
 void setBeanFactory(BeanFactory beanFactory)
           
 void setBeanName(String name)
           
 void setId(String id)
           
 void setViewPrototypeBeanName(String viewPrototypeBeanName)
           
 
Methods inherited from class org.springframework.richclient.core.LabeledObjectSupport
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getAccelerator, getCaption, getDescription, getDisplayName, getIcon, getImage, getLabel, getMnemonic, getMnemonicIndex, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, setCaption, setDescription, setImage, setLabelInfo, setTitle, toString
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.springframework.richclient.core.DescribedElement
getCaption, getDescription, getDisplayName
 
Methods inherited from interface org.springframework.richclient.core.VisualizedElement
getIcon, getImage
 

Constructor Detail

LookupViewDescriptor

public LookupViewDescriptor()
Method Detail

setId

public void setId(String id)

getViewPrototypeBeanName

public String getViewPrototypeBeanName()

setViewPrototypeBeanName

public void setViewPrototypeBeanName(String viewPrototypeBeanName)

getBeanFactory

public BeanFactory getBeanFactory()

createView

protected View createView()

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.

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.

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface BeanNameAware

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Specified by:
setBeanFactory in interface BeanFactoryAware
Throws:
BeansException

afterPropertiesSet

public final void afterPropertiesSet()
                              throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

initViewDescriptor

protected void initViewDescriptor()
                           throws Exception
Subclasses may override this method to perform intialization after properties have been set.

Throws:
Exception


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