com.sap.tc.mobile.wdlite.progmodel.core.context
Class ContextNodeMapped

java.lang.Object
  extended by com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNode
      extended by com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNodeMapped
All Implemented Interfaces:
IWDNode, Const, IContextNodeCursorListener, IContextNodeListener, CommonConstants

public class ContextNodeMapped
extends ContextNode
implements IContextNodeListener, IContextNodeCursorListener

The WDL RT ContextNode mapped.


Field Summary
 
Fields inherited from class com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNode
DEFAULT_DOMAIN_SIZE, isActive, modelRelationRole, raw_data, raw_data_iterator, supplyFunctionId
 
Fields inherited from interface com.sap.tc.mobile.wdlite.progmodel.core.Const
CARDINALITY_0_1, CARDINALITY_0_N, CARDINALITY_1_1, CARDINALITY_1_N, EMPTY_ARR, EMPTY_CLASS_ARR, EMPTY_INT_ARRAY, EMPTY_INT_ARRAY2, EMPTY_MAP, FALSE, NAV_INFO_COMPONENT, NAV_INFO_PLUG, NAV_INFO_VIEW, NONE, PROPERTY_EMPTY_ARRAY, TRUE, TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_DECIMAL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_SHORT, TYPE_STRING, TYPE_TIME, TYPE_TIMESTAMP
 
Fields inherited from interface com.sap.tc.mobile.wdlite.util.CommonConstants
BUTTONS_OK, BUTTONS_OK_CANCEL, BUTTONS_RETRY_CANCEL, BUTTONS_YES_NO, BUTTONS_YES_NO_CANCEL, CONTAINER_LAYOUT_FLOWLAYOUT, CONTAINER_LAYOUT_GRIDLAYOUT, ERROR, NORMAL, PROPERTY_ADJUST_IMAGE_SIZE, PROPERTY_BORDER, PROPERTY_CHECKED, PROPERTY_COLS, PROPERTY_CONTAINER_LAYOUT, PROPERTY_DATASOURCE, PROPERTY_DATATYPE, PROPERTY_ENABLED, PROPERTY_FILTERVALUE, PROPERTY_FIRSTVISIBLEROW, PROPERTY_FLOWLAYOUT_WRAPPING, PROPERTY_GRIDDATA_COLSPAN, PROPERTY_GRIDLAYOUT_COLCOUNT, PROPERTY_HEIGHT, PROPERTY_IMAGEFIRST, PROPERTY_IMAGESOURCE, PROPERTY_KEYCODE, PROPERTY_KEYTOSELECT, PROPERTY_LENGTH, PROPERTY_MODEL, PROPERTY_NUMOFTABS, PROPERTY_PASSWORDFIELD, PROPERTY_READONLY, PROPERTY_ROWS, PROPERTY_SELECTEDKEY, PROPERTY_SELECTEDTAB, PROPERTY_SOURCE, PROPERTY_TABLABEL, PROPERTY_TABLE_DESIGN, PROPERTY_TABLE_SELECTIONMODE, PROPERTY_TEXT, PROPERTY_TEXTEDIT_WRAPPING, PROPERTY_TEXTS, PROPERTY_TEXTVIEW_DESIGN, PROPERTY_TYPE, PROPERTY_VALUE, PROPERTY_VISIBLE, PROPERTY_VISIBLEROWCOUNT, PROPERTY_WIDTH, PROPERTY_WRAPPING, RESPONSE_CANCEL, RESPONSE_NO, RESPONSE_OK, RESPONSE_RETRY, RESPONSE_YES, TABLE_DESIGN_ALTERNATING, TABLE_DESIGN_STANDARD, TABLE_DESIGN_TRANSPARENT, TABLE_SELECTION_MODE_SINGLE, TABLE_SELECTIONMODE_AUTO, TABLE_SELECTIONMODE_MULTI, TEXTEDIT_WRAPPING_OFF, TEXTEDIT_WRAPPING_SOFT, TEXTVIEW_DESIGN_EMPHASIZED, TEXTVIEW_DESIGN_HEADER1, TEXTVIEW_DESIGN_HEADER2, TEXTVIEW_DESIGN_HEADER3, TEXTVIEW_DESIGN_HEADER4, TEXTVIEW_DESIGN_LABEL, TEXTVIEW_DESIGN_LABEL_SMALL, TEXTVIEW_DESIGN_LEGEND, TEXTVIEW_DESIGN_MONOSPACE, TEXTVIEW_DESIGN_REFERENCE, TEXTVIEW_DESIGN_STANDARD, TYPE_BUTTON, TYPE_CAPTION, TYPE_CHECKBOX, TYPE_DATEPICKER, TYPE_DATEPICKER_E, TYPE_DROPDOWNBYINDEX, TYPE_DROPDOWNBYKEY, TYPE_IMAGE, TYPE_INPUTFIELD, TYPE_LABEL, TYPE_LINKTOACTION, TYPE_NOTWRAPPEDTEXTEDIT, TYPE_PROGRESS_INDICATOR, TYPE_RADIOBUTTON, TYPE_ROWREPEATER, TYPE_TAB, TYPE_TABLE, TYPE_TABLECOLUMN, TYPE_TABSTRIP, TYPE_TEXTEDIT, TYPE_TEXTVIEW, TYPE_TIMEPICKER, TYPE_TIMEPICKER_E, TYPE_TRANSPARENTCONTAINER, TYPE_UIELEMENT_FUNCTIONKEY, WARNING
 
