public class WCardManager extends AbstractMutableContainer
A WCardManager is a wcomponent used to control the visibility of its child components. It can help to think of a WCardManager as a deck of cards, where only the top most card is visible. The WCardManager enables you to add cards to the deck (using the "add" method) and to select which of the cards to place on the top of the deck (using the "makeVisible" method).
You would expect a WComponent that is using a WCardManager to support its functionality, to add all the cards it will need in its constructor. Note that the first card added will be the default visible component. Implementations of the Action interface are normally used to change which card is visible.
Modifier and Type | Class and Description |
---|---|
static class |
WCardManager.CardManagerModel
Holds the extrinsic state information of a CardManager.
|
AbstractWComponent.WComponentRef
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
Constructor and Description |
---|
WCardManager()
Creates a WCardManager.
|
Modifier and Type | Method and Description |
---|---|
void |
add(WComponent component)
Override add so that components are added to the (invisible) container.
|
protected WInvisibleContainer |
getCardContainer() |
protected WCardManager.CardManagerModel |
getComponentModel()
Returns the effective component model for this component.
|
protected WCardManager.CardManagerModel |
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.
|
WComponent |
getVisible()
Returns the visible component (card) for the given context.
|
void |
handleRequest(Request request)
Since none of the children are visible to standard processing, handleRequest has been overridden so that the
visible card is processed.
|
void |
makeVisible(WComponent component)
Sets the visible component (card) for the given context.
|
protected WCardManager.CardManagerModel |
newComponentModel()
Creates a new component model appropriate for this component.
|
protected void |
paintComponent(RenderContext renderContext)
Since none of the children are visible to standard processing, paintComponent has been overridden so that the
visible card is painted.
|
protected void |
preparePaintComponent(Request request)
Since none of the children are visible to standard processing, preparePaintComponent has been overridden so that
the visible card is prepared.
|
void |
remove(WComponent component)
Override remove so that components are removed from the (invisible) container.
|
void |
removeAll()
Override removeAll so that all components are removed from the (invisible) container.
|
void |
showErrorIndicators(List<Diagnostic> diags)
Override method to show Error indicators on the visible card.
|
void |
showWarningIndicators(List<Diagnostic> diags)
Override method to show Warning indicators on the visible card.
|
String |
toString()
Creates a String representation of this component; usually for debugging purposes.
|
protected void |
validateComponent(List<Diagnostic> diags)
Since none of the children are visible to standard processing, validateComponent has been overridden so that the
visible card is processed.
|
add
getNamingContextId, isNamingContext, setNamingContext
getChildAt, getChildCount, getChildren, getIndexOfChild
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicatorsForComponent, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, validate, writeReplace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNamingContextId, isNamingContext
getChildAt, getChildCount, getChildren, getIndexOfChild
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, tidyUpUIContextForTree, validate
protected WInvisibleContainer getCardContainer()
public WComponent getVisible()
public void makeVisible(WComponent component)
component
- the visible component.public void add(WComponent component)
add
in interface MutableContainer
add
in class AbstractMutableContainer
component
- the component to add.public void remove(WComponent component)
remove
in interface MutableContainer
remove
in class AbstractMutableContainer
component
- the component to remove.public void removeAll()
removeAll
in interface MutableContainer
removeAll
in class AbstractMutableContainer
public void handleRequest(Request request)
handleRequest
in interface WComponent
handleRequest
in class AbstractWComponent
request
- the request being responded to.protected void preparePaintComponent(Request request)
preparePaintComponent
in class AbstractWComponent
request
- the request being responded to.protected void paintComponent(RenderContext renderContext)
paintComponent
in class AbstractWComponent
renderContext
- the RenderContext to paint to.protected void validateComponent(List<Diagnostic> diags)
validateComponent
in class AbstractWComponent
diags
- the list to add validation diagnostics to.public void showErrorIndicators(List<Diagnostic> diags)
showErrorIndicators
in interface WComponent
showErrorIndicators
in class AbstractWComponent
diags
- the list of diagnostics containing errors.public void showWarningIndicators(List<Diagnostic> diags)
showWarningIndicators
in interface WComponent
showWarningIndicators
in class AbstractWComponent
diags
- the list of diagnostics containing warnings.public String toString()
AbstractWComponent
toString
in class AbstractWComponent
protected WCardManager.CardManagerModel newComponentModel()
newComponentModel
in class AbstractWComponent
protected WCardManager.CardManagerModel getComponentModel()
getComponentModel
in class AbstractWComponent
protected WCardManager.CardManagerModel getOrCreateComponentModel()
getOrCreateComponentModel
in class AbstractWComponent
Copyright © 2021. All rights reserved.