org.springframework.richclient.command.support
Class ShowViewCommand

java.lang.Object
  extended by org.springframework.binding.value.support.AbstractPropertyChangePublisher
      extended by org.springframework.richclient.command.AbstractCommand
          extended by org.springframework.richclient.command.ActionCommand
              extended by org.springframework.richclient.command.support.ApplicationWindowAwareCommand
                  extended by org.springframework.richclient.command.support.ShowViewCommand
All Implemented Interfaces:
BeanNameAware, InitializingBean, PropertyChangePublisher, ApplicationWindowAware, ActionCommandExecutor, GuardedActionCommandExecutor, ParameterizableActionCommandExecutor, Authorizable, Guarded, SecurityControllable

public class ShowViewCommand
extends ApplicationWindowAwareCommand
implements InitializingBean

An action command for displaying a View based on a provided ViewDescriptor.


Field Summary
 
Fields inherited from class org.springframework.richclient.command.ActionCommand
ACTION_COMMAND_PARAMETER_KEY, ACTION_COMMAND_PROPERTY, ACTION_EVENT_PARAMETER_KEY, MODIFIERS_PARAMETER_KEY
 
Fields inherited from class org.springframework.richclient.command.AbstractCommand
ENABLED_PROPERTY_NAME, VISIBLE_PROPERTY_NAME
 
Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
logger
 
Fields inherited from interface org.springframework.richclient.core.Authorizable
AUTHORIZED_PROPERTY
 
Constructor Summary
ShowViewCommand()
          Creates a new uninitialized ShowViewCommand.
ShowViewCommand(ViewDescriptor viewDescriptor, ApplicationWindow applicationWindow)
          Creates a new ShowViewCommand with the given view descriptor and associated application window.
 
Method Summary
 void afterPropertiesSet()
          Performs initialisation and validation of this instance after its dependencies have been set.
protected  void doExecuteCommand()
          Causes the view described by this instance's view descriptor to be shown.
 void setViewDescriptor(ViewDescriptor viewDescriptor)
          Sets the descriptor for the view that is to be opened by this command object.
 
Methods inherited from class org.springframework.richclient.command.support.ApplicationWindowAwareCommand
getApplicationWindow, getParentWindowControl, setApplicationWindow
 
Methods inherited from class org.springframework.richclient.command.ActionCommand
addCommandInterceptor, addParameter, execute, execute, getActionAdapter, getActionCommand, getModifiers, getParameter, getParameter, getParameters, isDisplaysInputDialog, onButtonAttached, onPostExecute, onPreExecute, removeCommandInterceptor, setActionCommand, setDefaultButton, setDefaultButtonIn, setDisplaysInputDialog
 
Methods inherited from class org.springframework.richclient.command.AbstractCommand
addEnabledListener, attach, attach, attach, buttonIterator, createButton, createButton, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, createMenuItem, createMenuItem, defaultButtonIterator, detach, getAccelerator, getButtonFactory, getButtonIn, getCommandServices, getComponentFactory, getDefaultButtonConfigurer, getDefaultFaceDescriptorId, getFaceDescriptor, getFaceDescriptorRegistry, getIcon, getId, getMenuFactory, getMenuItemButtonConfigurer, getMnemonic, getMnemonicIndex, getSecurityControllerId, getText, getToolBarButtonConfigurer, getToolBarButtonFactory, isAnonymous, isAttached, isAuthorized, isEnabled, isFaceConfigured, isVisible, onButtonDetached, removeEnabledListener, requestFocusIn, setAuthorized, setBeanName, setCaption, setCommandServices, setDefaultFaceDescriptorId, setEnabled, setFaceDescriptor, setFaceDescriptor, setFaceDescriptorRegistry, setFaceDescriptors, setIcon, setIconInfo, setId, setLabel, setLabel, setSecurityControllerId, setVisible, toString, updatedEnabledState, updatedVisibleState
 
Methods inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShowViewCommand

public ShowViewCommand()
Creates a new uninitialized ShowViewCommand. The applicationWindow and viewDescriptor properties must be set before using the new instance.


ShowViewCommand

public ShowViewCommand(ViewDescriptor viewDescriptor,
                       ApplicationWindow applicationWindow)
Creates a new ShowViewCommand with the given view descriptor and associated application window. The new instance will have a command identifier equal to the id from the view descriptor, the command will be enabled by default.

Parameters:
viewDescriptor - The object describing the view that this command will be responsible for showing.
applicationWindow - The application window that the command belongs to.
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Performs initialisation and validation of this instance after its dependencies have been set. If subclasses override this method, they should begin by calling super.afterPropertiesSet().

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractCommand

setViewDescriptor

public final void setViewDescriptor(ViewDescriptor viewDescriptor)
Sets the descriptor for the view that is to be opened by this command object. This command object will be assigned the id, label, icon, and caption from the given view descriptor.

Parameters:
viewDescriptor - The view descriptor, cannot be null.
Throws:
IllegalArgumentException - if viewDescriptor is null.

doExecuteCommand

protected void doExecuteCommand()
Causes the view described by this instance's view descriptor to be shown.

Specified by:
doExecuteCommand in class ActionCommand


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