org.jspresso.framework.view.descriptor.basic
Class EntityCardViewDescriptor

java.lang.Object
  extended by org.jspresso.framework.util.descriptor.DefaultDescriptor
      extended by org.jspresso.framework.util.descriptor.DefaultIconDescriptor
          extended by org.jspresso.framework.view.descriptor.basic.BasicViewDescriptor
              extended by org.jspresso.framework.view.descriptor.basic.AbstractCardViewDescriptor
                  extended by org.jspresso.framework.view.descriptor.basic.EntityCardViewDescriptor
All Implemented Interfaces:
Cloneable, ISecurable, IPermIdSource, IDescriptor, IIconDescriptor, IGateAccessible, ICloneable, IActionable, ICardNameSelector, ICardViewDescriptor, IViewDescriptor

public class EntityCardViewDescriptor
extends AbstractCardViewDescriptor

This card view provides a simple card determination strategy that is based on the bound model type. This strategy pulls up the card whose model descriptor matches the type of the bound model.

Version:
$LastChangedRevision: 5621 $
Author:
Vincent Vandenschrick

Field Summary
 
Fields inherited from interface org.jspresso.framework.view.descriptor.ICardViewDescriptor
DEFAULT_CARD, SECURITY_CARD
 
Fields inherited from interface org.jspresso.framework.util.descriptor.IDescriptor
DESCRIPTION, LAST_UPDATED, NAME
 
Constructor Summary
EntityCardViewDescriptor()
           
 
Method Summary
 String getCardNameForModel(Object model, Subject subject)
          Uses the component contract name as card name.
 void setViewDescriptors(List<IViewDescriptor> viewDescriptors)
          Registers the list of card view descriptors.
 
Methods inherited from class org.jspresso.framework.view.descriptor.basic.AbstractCardViewDescriptor
getCardViewDescriptor, putCardViewDescriptor, setCardViewDescriptors
 
Methods inherited from class org.jspresso.framework.view.descriptor.basic.BasicViewDescriptor
getActionMap, getBackground, getBorderType, getFont, getForeground, getGrantedRoles, getI18nDescription, getI18nName, getIconImageURL, getModelDescriptor, getPermId, getPreferredHeight, getPreferredSize, getPreferredWidth, getReadabilityGates, getSecondaryActionMap, getWritabilityGates, isReadOnly, setActionMap, setBackground, setBorderType, setFont, setForeground, setGrantedRoles, setModelDescriptor, setPermId, setPreferredHeight, setPreferredWidth, setReadabilityGates, setReadOnly, setSecondaryActionMap, setWritabilityGates
 
Methods inherited from class org.jspresso.framework.util.descriptor.DefaultIconDescriptor
clone, setIconImageURL
 
Methods inherited from class org.jspresso.framework.util.descriptor.DefaultDescriptor
getDescription, getI18nNameKey, getLastUpdated, getName, setDescription, setI18nNameKey, setLastUpdated, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jspresso.framework.view.descriptor.IViewDescriptor
getBackground, getBorderType, getFont, getForeground, getModelDescriptor, getPreferredSize
 
Methods inherited from interface org.jspresso.framework.util.descriptor.IIconDescriptor
getIconImageURL
 
Methods inherited from interface org.jspresso.framework.util.descriptor.IDescriptor
getDescription, getI18nDescription, getI18nName, getLastUpdated, getName
 
Methods inherited from interface org.jspresso.framework.security.ISecurable
getGrantedRoles
 
Methods inherited from interface org.jspresso.framework.view.action.IActionable
getActionMap, getSecondaryActionMap
 
Methods inherited from interface org.jspresso.framework.util.gate.IGateAccessible
getReadabilityGates, getWritabilityGates, isReadOnly
 
Methods inherited from interface org.jspresso.framework.util.automation.IPermIdSource
getPermId, setPermId
 

Constructor Detail

EntityCardViewDescriptor

public EntityCardViewDescriptor()
Method Detail

getCardNameForModel

public String getCardNameForModel(Object model,
                                  Subject subject)
Uses the component contract name as card name.

Gets the card name to use to present the model.

Parameters:
model - the model to back the view.
subject - the JAAS subject.
Returns:
the card name to look up the view.

setViewDescriptors

public void setViewDescriptors(List<IViewDescriptor> viewDescriptors)
Registers the list of card view descriptors. Every time the bound model changes, this list is iterated until a card with a matching model is found. The first matching card is displayed. Whenever no registered card matches, an empty view is displayed.

Parameters:
viewDescriptors - the viewDescriptors to set.


Copyright © 2005-2012 Jspresso. All Rights Reserved.