Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: awt :: tree ::

interface XTreeControl
Base Interfaces
XTreeControl
┗ ::com::sun::star::view::XMultiSelectionSupplier
   ┗ ::com::sun::star::view::XSelectionSupplier

::com::sun::star::view::XMultiSelectionSupplier
Description
This interfaces provides access to the selection of tree nodes for this control.

valid selection values for this interface are XTreeNode or sequence<XTreeNode>.

XSelectionSupplier::getSelection() returns an emtpy any for no selection, an any with XTreeNode for a single selection and a sequence<XTreeNode> for a multiselection.
Description
An interface to a control that displays a set of hierarchical data as an outline.
See also
TreeControl

Methods' Summary
isNodeExpanded Returns true if Node is currently expanded.  
isNodeCollapsed Returns true if Node is currently collapsed.  
makeNodeVisible Ensures that Node is currently visible.  
isNodeVisible Returns true if Node is currently visible.  
expandNode Ensures that Node is expanded and visible.  
collapseNode Ensures that Node is collapsed.  
addTreeExpansionListener Adds a listener for ::TreeExpansion events.  
removeTreeExpansionListener Removes a listener for ::TreeExpansion events.  
getNodeForLocation Returns the node at the specified location.  
getClosestNodeForLocation Returns the node that is closest to x,y.  
getNodeRect returns the rectangle occupied by the visual representation of the given node  
isEditing Returns true if one of tree's nodes is being currently edited.  
stopEditing Ends the current editing session.  
cancelEditing Cancels the current editing session.  
startEditingAtNode Selects Node and initiates editing.  
addTreeEditListener Adds a XTreeEditListener.  
removeTreeEditListener Removes a XTreeEditListener.  
Attributes' Summary
DefaultExpandedGraphicURL If the given URL points to a loadable graphic, the graphic is rendered before expanded non leaf nodes.  
DefaultCollapsedGraphicURL If the given URL points to a loadable graphic, the graphic is rendered before collapsed non leaf nodes.  
Methods' Details
isNodeExpanded
boolean
isNodeExpanded( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Returns true if Node is currently expanded.
Parameter Node
the XTreeNode specifying the node to check.
Returns
false if Node or at least one of its parent nodes are collapsed, true if Node and all of its parent nodes are expanded.
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
isNodeCollapsed
boolean
isNodeCollapsed( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Returns true if Node is currently collapsed.
Parameter Node
the XTreeNode specifying the node to check
Returns
true if Node or at least one of its parent nodes are collapsed, false if Node and all of its parent nodes are expanded
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
makeNodeVisible
void
makeNodeVisible( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException,
ExpandVetoException );

Description
Ensures that Node is currently visible.

This includes expanding all parent nodes and scroll the control so this node is visible in the controls display area.

Parameter Node
the XTreeNode specifying the node to make visible.
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
Throws
ExpandVetoException if Nodecan't be made visible since at least one of the parent nodes are collapsed and expanding failed because at least one of the registered XTreeExpansionListener raised a ExpandVetoException.
isNodeVisible
boolean
isNodeVisible( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Returns true if Node is currently visible.

Visible means it is either the root or all of its parents are expanded.

Returns
true if Node is visible, otherwise false
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
expandNode
void
expandNode( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException,
ExpandVetoException );

Description
Ensures that Node is expanded and visible.

If Node is a leaf node, this will have no effect.

Parameter Node
the XTreeNode identifying a node.
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
Throws
ExpandVetoException if expanding Node failed because at least one of the registered XTreeExpansionListener raised a ExpandVetoException.
collapseNode
void
collapseNode( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException,
ExpandVetoException );

Description
Ensures that Node is collapsed.
Parameter Node
the XTreeNode identifying a node
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
Throws
ExpandVetoException if collapsing Node failed because at least one of the registered XTreeExpansionListener raised a ExpandVetoException.
addTreeExpansionListener
void
addTreeExpansionListener( [in] XTreeExpansionListener  Listener );

Description
Adds a listener for ::TreeExpansion events.
Parameter Listener
a XTreeExpansionListener that will be notified when a tree node is expanded or collapsed.
removeTreeExpansionListener
void
removeTreeExpansionListener( [in] XTreeExpansionListener  Listener );

Description
Removes a listener for ::TreeExpansion events.
Parameter Listener
the XTreeExpansionListener to remove.
getNodeForLocation
XTreeNode
getNodeForLocation( [in] long  x,
[in] long  y );

Description
Returns the node at the specified location.
Parameter x
an integer giving the number of pixels horizontally from the left edge of the controls display area
Parameter y
an integer giving the number of pixels vertically from the top edge of the controls display area
Returns
the XTreeNode for the node at that location, or 0 if there is no node at the given position
getClosestNodeForLocation
XTreeNode
getClosestNodeForLocation( [in] long  x,
[in] long  y );

Description
Returns the node that is closest to x,y.

If no nodes are currently viewable, or there is no model, returns null, otherwise it always returns a valid node. To test if the node is exactly at x, y, use getNodeForLocation().

Parameter x
an integer giving the number of pixels horizontally from the left edge of the controls display area @para y an integer giving the number of pixels vertically from the top edge of the controls display area
Returns
the XTreeNode for the node closest to that location, null if nothing is viewable or there is no model
getNodeRect
::com::sun::star::awt::Rectangle
getNodeRect( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
returns the rectangle occupied by the visual representation of the given node
Parameter Node
the node whose geometry should be obtained
Throws
::com::sun::star::lang::IllegalArgumentException if the given node is NULL, or does not belong to the tree's data model
isEditing
boolean
isEditing();

Description
Returns true if one of tree's nodes is being currently edited.

The node that is being edited can be obtained using XSelectionSupplier::getSelection().

Returns
true if the user is currently editing a node
stopEditing
boolean
stopEditing();

Description
Ends the current editing session.

All registered XTreeEditListener are notified if an editing session was in progress

Has no effect if the tree isn't being edited.

Returns
true if editing was in progress and is now stopped, false if editing was not in progress
cancelEditing
void
cancelEditing();

Description
Cancels the current editing session.

Has no effect if the tree isn't being edited.

startEditingAtNode
void
startEditingAtNode( [in] XTreeNode  Node )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
Selects Node and initiates editing.

If TreeControlModel::Editable is false or if there are no registered XTreeEditListener, this call has no effect.

Calling this method also ensures that Node will become visible.

Parameter Node
the XTreeNode identifying a node.
Throws
::com::sun::star::lang::IllegalArgumentException if Node is not a valid node of the corresponding XTreeDataModel.
addTreeEditListener
void
addTreeEditListener( [in] XTreeEditListener  Listener );

Description
Adds a XTreeEditListener.
Parameter xListener
a XTreeEditListener that will be notified before and after a tree node is edited.
removeTreeEditListener
void
removeTreeEditListener( [in] XTreeEditListener  Listener );

Description
Removes a XTreeEditListener.
Parameter xListener
the XTreeEditListener to remove
Attributes' Details
DefaultExpandedGraphicURL
string DefaultExpandedGraphicURL;
Description
If the given URL points to a loadable graphic, the graphic is rendered before expanded non leaf nodes.

This can be overriden for individual nodes by XTreeNode::getExpandedGraphicURL()

DefaultCollapsedGraphicURL
string DefaultCollapsedGraphicURL;
Description
If the given URL points to a loadable graphic, the graphic is rendered before collapsed non leaf nodes.

This can be overriden for individual nodes by XTreeNode::getCollapsedGraphicURL()

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.