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.

Note: 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();
nsINavHistoryResultgetResult();
nsINavHistoryContainerResultNodegetResultNode();
nsINavHistoryResultNode[]getSelectionNodes();
void selectAll();

Attributes

AttributeTypeDescription
hasSelectionbooleanWhether or not there are selected items. Read only.
insertionPointInsertionPointThe InsertionPoint at which new items will be inserted upon drop, paste, or creation. Read only.
placestringTheURI (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.
selectedNodensINavHistoryResultNodeThe 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:68 次

字数:7642

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文