mrv :: maya :: ui :: util :: iItemSet :: Class iItemSet
[hide private]
[frames] | no frames]

Class iItemSet

source code

object --+
         |
        iItemSet

Interface allowing to dynamically add, update and remove items to a layout to match a given input set of item ids. Its abstacted to be implemented by subclasses
Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Interface
 
setItems(self, item_ids, **kwargs)
Set the UI to display items identified by the given item_ids
source code
    SubClass Implementation
 
currentItemIds(self, **kwargs)
Returns: list of item ids that are currently available in your layout.
source code
 
handleEvent(self, eventid, **kwargs)
Called whenever a block of items is being handled for an operation identified by eventid, allowing you to prepare for such a block or finish it
source code
 
createItem(self, itemid, **kwargs)
Create an item identified by the given itemid and add it to your layout
source code
 
updateItem(self, itemid, **kwargs)
Update the item identified by the given itemid so that it represents the current state of the application
source code
 
removeItem(self, itemid, **kwargs)
Remove the given item identified by itemid so it does not show up in this layout anymore
source code
Class Variables [hide private]
  eSetItemCBID = enum("preCreate", "preUpdate", "preRemove", "po...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setItems(self, item_ids, **kwargs)

source code 
Set the UI to display items identified by the given item_ids
Parameters:
  • item_ids - ids behaving appropriately if put into a set
  • kwargs - passed on to the handler methods ( which are implemented by the subclass ). Use these to pass on additional data that you might want to use to keep additional information about your item ids
Returns:
tuple( SetOfDeletedItemIds, SetOfCreatedItemIds )

Note: you are responsible for generating a list of item_ids and call this method to trigger the update

currentItemIds(self, **kwargs)

source code 
Returns:
list of item ids that are currently available in your layout. They will be passed around to the createItem, updateItem and`removeItem` methods and is the foundation of the setItems method. Ids returned here must be compatible to the ids passed in to setItems

handleEvent(self, eventid, **kwargs)

source code 
Called whenever a block of items is being handled for an operation identified by eventid, allowing you to prepare for such a block or finish it
Parameters:
  • eventid - eSetItemCBID identifying the event to handle

createItem(self, itemid, **kwargs)

source code 
Create an item identified by the given itemid and add it to your layout
Returns:
created item or None to indicate error. On error, the item will not be updated anymore

removeItem(self, itemid, **kwargs)

source code 
Remove the given item identified by itemid so it does not show up in this layout anymore

Note: its up to you how you remove the item, as long as it is not visible anymore


Class Variable Details [hide private]

eSetItemCBID

Value:
enum("preCreate", "preUpdate", "preRemove", "postCreate", "postUpdate"\
, "postRemove")