站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

PackageView (NetBeans Java Project API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.spi.java.project.support.ui
Class PackageView

java.lang.Object
  extended byorg.netbeans.spi.java.project.support.ui.PackageView

public class PackageView
extends Object

Factory for package views.

See Also:
LogicalViewProvider

Method Summary
static ComboBoxModel createListView(SourceGroup group)
          Create a list or combo box model suitable for JList from a source group showing all Java packages in the source group.
static Node createPackageView(SourceGroup group)
          Create a node which will contain package-oriented view of a source group.
static Node findPath(Node rootNode, Object object)
          Finds the node representing given object, if any.
static ListCellRenderer listRenderer()
          Create a renderer suited to rendering models created using createListView(org.netbeans.api.project.SourceGroup).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createPackageView

public static Node createPackageView(SourceGroup group)
Create a node which will contain package-oriented view of a source group.

The precise structure of this node is not specified by the API and is subject to arbitrary change (perhaps at user option). Callers should not make assumptions about the nature of subnodes, the code or display names of certain nodes, and so on. You may use cookies/lookup to find if particular subnodes correspond to folders or files.

Parameters:
group - a source group which should be represented
Returns:
node which will display packages in given group

findPath

public static Node findPath(Node rootNode,
                            Object object)
Finds the node representing given object, if any. The current implementation works only for FileObjects and DataObjects.

Parameters:
rootNode - a node some descendant of which should contain the object
object - object to find
Returns:
a node representing the given object, or null if no such node was found

createListView

public static ComboBoxModel createListView(SourceGroup group)
Create a list or combo box model suitable for JList from a source group showing all Java packages in the source group. To display it you will also need listRenderer().

No particular guarantees are made as to the nature of the model objects themselves, except that Object.toString() will give the fully-qualified package name (or "" for the default package), regardless of what the renderer actually displays.

Parameters:
group - a Java-like source group
Returns:
a model of its packages
Since:
org.netbeans.modules.java.project/1 1.3

listRenderer

public static ListCellRenderer listRenderer()
Create a renderer suited to rendering models created using createListView(org.netbeans.api.project.SourceGroup). The exact nature of the display is not specified. Instances of String can also be rendered.

Returns:
a suitable package renderer
Since:
org.netbeans.modules.java.project/1 1.3

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.