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

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
All Implemented Interfaces:
Cloneable, ISecurable, IPermIdSource, IDescriptor, IIconDescriptor, IGateAccessible, ICloneable, IActionable, ICardNameSelector, ICardViewDescriptor, IViewDescriptor
Direct Known Subclasses:
BasicCardViewDescriptor, EntityCardViewDescriptor, WorkspaceCardViewDescriptor

public abstract class AbstractCardViewDescriptor
extends BasicViewDescriptor
implements ICardViewDescriptor

This descriptor serves as abstract base implementation for card view descriptor. A card view is a view stack made of children views (the cards) where only the view (card) at the top of the stack is visible. The actual child view to place on the top of the stack is dynamically determined based on the bound model. This card determination strategy depends on the concrete descriptor sub-types.

One might wonder why a card view is not considered as (and actually does not inherit from) a composite view. The difference is that composite views are used agregate views that displays - hopefully - different parts (the children views) of the same model. A card view descriptor is rather used to make the same UI region display different views depending on different models (or different model states). Once the model is fixed, the card view behaves exactly as its top card.

One of the most important usage of card views is when it is combine as the detail in a master-detail view. The detail view may then change dynamically based on the selected master.

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
AbstractCardViewDescriptor()
           
 
Method Summary
 IViewDescriptor getCardViewDescriptor(String cardName)
          Gets the child view registered in the card view by its name.
protected  void putCardViewDescriptor(String cardName, IViewDescriptor cardViewDescriptor)
          Puts the child view registered in the card view by its name.
protected  void setCardViewDescriptors(Map<String,IViewDescriptor> cardViewDescriptors)
          Sets the childViewDescriptors.
 
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
 
Methods inherited from interface org.jspresso.framework.view.descriptor.ICardNameSelector
getCardNameForModel
 

Constructor Detail

AbstractCardViewDescriptor

public AbstractCardViewDescriptor()
Method Detail

getCardViewDescriptor

public IViewDescriptor getCardViewDescriptor(String cardName)
Gets the child view registered in the card view by its name.

Specified by:
getCardViewDescriptor in interface ICardViewDescriptor
Parameters:
cardName - the card name to lookup the view for.
Returns:
the child view descriptor.

putCardViewDescriptor

protected void putCardViewDescriptor(String cardName,
                                     IViewDescriptor cardViewDescriptor)
Puts the child view registered in the card view by its name.

Parameters:
cardName - the card name to lookup the view for.
cardViewDescriptor - the child view descriptor.

setCardViewDescriptors

protected void setCardViewDescriptors(Map<String,IViewDescriptor> cardViewDescriptors)
Sets the childViewDescriptors.

Parameters:
cardViewDescriptors - the cardViewDescriptors to set.


Copyright © 2005-2012 Jspresso. All Rights Reserved.