Constructor Summary
ContextNodeMapped(Context context, int id, java.lang.String name, int parent, int cardinality, int selectionCardinality, boolean singleton, IWDNodeAttribute[] attributes, int[] child, java.lang.Object structure, int mappedNodeId, Controller ctrl)
           
 
Method Summary
 void addElement(int index, IWDNodeElement element)
          Handles the normal behaviour of the non-mapped part of the ContextNode.
 void addElement(IWDNodeElement element)
          Adds an element to the node collection.
 void bind(java.util.Collection items)
          Assumes some collection(and its iterator) of 'raw' data with context node.
 void clearSelections()
          Clears the node's multiple selection; does not change the lead selection.
 IWDNodeElement createElement()
          Creates a new node element of the type used for this value node.
 IWDNodeElement createElement(java.lang.Object model)
          Creates a new node element of the type used for this model node.
 void ensureFetched(int ensureFetched)
          Ensures that required count of raw content fetched into NodeElements list of this ContextNode.
 void enter()
          Life-time callback on Context entering.
 void exit()
          Life-time callback on Context exit.
 java.util.Collection getAttributeTexts(IWDNodeAttribute attribute)
           
 java.lang.Object getAttributeValue(IWDNodeAttribute attribute)
           
 IWDNodeElement getCurrentElement()
          Returns the current element (at the lead selection) or null if no element is selected.
 java.util.ArrayList getElements()
          Gets NodeElements list of this ContextNode.
 int getLeadSelection()
           
 java.util.Collection getRawData()
           
 void init()
          Life-time callback on Context initalizing.
 boolean isMultiSelected(int index)
          Returns whether the element at the given index is selected.
 void listenContextNodeCursorChanged(ContextNode node)
          Invokes when ContextNode cursor changed.
 void listenDomainContextNode(ContextNode contextNode)
          Invokes when ContextNode domain changed.
 void reload()
          Used to re-enter node programmatically, beside regular flow.
 void removeCurrentElement()
          Removes an element from the node collection.
 void setAttributeValue(IWDNodeAttribute attribute, java.lang.Object value)
           
 void setLeadSelection(int index)
          Sets lead selection.
 void setSelected(int index, boolean selected)
          Selects or unselects the element at the given index.
 int size()
           
 
Methods inherited from class com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNode
addContextNodeElementListener, addContextNodeListener, clearSelection, getAttribute, getAttribute, getAttributeIndex, getAttributes, getAttributeValue, getAttributeValue, getChildNode, getChildren, getContext, getCurrentElementOrFirst, getElementAt, getElementIterator, getID, getName, getParent, getParentElement, getSelectionCardinality, invalidate, isEmpty, loadData, notifyCursorChanged, notifyDomainChanged, removeContextNodeElementListener, removeContextNodeListener, removeElement, setAttributeValue, setAttributeValue, setRawData, sortElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextNodeMapped

public ContextNodeMapped(Context context,
                         int id,
                         java.lang.String name,
                         int parent,
                         int cardinality,
                         int selectionCardinality,
                         boolean singleton,
                         IWDNodeAttribute[] attributes,
                         int[] child,
                         java.lang.Object structure,
                         int mappedNodeId,
                         Controller ctrl)
Method Detail

init

public void init()
Description copied from class: ContextNode
Life-time callback on Context initalizing.

Overrides:
init in class ContextNode

enter

public void enter()
Description copied from class: ContextNode
Life-time callback on Context entering. NOTE: drill-down implemented via setLeadSelection().

Overrides:
enter in class ContextNode

exit

public void exit()
Description copied from class: ContextNode
Life-time callback on Context exit.

Overrides:
exit in class ContextNode

reload

public void reload()
Description copied from class: ContextNode
Used to re-enter node programmatically, beside regular flow.

Specified by:
reload in interface IWDNode
Overrides:
reload in class ContextNode

ensureFetched

public void ensureFetched(int ensureFetched)
Description copied from class: ContextNode
Ensures that required count of raw content fetched into NodeElements list of this ContextNode. NOTE: have no sense for IDataEntityList raw data

Overrides:
ensureFetched in class ContextNode

addElement

public void addElement(int index,
                       IWDNodeElement element)
Description copied from class: ContextNode
Handles the normal behaviour of the non-mapped part of the ContextNode. I.e. actually add the element to this node.

Specified by:
addElement in interface IWDNode
Overrides:
addElement in class ContextNode
Parameters:
index - The index to add the IWDNodeElement at.
element - The element to be added

