Class Form.TabIterator
- All Implemented Interfaces:
Iterator<Component>, ListIterator<Component>
- Enclosing class:
Form
Iterates through the components on this form in traversal order.
See also
- #getTabIterator(com.codename1.ui.Component)
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a component to the end of the iterator.Gets the current component in this iterator.getNext()Gets the next component in this iterator.Gets the previous component that should be traversed when going "back" in through the form components.booleanhasNext()Checks to see if there is a "next" component to traverse focus to in this iterator.booleanChecks if this iterator has a "previous" component.next()Returns the next component in this iterator, and repositions the iterator at this component.intGets the index within the iterator of the next component.previous()Returns the previous component in this iterator, and repositions the iterator at this component.intGets the index within the iterator of the previous component.voidremove()Removes the current component from the iterator, and repositions the iterator to the previous component, or the next component (if previous doesn't exist).voidReplaces the current component, in the iterator, with the provided component.voidsetCurrent(Component cmp) Sets the current component in the iterator.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Method Details
-
getCurrent
Gets the current component in this iterator. -
setCurrent
Sets the current component in the iterator. This reposition the iterator to the given component.
Parameters
cmp: The component to set as the current component.
-
getNext
Gets the next component in this iterator. If the current component explicitly specifies a nextFocusRight or nextFocusDown component, then that component will be returned. Otherwise it will follow the tab index order.
Returns
The next component to be traversed after
#getCurrent() -
getPrevious
Gets the previous component that should be traversed when going "back" in through the form components. If the current component has a nextFocusLeft or nextFocusUp field explicitly specified, then it will return that. Otherwise it just follows the traversal order using the tab index.
Returns
The previous component according to traversal order.
-
hasNext
-
next
-
hasPrevious
public boolean hasPrevious()Checks if this iterator has a "previous" component.- Specified by:
hasPreviousin interfaceListIterator<Component>
-
previous
Returns the previous component in this iterator, and repositions the iterator at this component.- Specified by:
previousin interfaceListIterator<Component>
-
nextIndex
public int nextIndex()Gets the index within the iterator of the next component.- Specified by:
nextIndexin interfaceListIterator<Component>
-
previousIndex
public int previousIndex()Gets the index within the iterator of the previous component.- Specified by:
previousIndexin interfaceListIterator<Component>
-
remove
-
set
Replaces the current component, in the iterator, with the provided component. This will not actually replace the component in the form's hierarchy. Just within the iterator.
Parameters
e: The component to set as the current component.
- Specified by:
setin interfaceListIterator<Component>
-
add
Adds a component to the end of the iterator.
Parameters
e: The component to add to the iterator.
- Specified by:
addin interfaceListIterator<Component>
-