|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IWDNode
Generic API of all Web Dynpro Lite context nodes.
Create and add NodeElement example
public final class SomeController extends Controller {
...
public void wdInit()
{
IWDNodeElement nodeElement = wdContext.createElement();
wdContext.addElement(nodeElement);
}
...
}
Get and remove current nodeElement example
public final class SomeController extends Controller {
...
public void wdInit()
{
IWDNodeElement nodeElement = wdContext.getCurrentElement();
wdContext.removeCurrentElement();
}
...
}
| Method Summary | |
|---|---|
void |
addElement(int index,
IWDNodeElement element)
Adds an element to the node collection at the given index. |
void |
addElement(IWDNodeElement element)
Adds an element to the node collection. |
void |
bind(java.util.Collection items)
NOTE: To invoke from supplyFunction ONLY. |
void |
clearSelection()
TODO misspelling - should be clearLeadSelection() |
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. |
IWDNode |
getChildNode(java.lang.String nodeName)
Returns the current element (at the lead selection) or null
if no element is selected. |
Context |
getContext()
Returns the context this node belongs to. |
IWDNodeElement |
getCurrentElement()
Returns the current element (at the lead selection) or null
if no element is selected. |
IWDNodeElement |
getElementAt(int pos)
Deprecated. Use getElementsIterator() to traverse through elements. |
java.util.Iterator |
getElementIterator()
Gets iterator for node elements. |
void |
invalidate()
Deprecated. not used more. Use reload() instead of. |
boolean |
isEmpty()
|
boolean |
isMultiSelected(int index)
Returns whether the element at the given index is selected. |
void |
reload()
Reloads contents with notify all listener about Node content changed. |
void |
removeCurrentElement()
Removes an element from the node collection. |
void |
removeElement(IWDNodeElement element)
|
void |
setLeadSelection(int index)
Sets the lead selection to the given index. |
void |
setSelected(int index,
boolean selected)
Selects or unselects the element at the given index. |
int |
size()
|
| Method Detail |
|---|
void addElement(int index,
IWDNodeElement element)
ICMIObservableList is bound to the node, this list is
modified.
index - The index where the element shall be inserted.element - An element that matches the node.
ContextException - if the element does not match the node or if the node is
singleton and the parent node has no valid lead selection
element. TODO: Not yetvoid addElement(IWDNodeElement element)
element - An element that matches the node.
ContextException - if the element does not match the node or if the node is
singleton and the parent node has no valid lead selection
element. TODO: Not yetvoid bind(java.util.Collection items)
Collection to the
node. It is allowed to bind null; in which case the node
is valid containing an empty list.
This collection may contain elements for the node, (in case of mapping)
elements of any origin node of the node, or (for a model node) instances
of the model class.
The node internally creates a List of
NodeElements, either being the ones supplied or wrappers
thereof. The collection itself is thrown away. The order of the elements
in the List is the order of the Collection
'sIterator.
The Collection must obey the cardinalities of the node. It is not allowed
to bind an empty collection to a node of cardinality 1..1 or 1..n, and it
is not allowed to bind more than one item to a node of cardinality 0..1
or 1..1.
If the Collection is an ICMIObservableList,
the node behaves differently. In that case, the list is passed to the
origin node (in case of mapped nodes). This node does not copy the
elements and throw the list away, but uses the list itself to store the
elements.
An ICMIObservableList is not accessed at all during bind,
if cardinality is 0..n and the selection cardinality is 0..1 or 0..n.
Otherwise, isEmpty() or even size()
(cardinality 0..1 or 1..1) is called. TODO: Not yet
Take care: If a node has an ICMIObservableList
attached, modifications to the node (
addElement(IWDNodeElement),
removeElement(IWDNodeElement)) change the list and vice
versa!
Warning: Never use bind if the node has a supplying relation
role. You effectively get the node and the underlying model out of sync.
It is a bad practice to use bind outside the supply function, if there is
one, too. Future releases will probably throw an exception in such cases,
but old application will still be allowed to for compatibility reasons.
items - The collection of items, which should be bound to this node
ContextException - if any of the items do not match the node and/or the node is
singleton and the parent node is empty or does not have a
valid lead selection.void clearSelections()
void clearSelection()
void invalidate()
void reload()
IWDNodeElement createElement()
IWDNodeElement.node() method will return null.
It can be added only to this node, either via bind or via
addElement.
IWDNodeElement.IWDNodeElement createElement(java.lang.Object model)
IWDNodeElement.node() method will return null.
It can be added only to this node, either via bind or via
addElement.
model - The model class object for new node to be created
IWDNodeElement.Context getContext()
IWDContext.IWDNode getChildNode(java.lang.String nodeName)
null
if no element is selected.
IWDNodeElement or null if no
element is selected.IWDNodeElement getCurrentElement()
null
if no element is selected.
IWDNodeElement or null if no
element is selected.IWDNodeElement getElementAt(int pos)
pos -
java.util.Iterator getElementIterator()
boolean isMultiSelected(int index)
index - The index of the element.
true if the element is selected.void removeCurrentElement()
ICMIObservableList is bound to the node, this list is
modified!
void setLeadSelection(int index)
index - The index of the element.
ContextException - TODO: Not yet
if caller tries to reset the selection, but selection is
mandatory.
java.lang.IndexOutOfBoundsException - if the given index is not within the element list.
void setSelected(int index,
boolean selected)
index - The index of the element.selected - The flag, which indicates, whether the element should be
selected or unselected.void removeElement(IWDNodeElement element)
int size()
boolean isEmpty()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||