|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The NodeViewerFactory interface defines a factory that creates instances of NodeViewer for displaying the contents of Node objects. When a user opens a file - or something - in a Browser, a tab is displayed with the file (or object's) display name. Under that tab is another set of tabs (aligned along the bottom) which represent the NodeViewers that have been created by registered NodeViewerFactories that 'accept' the corresponding node.
For example, the TextNodeViewerFactory is a registered NodeViewerFactory that 'accepts' all nodes of type TextFileNode (and subclasses thereof). When a node is displayed in the Browser of the type TextFileNode, the TextNodeViewerFactory creates an instance of TextNodeViewer to display a 'Source' tab representation of the Node.
All registered NodeViewerFactories will be asked to create a NodeViewer when a new Node is displayed in the Browser. A NodeViewerFactory may decline to represent a specific node by returning 'null' from the createNodeViewer(...) method.
To register a NodeViewerFactory, call either of the following methods:
Browser.registerNodeViewerFactory(NodeViewerFactory factory)
Browser.registerNodeViewerFactory(NodeViewerFactory factory,
boolean asFirst)
Browser
,
Context
,
com.borland.primetime.ide.MainContentView
,
ContentView
,
StructureView
Method Summary | |
boolean |
canDisplayNode(Node node)
If the NodeViewerFactory is registered with the Browser, this method is called before a new Node is displayed in the Browser window. |
NodeViewer |
createNodeViewer(Context context)
If the NodeViewerFactory is registered with the Browser, this method is called each time a new Node is displayed in the Browser window. |
Method Detail |
public boolean canDisplayNode(Node node)
This method is used for enabling / disabling context menus, so it should execute fairly quickly.
node
- The Node that is about to be displayed in a Browser windowpublic NodeViewer createNodeViewer(Context context)
context
- The Browser / Node pair that is about to be displayed in a
Browser window
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |