org.springframework.richclient.samples.simple.ui
Class InitialView

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.factory.AbstractControlFactory
          extended by org.springframework.richclient.application.support.AbstractView
              extended by org.springframework.richclient.samples.simple.ui.InitialView
All Implemented Interfaces:
PropertyChangePublisher, PageComponent, View, DescribedElement, VisualizedElement, ControlFactory

public class InitialView
extends AbstractView

This class defines the initial view to be presented in the sample application. It is constructed automatically by the platform and configured according to the bean specification in the application context. Here's an example configuration:

       <bean id="initialView"
           class="org.springframework.richclient.application.support.DefaultViewDescriptor">
           <property name="viewClass">
               <value>org.springframework.richclient.samples.simple.ui.InitialView</value>
           </property>
           <property name="viewProperties">
               <map>
                   <entry key="firstMessage">
                       <value>This is the first message!</value>
                   </entry>
                   <entry key="descriptionTextPath">
                       <value>org/springframework/richclient/samples/simple/ui/initialViewText.html</value>
                   </entry>
               </map>
           </property>
       </bean>
 
Note that the configuration specifies the properties to be set on this class indirectly. The property set on the DefaultViewDescriptor is called viewProperties and it takes a map of key/value pairs. Each key is the name of a property to be set on the actual view class (this class) and the value is the value to set for that property. So, two properties have been configured, firstMessage and descriptionTextPath. The firstMessage value specifies the key of a message to be displayed and the descriptionTextPath specifies the path to a file containing the text to place in the HTML panel that makes up the main body of this view.

Author:
Larry Streepy

Field Summary
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Fields inherited from interface org.springframework.richclient.core.DescribedElement
CAPTION_PROPERTY, DESCRIPTION_PROPERTY, DISPLAY_NAME_PROPERTY
 
Constructor Summary
InitialView()
           
 
Method Summary
protected  JComponent createControl()
          Create the actual UI control for this view.
 Resource getDescriptionTextPath()
           
 String getFirstMessage()
           
 void setDescriptionTextPath(Resource descriptionTextPath)
          Set the resource that references the file containing the description text to place in the description areas of this view.
 void setFirstMessage(String firstMessage)
          Set the key to the message to be displayed first in the view
 
Methods inherited from class org.springframework.richclient.application.support.AbstractView
addPropertyChangeListener, addPropertyChangeListener, canClose, close, componentClosed, componentFocusGained, componentFocusLost, componentOpened, dispose, getCaption, getContext, getDescription, getDescriptor, getDisplayName, getIcon, getId, getImage, getStatusBar, getWindowCommandManager, getWindowControl, registerLocalCommandExecutors, removePropertyChangeListener, removePropertyChangeListener, setContext, setDescriptor
 
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
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, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.factory.ControlFactory
getControl
 

Constructor Detail

InitialView

public InitialView()
Method Detail

getFirstMessage

public String getFirstMessage()
Returns:
the firstMessage

setFirstMessage

public void setFirstMessage(String firstMessage)
Set the key to the message to be displayed first in the view

Parameters:
firstMessage - the firstMessage to set

getDescriptionTextPath

public Resource getDescriptionTextPath()
Returns:
the descriptionTextPath

setDescriptionTextPath

public void setDescriptionTextPath(Resource descriptionTextPath)
Set the resource that references the file containing the description text to place in the description areas of this view. Note that even though this property is of type Resource, the Spring platform will automatically convert a string path into a resource.

Parameters:
descriptionTextPath - the descriptionTextPath to set

createControl

protected JComponent createControl()
Create the actual UI control for this view. It will be placed into the window according to the layout of the page holding this view.

Specified by:
createControl in class AbstractView
Returns:
The newly created control, never null.


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