This class encapsulates the view types and ids handling for Screen. More...
Public Member Functions | |
| def | setup |
| Initializes the queue with types and ids view definitions. | |
| def | setViewTypes |
| Initializes the queue with a given list of view types. | |
| def | setViewIds |
| Initializes the queue with a given list of view ids. | |
| def | isType |
| Returns True if the next element is a view type. | |
| def | isId |
| Returns True if the next element is a view id. | |
| def | isEmpty |
| Returns True if the queue is empty. | |
| def | next |
| Returns the next element of the queue. | |
This class encapsulates the view types and ids handling for Screen.
Model view definitions have an unintuitive way of handling which views should be shown. There are two ways of specifying it: view types and ids. The problem is that they can be combined. For example: types = ['form','tree'] and ids = [24, False] What this class will do is convert those two lists into one more intuitive list: views = [24, 'tree']
You can initialize this class with values comming from a view definition using the setup function and then pickup each view. Example of usage: queue = ViewQueue() queue.setup( ['form','tree'], [24, False] ) if queue.isType(): useViewAsAType( queue.next() )
Definition at line 44 of file ViewQueue.py.
| def Koo::Screen::ViewQueue::ViewQueue::isEmpty | ( | self | ) |
Returns True if the queue is empty.
Definition at line 100 of file ViewQueue.py.
| def Koo::Screen::ViewQueue::ViewQueue::isId | ( | self | ) |
Returns True if the next element is a view id.
Definition at line 96 of file ViewQueue.py.
| def Koo::Screen::ViewQueue::ViewQueue::isType | ( | self | ) |
Returns True if the next element is a view type.
Definition at line 88 of file ViewQueue.py.
| def Koo::Screen::ViewQueue::ViewQueue::next | ( | self | ) |
Returns the next element of the queue.
If the queue is already empty, it will rise an exception.
Definition at line 106 of file ViewQueue.py.
| def Koo::Screen::ViewQueue::ViewQueue::setViewIds | ( | self, | ||
| ids | ||||
| ) |
Initializes the queue with a given list of view ids.
Definition at line 83 of file ViewQueue.py.
| def Koo::Screen::ViewQueue::ViewQueue::setViewTypes | ( | self, | ||
| types | ||||
| ) |
Initializes the queue with a given list of view types.
If types is None then the list is initialized to the default ['form', 'tree']
Definition at line 75 of file ViewQueue.py.