ooodev.adapter.awt.tree.tree_edit_listener module

namedtuple ooodev.adapter.awt.tree.tree_edit_listener.NodeEditedArgs(node, new_text)[source]

Bases: NamedTuple

Node Edit Args

Fields:
  1.  node (XTreeNode) – Node being edited

  2.  new_text (str) – New Text

class ooodev.adapter.awt.tree.tree_edit_listener.TreeEditListener(trigger_args=None, subscriber=None)[source]

Bases: AdapterBase, XTreeEditListener

You can implement this interface and register with XTreeControl.addTreeEditListener() to get notifications when editing of a node starts and ends.

You have to set the TreeControlModel.Editable property to TRUE before a tree supports editing.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

__init__(trigger_args=None, subscriber=None)[source]

Constructor:

Parameters:
  • trigger_args (GenericArgs, optional) – Args that are passed to events when they are triggered.

  • subscriber (XTreeControl, optional) – An UNO object that implements the XTreeControl interface. If passed in then this listener instance is automatically added to it.

Return type:

None

disposing(event)[source]

Gets called when the broadcaster is about to be disposed.

All listeners and all other objects, which reference the broadcaster should release the reference to the source. No method should be invoked anymore on this object ( including XComponent.removeEventListener() ).

This method is called for every listener registration of derived listener interfaced, not only for registrations at XComponent.

Return type:

None

Parameters:

event (com.sun.star.lang.EventObject) –

nodeEdited(node, new_text)[source]

This method is called from the TreeControl implementation when editing of Node is finished and was not canceled.

Implementations that register a XTreeEditListener must update the display value at the Node.

Note

EventArgs.event_data will contain a NodeEditedArgs object.

Return type:

None

Parameters:
  • node (com.sun.star.awt.tree.XTreeNode) –

  • new_text (str) –

nodeEditing(node)[source]

This method is invoked from the TreeControl implementation when editing of Node is requested by calling XTreeControl.startEditingAtNode().

Raises:

com.sun.star.util.VetoExceptionVetoException

Return type:

None

Parameters:

node (com.sun.star.awt.tree.XTreeNode) –