bind

public void bind(java.util.Collection items)
Description copied from class: ContextNode
Assumes some collection(and its iterator) of 'raw' data with context node. NOTE: To invoke from supplyFunction ONLY.

Specified by:
bind in interface IWDNode
Overrides:
bind in class ContextNode
Parameters:
items - The collection of items, which should be bound to this node

clearSelections

public void clearSelections()
Description copied from interface: IWDNode
Clears the node's multiple selection; does not change the lead selection.

Specified by:
clearSelections in interface IWDNode
Overrides:
clearSelections in class ContextNode

removeCurrentElement

public void removeCurrentElement()
Description copied from interface: IWDNode
Removes an element from the node collection. If an ICMIObservableList is bound to the node, this list is modified!

Specified by:
removeCurrentElement in interface IWDNode
Overrides:
removeCurrentElement in class ContextNode

getElements

public java.util.ArrayList getElements()
Description copied from class: ContextNode
Gets NodeElements list of this ContextNode. NOTE: have no sense for IDataEntityList raw data

Overrides:
getElements in class ContextNode
Returns:
ArrayList instance

getRawData

public java.util.Collection getRawData()
Overrides:
getRawData in class ContextNode

size

public int size()
Specified by:
size in interface IWDNode
Overrides:
size in class ContextNode

addElement

public void addElement(IWDNodeElement element)
Description copied from interface: IWDNode
Adds an element to the node collection. If an ICMIObservableList is bound to the node, this list is modified.

Specified by:
addElement in interface IWDNode
Overrides:
addElement in class ContextNode
Parameters:
element - An element that matches the node.

getCurrentElement

public IWDNodeElement getCurrentElement()
Description copied from interface: IWDNode
Returns the current element (at the lead selection) or null if no element is selected.

Specified by:
getCurrentElement in interface IWDNode
Overrides:
getCurrentElement in class ContextNode
Returns:
The current element (at the lead selection) as IWDNodeElement or null if no element is selected.

getLeadSelection

public int getLeadSelection()
Overrides:
getLeadSelection in class ContextNode

isMultiSelected

public boolean isMultiSelected(int index)
Description copied from interface: IWDNode
Returns whether the element at the given index is selected. Does not look at the lead selection.

Specified by:
isMultiSelected in interface IWDNode
Overrides:
isMultiSelected in class ContextNode
Parameters:
index - The index of the element.
Returns:
true if the element is selected.

setLeadSelection

public void setLeadSelection(int index)
Description copied from class: ContextNode
Sets lead selection.

Specified by:
setLeadSelection in interface IWDNode
Overrides:
setLeadSelection in class ContextNode
Parameters:
index - of the selected IWDNodeElement

setSelected

public void setSelected(int index,
                        boolean selected)
Description copied from interface: IWDNode
Selects or unselects the element at the given index.

Specified by:
setSelected in interface IWDNode
Overrides:
setSelected in class ContextNode
Parameters:
index - The index of the element.
selected - The flag, which indicates, whether the element should be selected or unselected.

getAttributeValue

public java.lang.Object getAttributeValue(IWDNodeAttribute attribute)
Overrides:
getAttributeValue in class ContextNode

setAttributeValue

public void setAttributeValue(IWDNodeAttribute attribute,
                              java.lang.Object value)
Overrides:
setAttributeValue in class ContextNode

getAttributeTexts

public java.util.Collection getAttributeTexts(IWDNodeAttribute attribute)
Overrides:
getAttributeTexts in class ContextNode

createElement

public IWDNodeElement createElement(java.lang.Object model)
Description copied from interface: IWDNode
Creates a new node element of the type used for this model node. The element is not yet inserted in the node collection, its IWDNodeElement.node() method will return null. It can be added only to this node, either via bind or via addElement.

Specified by:
createElement in interface IWDNode
Overrides:
createElement in class ContextNode
Parameters:
model - The model class object for new node to be created
Returns:
The created node element as IWDNodeElement.

createElement

public IWDNodeElement createElement()
Description copied from interface: IWDNode
Creates a new node element of the type used for this value node. The element is not yet inserted in the node collection, its IWDNodeElement.node() method will return null. It can be added only to this node, either via bind or via addElement.

Specified by:
createElement in interface IWDNode
Overrides:
createElement in class ContextNode
Returns:
The created node element as IWDNodeElement.

listenDomainContextNode

public void listenDomainContextNode(ContextNode contextNode)
Description copied from interface: IContextNodeListener
Invokes when ContextNode domain changed.

Specified by:
listenDomainContextNode in interface IContextNodeListener

listenContextNodeCursorChanged

public void listenContextNodeCursorChanged(ContextNode node)
Description copied from interface: IContextNodeCursorListener
Invokes when ContextNode cursor changed.

Specified by:
listenContextNodeCursorChanged in interface IContextNodeCursorListener


(c) 2007, SAP AG. All rights reserved.