nsITreeView
| IID: | 637276b5-58c0-4eff-89ea-c7f3c5bf0b54 |
| Inherits From: | nsISupports |
This interface is implemented by the following components:
- @mozilla.org/addressbook/abview;1
- @mozilla.org/filepicker/fileview;1
- @mozilla.org/inspector/dom-view;1
- @mozilla.org/messenger/msgdbview;1?type=quicksearch
- @mozilla.org/messenger/msgdbview;1?type=search
- @mozilla.org/messenger/msgdbview;1?type=threaded
- @mozilla.org/messenger/msgdbview;1?type=threadswithunread
- @mozilla.org/messenger/msgdbview;1?type=watchedthreadswithunread
- @mozilla.org/messenger/server;1?type=nntp
- @mozilla.org/xul/xul-tree-builder;1
- @mozilla.org/security/nsASN1Tree;1
- @mozilla.org/security/nsCertTree;1
- @mozilla.org/autocomplete/controller;1
Constants
Properties
readonly PRInt32 rowCount
The total number of rows in the tree (including the offscreen rows).
nsITreeSelection selection
The selection for this view.
Methods
PRBool canDrop ( PRInt32 index , PRInt32 orientation )
void cycleCell ( PRInt32 row , nsITreeColumn col )
void cycleHeader ( nsITreeColumn col )
void drop ( PRInt32 row , PRInt32 orientation )
void getCellProperties ( PRInt32 row , nsITreeColumn col , nsISupportsArray properties )
AString getCellText ( PRInt32 row , nsITreeColumn col )
AString getCellValue ( PRInt32 row , nsITreeColumn col )
void getColumnProperties ( nsITreeColumn col , nsISupportsArray properties )
AString getImageSrc ( PRInt32 row , nsITreeColumn col )
PRInt32 getLevel ( PRInt32 index )
PRInt32 getParentIndex ( PRInt32 rowIndex )
PRInt32 getProgressMode ( PRInt32 row , nsITreeColumn col )
void getRowProperties ( PRInt32 index , nsISupportsArray properties )
PRBool hasNextSibling ( PRInt32 rowIndex , PRInt32 afterIndex )
PRBool isContainer ( PRInt32 index )
PRBool isContainerEmpty ( PRInt32 index )
PRBool isContainerOpen ( PRInt32 index )
PRBool isEditable ( PRInt32 row , nsITreeColumn col )
PRBool isSelectable ( PRInt32 row , nsITreeColumn col )
PRBool isSeparator ( PRInt32 index )
PRBool isSorted ( )
void performAction ( PRUnichar* action )
void performActionOnCell ( PRUnichar* action , PRInt32 row , nsITreeColumn col )
void performActionOnRow ( PRUnichar* action , PRInt32 row )
void selectionChanged ( )
void setCellText ( PRInt32 row , nsITreeColumn col , AString value )
void setCellValue ( PRInt32 row , nsITreeColumn col , AString value )
void setTree ( nsITreeBoxObject tree )
void toggleOpenState ( PRInt32 index )
PRBool canDrop ( PRInt32 index , PRInt32 orientation )
Methods used by the drag feedback code to determine if a drag is allowable at the current location. To get the behavior where drops are only allowed on items, such as the mailNews folder pane, always return false when the orientation is not DROP_ON.
- Arguments:
- index
- orientation
void cycleCell ( PRInt32 row , nsITreeColumn col )
Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
- Arguments:
- row
- col
void drop ( PRInt32 row , PRInt32 orientation )
Called when the user drops something on this view. The orientation param specifies before/on/after the given row.
- Arguments:
- row
- orientation
void getCellProperties ( PRInt32 row , nsITreeColumn col , nsISupportsArray properties )
An atomized list of properties for a given cell. Each property, x, that the view gives back will cause the pseudoclass :moz-tree-cell-x to be matched on the ::moz-tree-cell pseudoelement.
- Arguments:
- row
- col
- properties
AString getCellText ( PRInt32 row , nsITreeColumn col )
The text for a given cell. If a column consists only of an image, then the empty string is returned.
- Arguments:
- row
- col
AString getCellValue ( PRInt32 row , nsITreeColumn col )
The value for a given cell. This method is only called for columns of type other than text.
- Arguments:
- row
- col
void getColumnProperties ( nsITreeColumn col , nsISupportsArray properties )
Called to get properties to paint a column background. For shading the sort column, etc.
- Arguments:
- col
- properties
AString getImageSrc ( PRInt32 row , nsITreeColumn col )
The image path for a given cell. For defining an icon for a cell. If the empty string is returned, the :moz-tree-image pseudoelement will be used.
- Arguments:
- row
- col
PRInt32 getLevel ( PRInt32 index )
The level is an integer value that represents the level of indentation. It is multiplied by the width specified in the :moz-tree-indentation pseudoelement to compute the exact indendation.
- Arguments:
- index
PRInt32 getParentIndex ( PRInt32 rowIndex )
Methods used by the tree to draw thread lines in the tree. getParentIndex is used to obtain the index of a parent row. If there is no parent row, getParentIndex returns -1.
- Arguments:
- rowIndex
PRInt32 getProgressMode ( PRInt32 row , nsITreeColumn col )
- Arguments:
- row
- col
void getRowProperties ( PRInt32 index , nsISupportsArray properties )
An atomized list of properties for a given row. Each property, x, that the view gives back will cause the pseudoclass :moz-tree-row-x to be matched on the pseudoelement ::moz-tree-row.
- Arguments:
- index
- properties
PRBool hasNextSibling ( PRInt32 rowIndex , PRInt32 afterIndex )
HasNextSibling is used to determine if the row at rowIndex has a nextSibling that occurs *after* the index specified by afterIndex. Code that is forced to march down the view looking at levels can optimize the march by starting at afterIndex+1.
- Arguments:
- rowIndex
- afterIndex
PRBool isContainer ( PRInt32 index )
Methods that can be used to test whether or not a twisty should be drawn, and if so, whether an open or closed twisty should be used.
- Arguments:
- index
PRBool isEditable ( PRInt32 row , nsITreeColumn col )
IsEditable is called to ask the view if the cell contents are editable. A value of true will result in the tree popping up a text field when the user tries to inline edit the cell.
- Arguments:
- row
- col
PRBool isSelectable ( PRInt32 row , nsITreeColumn col )
IsSelectable is called to ask the view if the cell is selectable. This method is only called if the selection style is cell or text. XXXvarga shouldn't this be called isCellSelectable?
- Arguments:
- row
- col
PRBool isSeparator ( PRInt32 index )
IsSeparator is used to determine if the row at index is a separator. A value of true will result in the tree drawing a horizontal separator. The tree uses the ::moz-tree-separator pseudoclass to draw the separator.
- Arguments:
- index
Specifies if there is currently a sort on any column. Used mostly by dragdrop to affect drop feedback.
void performAction ( PRUnichar* action )
A command API that can be used to invoke commands on the selection. The tree will automatically invoke this method when certain keys are pressed. For example, when the DEL key is pressed, performAction will be called with the "delete" string.
- Arguments:
- action
void performActionOnCell ( PRUnichar* action , PRInt32 row , nsITreeColumn col )
A command API that can be used to invoke commands on a specific cell.
- Arguments:
- action
- row
- col
void performActionOnRow ( PRUnichar* action , PRInt32 row )
A command API that can be used to invoke commands on a specific row.
- Arguments:
- action
- row
Should be called from a XUL onselect handler whenever the selection changes.
void setCellText ( PRInt32 row , nsITreeColumn col , AString value )
SetCellText is called when the contents of the cell have been edited by the user.
- Arguments:
- row
- col
- value
void setCellValue ( PRInt32 row , nsITreeColumn col , AString value )
SetCellValue is called when the value of the cell has been set by the user. This method is only called for columns of type other than text.
- Arguments:
- row
- col
- value
void setTree ( nsITreeBoxObject tree )
Called during initialization to link the view to the front end box object.
- Arguments:
- tree
void toggleOpenState ( PRInt32 index )
Called on the view when an item is opened or closed.
- Arguments:
- index
References
This interface is the type of the following properties:
nsIDOMXULTreeElement.view, nsITreeBoxObject.view
Reference documentation is generated from Mozilla's source.
