nsIPlacesView 编辑
The nsIPlacesView
interface provides a view-agnostic way to access information about a Places view.
For example, the representation of selection differs between trees, menus, and other such lists. Controllers should not be concerned with these details; controller code should not be required to decode the meaning of a selection depending on what kind of view produced the selection. Rather, each view is responsible for translating its own selection format into one the controller can understand. Views do this, and other things, by implementing the nsIPlacesView
interface.
nsIPlacesView
does not exist in IDL at the moment. It's currently implemented directly on each of the built-in Places views.Method overview
nsINavHistoryResultNode[] getDragableSelection (); |
nsINavHistoryResultNode[][ ] getRemovableSelectionRanges (); |
nsINavHistoryResult getResult (); |
nsINavHistoryContainerResultNode getResultNode (); |
nsINavHistoryResultNode[] getSelectionNodes (); |
void selectAll(); |
Attributes
Attribute | Type | Description |
hasSelection | boolean | Whether or not there are selected items. Read only. |
insertionPoint | InsertionPoint | The InsertionPoint at which new items will be inserted upon drop, paste, or creation. Read only. |
place | string | TheURI (as a string) of the root Place that the view displays. This may be modified dynamically to update the view. See Displaying Places information using views for examples. |
selectedNode | nsINavHistoryResultNode | The selected node in the view. If there are multiple selected nodes, this is null. Read only. |
Methods
getDragableSelection()
Returns an array of selected nsINavHistoryResultNode
objects that can be dragged from the view.
nsINavHistoryResultNode[] getDragableSelection();
Parameters
None.
Return value
An array of nsINavHistoryResultNode
objects.
getRemovableSelectionRanges()
Returns an array whose elements are themselves arrays of nsINavHistoryResultNode
objects that can be removed from the view. Each inner array represents a contiguous range of nodes that can be removed.
nsINavHistoryResultNode[][] getRemovableSelectionRanges();
Parameters
None.
Return value
An array of arrays of nsINavHistoryResultNode
objects.
getResult()
Returns the nsINavHistoryResult
object that the view displays.
nsINavHistoryResult getResult();
Parameters
None.
Return value
The nsINavHistoryResult
object that the view displays.
getResultNode()
Returns the root node, an nsINavHistoryContainerResultNode
object, of the view's result.
nsINavHistoryContainerResultNode getResultNode();
Paramters
None.
Return value
The root nsINavHistoryContainerResultNode
of the view's result.
getSelectionNodes()
Returns an array of all currently selected nsINavHistoryResultNode
objects of the view. The nodes are not necessarily returned in the same order in which they occur in the model, or in the same container, or from the same provider.
nsINavHistoryResultNode[] getSelectionNodes();
Parameters
None.
Return value
An array of nsINavHistoryResultNode
objects that are selected.
selectAll()
Selects all the nodes displayed in the view.
void selectAll();
Parameters
None.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论