| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_181) on Fri Sep 14 11:37:56 BST 2018 --> |
| <title>Overview (Navigator API)</title> |
| <meta name="date" content="2018-09-14"> |
| <link rel="stylesheet" type="text/css" href="javadoc.css" title="Style"> |
| <script type="text/javascript" src="script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Overview (Navigator API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li class="navBarCell1Rev">Overview</li> |
| <li><a href="org/netbeans/spi/navigator/package-summary.html">Package</a></li> |
| <li>Class</li> |
| <li>Use</li> |
| <li><a href="org/netbeans/spi/navigator/package-tree.html">Tree</a></li> |
| <li><a href="deprecated-list.html">Deprecated</a></li> |
| <li><a href="index-files/index-1.html">Index</a></li> |
| <li><a href="help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage">org.netbeans.spi.navigator/1 1.39.1 </div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev</li> |
| <li>Next</li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> |
| <li><a href="overview-summary.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <div class="header"> |
| <h1 class="title">Navigator API<br/><span style='font-style:normal; font-size:medium; font-weight:normal; background-color:#ffffff;'><a href='http://wiki.netbeans.org/API_Stability#Stable' target='_blank'>Stable</a></span></h1> |
| </div> |
| <div class="header"> |
| <p>See: <a href="#overview.description">Description</a></p> |
| </div> |
| <div class="contentContainer"> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Navigator API table, listing packages, and an explanation"> |
| <caption><span>Navigator API</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Package</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tbody> |
| <tr class="altColor"> |
| <td class="colFirst"><a href="org/netbeans/spi/navigator/package-summary.html">org.netbeans.spi.navigator</a></td> |
| <td class="colLast"> </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="contentContainer"><a name="overview.description"> |
| <!-- --> |
| </a> |
| <div class="block"><p> |
| |
| <p> |
| Navigator API is good for clients (module writers) that want to show some |
| structure or outline of their document in dedicated window, allowing end user |
| fast navigation and control over the document.</p> |
| |
| <p> |
| API allows its clients to plug in their Swing based views easily, which |
| then will be automatically shown in specialized Navigator UI.</p> |
| |
| org.netbeans.spi.navigator.NavigatorPanel |
| org.netbeans.spi.navigator.NavigatorHandler |
| |
| </p> |
| <h3>What is New (see <a href="apichanges.html">all changes</a>)?</h3> |
| <ul> |
| |
| |
| <!--Search for dates that are later or equal to 1997-09-01 in |
| .--> |
| <!--Checking date 2012-8-20 with count of newer 0--><!--year ok--> |
| <li>Aug 20 '12 <a href="apichanges.html#NavigatorPanelWithToolbar">Added SPI interface <code>NavigatorPanelWithToolbar</code></a> |
| <p> |
| |
| <p> |
| Added SPI interface <code>NavigatorPanelWithToolbar</code>. Clients will implement this interface when they need a toolbar for their Navigator view/panel. |
| </p> |
| |
| </p> |
| </li> |
| <!--Checking date 2012-1-12 with count of newer 1--><!--year ok--> |
| <li>Jan 12 '12 <a href="apichanges.html#NavigatorPanel.Registration">Added <code>@NavigatorPanel.Registration</code></a> |
| <p> |
| |
| <p> |
| Added <code>@NavigatorPanel.Registration</code> for ease of use and lazy loading. |
| </p> |
| |
| </p> |
| </li> |
| <!--Checking date 2011-8-31 with count of newer 2--><!--year ok--> |
| <li>Aug 31 '11 <a href="apichanges.html#NavigatorDisplayer">Added SPI interface NavigatorDisplayer</a> |
| <p> |
| Added <code>NavigatorDisplayer</code> |
| which can be implemented to provide a different visualization of the navigator panels |
| than in the default Navigator window. Can be useful in a different app than NetBeans IDE. |
| Added <code>NavigatorHandler.activateNavigator</code>. |
| </p> |
| </li> |
| <!--Checking date 2007-4-16 with count of newer 3--><!--year ok--> |
| <li>Apr 16 '07 <a href="apichanges.html#panelsPolicy">Added SPI interface NavigatorLookupPanelsPolicy.</a> |
| <p> |
| |
| <a href="org/netbeans/spi/navigator/NavigatorLookupPanelsPolicy.html" shape="rect">NavigatorLookupPanelsPolicy</a> |
| is new SPI interface for SPI clients |
| who want to affect searching mechanism for available NavigatorPanel |
| implementations. Method NavigatorLookupPanelsPolicy.getPanelsPolicy() |
| allows for example to remove active Node/DataObject related NavigatorPanel |
| implementations from Navigator window.<p></p> |
| |
| </p> |
| </li> |
| <!--Checking date 2007-4-10 with count of newer 4--><!--year ok--> |
| <li>Apr 10 '07 <a href="apichanges.html#undoRedo">Added SPI interface NavigatorPanelWithUndo.</a> |
| <p> |
| |
| <a href="org/netbeans/spi/navigator/NavigatorPanelWithUndo.html" shape="rect">NavigatorPanelWithUndo</a> |
| is new SPI interface which extands NavigatorPanel |
| by support for undoing and redoing changes in navigation views. |
| Method NavigatorPanelWithUndo.getUndoRedo() allows clients |
| to specify UndoRedo support that will be propagated to the |
| Navigator TopComponent when this panel is active in navigation area. |
| </p> |
| </li> |
| <!--Checking date 2006-9-19 with count of newer 5--><!--Skipped as the amount of changes is too big--> |
| <!--Checking date 2005-8-8 with count of newer 6--><!--Skipped as the amount of changes is too big--> |
| </ul> |
| <h3>Use Cases</h3> |
| <answer id="arch-usecases"> |
| |
| |
| <h5>Basic Usage Steps</h5> |
| In order to plug in a view into Navigator UI for certain document (data) type, |
| module writers need to write a <a href="org/netbeans/spi/navigator/NavigatorPanel.html" shape="rect">NavigatorPanel</a> |
| implementation marked with <code>@Registration</code>. |
| |
| <h4>Writing NavigatorPanel implementation</h4> |
| |
| <p>Implementing <a href="org/netbeans/spi/navigator/NavigatorPanel.html" shape="rect">NavigatorPanel</a> |
| interface is easy, you can copy from template basic implementation |
| <a href="org/netbeans/spi/navigator/doc-files/BasicNavPanelImpl_java" shape="rect">BasicNavPanelImpl.java</a>.</p> |
| |
| Advices on important part of panel implementation: |
| |
| <ul> |
| |
| <li> |
| <b>Instantiation:</b> Your implementation of NavigatorPanel |
| is instantied automatically by the system if you register it using <code>@Registration</code>.</li> |
| |
| |
| <li> |
| <b>getComponent</b> method: Simply create and return your UI |
| representation of your data in Swing's JComponent envelope. Just be sure |
| that you don't create new JComponent subclass per every call, as |
| performance will suffer then.<p></p> |
| </li> |
| |
| |
| <li> |
| <b>panelActivated and panelDeactivated</b> methods wraps an |
| 'active' life of your panel implementation. In panelActivated, grab |
| your data from given <a href="../org-openide-util-lookup/org/openide/util/Lookup.html" shape="rect">Lookup</a>, |
| usually by looking up its asociated |
| <a href="../org-openide-loaders/org/openide/loaders/DataObject.html" shape="rect">DataObject</a> |
| or |
| <a href="../org-openide-filesystems/org/openide/filesystems/FileObject.html" shape="rect">FileObject</a> |
| to take data from. Also remember to attach listeners to lookup result, |
| perhaps also to data itself and trigger UI update with new data. |
| Code will typically look like this:<br> |
| |
| <pre xml:space="preserve"> |
| /** JavaDataObject used as example, replace with your own data source */ |
| private static final Lookup.Template MY_DATA = new Lookup.Template(JavaDataObject.class); |
| |
| public void panelActivated (Lookup context) { |
| // lookup context and listen to result to get notified about context changes |
| curResult = context.lookup(MY_DATA); |
| curResult.addLookupListener(/** your LookupListener impl here*/); |
| Collection data = curResult.allInstances(); |
| // ... compute view from data and trigger repaint |
| } |
| </pre> |
| Do *not* perform any long computation in panelActivated directly, see below.<br> |
| In panelDeactivated, be sure to remove all listeners to context given |
| to you in panelActivated.<p></p> |
| </li> |
| |
| |
| <li> |
| <b>Long computation of content:</b> What if rendering your |
| Navigator view takes long time, more than several milliseconds? |
| Right approach is to create and run new task using |
| <a href="../org-openide-util/org/openide/util/RequestProcessor.html" shape="rect">RequestProcessor techniques</a>, |
| each time when panelActivated call arrived or your listeners on |
| data context got called.<br> |
| While computing, UI of Navigator view |
| should show some please wait message.<p></p> |
| </li> |
| |
| </ul> |
| |
| |
| <h4>Registering NavigatorPanel impl</h4> |
| |
| <p>Declarative registration of your NavigatorPanel impl connects this |
| implementation with specific content type, which is type of |
| the document, expressed in mime-type syntax, for example 'text/x-java' |
| for java sources. Infrastructure will automatically load and show |
| your NavigatorPanel impl in UI, when <b>currently activated Node |
| is backed by primary FileObject whose |
| <a href="../org-openide-filesystems/org/openide/filesystems/FileObject.html#getMIMEType--" shape="rect">FileObject.getMimeType()</a> |
| equals to content type specified in your registering annotation</b> (see more options below).</p> |
| |
| |
| |
| <h5>Advanced Content Registration - Linking to Node's Lookup</h5> |
| |
| <p>There may be situations where linking between your Navigator view and |
| activated Node's primary FileObject is not enough or not possible at all. |
| This simply happens when the data you want to represent in Navigator are |
| not accessible through primary FileObject or DataObject. Usual example is |
| Multiview environment, where more views of one document exists.</p> |
| |
| |
| <p>The solution is to bind content of your Navigator view directly to your |
| TopComponent. Then, whenever your TopComponent gets activated in the system, Navigator UI |
| will show th content you connected to it.</p> |
| |
| |
| <b>Steps to do:</b> |
| |
| |
| <ul> |
| |
| <li>Choose your content type, could be either well known or arbitrary, |
| say <b>'text/my-amazing-type'</b> and |
| do all basic steps described in above use case.<p></p> |
| </li> |
| |
| |
| <li>Implement <a href="org/netbeans/spi/navigator/NavigatorLookupHint.html" shape="rect">NavigatorLookupHint</a> |
| interface like this: |
| <pre xml:space="preserve"> |
| class AmazingTypeLookupHint implements NavigatorLookupHint { |
| public String getContentType () { |
| return "text/my-amazing-type"; |
| } |
| } |
| </pre> |
| |
| <p></p> |
| </li> |
| |
| |
| <li>Alter your <a href="../org-openide-windows/org/openide/windows/TopComponent.html" shape="rect">TopComponent</a> |
| to contain your NavigatorLookupHint implementation (AmazingTypeLookupHint in this case) |
| in its lookup, returned from |
| <a href="../org-openide-windows/org/openide/windows/TopComponent.html#getLookup--" shape="rect">TopComponent.getLookup()</a> |
| method.<p></p> |
| </li> |
| |
| |
| <li> |
| Another option you have is to alter lookup of your <code>Node</code> subclass |
| instead of directly altering lookup of your <code>TopComponent</code>. |
| See <a href="../org-openide-nodes/org/openide/nodes/Node.html#getLookup--" shape="rect">Node.getLookup()</a> method. |
| Then Navigator will show your desired content whenever your <code>Node</code> |
| subclass will be active in the system.<br> |
| However, keep in mind that this option is less preferred, because it |
| only uses implementation detail knowledge that default implementation |
| of <code>TopComponent.getLookup()</code> includes also results from |
| lookup of asociated <code>Node</code>. So this approach will stop |
| working if you change default behaviour of <code>TopComponent.getLookup()</code> method. |
| <p></p> |
| |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| |
| <h5>Programmatic activation of NavigatorPanel</h5> |
| |
| <p>Programmatic activation of specific navigator panel activates and shows |
| navigator panel in navigation area, as if user had selected the panel |
| manually. API clients are expected to use programmatic activation to |
| activate/select preferred panel from a set of available panels.</p> |
| |
| <b>Example:</b> |
| Several <code>TopComponents</code> in multiview arrangement, |
| <code>TopComponentA</code> and <code>TopComponentB</code>. |
| Both components provide the same |
| <code>NavigatorLookupHint</code> impl, which is recognized by two |
| providers <code>NavigatorPanelA</code> and <code>NavigatorPanelB</code>. |
| Now when <code>TopComponentA</code> becomes activated (has a focus), |
| it's desirable to select/show <code>NavigatorPanelA</code> from |
| navigator panels. On the other side, when <code>TopComponentB</code> |
| is activated, <code>NavigatorPanelB</code> should be activated automatically. |
| <p></p> |
| |
| |
| <b>Steps to do to activate panel programmatically:</b> |
| |
| |
| <ul> |
| |
| <li>Get the instance of <code>NavigatorPanel</code> implementation that |
| you want to activate/show in navigator area.<br> |
| See <a href="../org-openide-util/org/openide/util/doc-files/api.html#instances" shape="rect">Instantiation rules</a>.<p></p> |
| |
| </li> |
| |
| |
| <li>Call <a href="org/netbeans/spi/navigator/NavigatorHandler.html#activatePanel-org.netbeans.spi.navigator.NavigatorPanel-" shape="rect"> |
| NavigatorHandler.activatePanel(NavigatorPanel panel)</a> |
| <p></p>. |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| <h5>Setting activated node of Navigator window</h5> |
| |
| <p>Sometimes clients need to alter activated Nodes of Navigator window, |
| to better represent Navigator area content within the whole application. |
| See <a href="../org-openide-windows/org/openide/windows/TopComponent.html#getActivatedNodes--" shape="rect">TopComponent.getActivatedNodes()</a> |
| and <a href="../org-openide-windows/org/openide/windows/TopComponent.Registry.html#getActivatedNodes--" shape="rect">TopComponent.Registry.html#getActivatedNodes()</a> |
| to find out what activated nodes of TopComponent and whole system mean. |
| </p> |
| |
| <b>Use Case Example:</b> |
| NavigatorPanel implementation shows list or tree of some <code>Node</code>s |
| in Navigator area. When user selects a Node in the list or tree, |
| it is desirable to show selected Node's properties in Properties |
| window and enable proper actions in main menu. Exactly this can be done |
| by presenting Node selected in the list/tree as activated Node of |
| Navigator window. |
| <p></p> |
| |
| |
| <b>Steps to specify activated Nodes of Navigator window:</b> |
| |
| |
| <ul> |
| |
| <li>In your implementation of <code>NavigatorPanel</code>, implement |
| method <code>getLookup()</code> to return Lookup instance filled |
| with Node(s) that you want to set as activated Nodes of Navigator window. |
| <p></p> |
| |
| </li> |
| |
| |
| <li>Be sure to update Lookup content properly, for example using |
| <a href="../org-openide-util-lookup/org/openide/util/lookup/InstanceContent.html" shape="rect">InstanceContent</a> as follows: |
| <pre xml:space="preserve"> |
| class MyNavigatorPanel implements NavigatorPanel { |
| |
| /** Dynamic Lookup content */ |
| private final InstanceContent ic; |
| /** Lookup instance */ |
| private final Lookup lookup; |
| |
| public MyNavigatorPanel () { |
| this.ic = new InstanceContent(); |
| this.lookup = new AbstractLookup(ic); |
| } |
| |
| public Lookup getLookup () { |
| return lookup; |
| } |
| |
| /** Call this method when activated Nodes change is needed, |
| * for example when selection changes in your NavigatorPanel's Component |
| */ |
| private void selectionChanged (Node oldSel, Node newSel) { |
| ic.remove(oldSel); |
| ic.add(newSel); |
| } |
| |
| ... impl of rest of your NavigatorPanel |
| |
| } |
| </pre> |
| |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| <h5>Adding UndoRedo support to the navigation view</h5> |
| |
| <p>Some complex navigation views need support for undoing and redoing |
| edit changes done either directly in the view or in document which |
| the view is representing. |
| </p> |
| |
| |
| <b>Steps to support undo and redo in navigation view:</b> |
| |
| |
| <ul> |
| |
| <li>Implement your navigation view as <a href="org/netbeans/spi/navigator/NavigatorPanelWithUndo.html" shape="rect">NavigatorPanelWithUndo</a>, |
| which is <code>NavigatorPanel</code> interface with extra method |
| <a href="org/netbeans/spi/navigator/NavigatorPanelWithUndo.html#getUndoRedo--" shape="rect">getUndoRedo()</a>. |
| <p></p> |
| |
| </li> |
| |
| |
| <li>All other things remain the same as with basic <code>NavigatorPanel</code> usage. |
| <code>UndoRedo</code> support returned from <code>NavigatorPanelWithUndo.getUndoRedo()</code> |
| is propagated to the Navigator TopComponent and returned as its |
| <code>UndoRedo</code> support. For details see |
| <a href="../org-openide-windows/org/openide/windows/TopComponent.html#getUndoRedo--" shape="rect">TopComponent.getUndoRedo()</a> |
| and <a href="../org-openide-awt/org/openide/awt/UndoRedo.html" shape="rect">UndoRedo interface</a>. |
| <p></p> |
| |
| </li> |
| |
| |
| <li>Example of <code>NavigatorPanelWithUndo</code> implementation: |
| <pre xml:space="preserve"> |
| class MyNavigatorPanelWithUndo implements NavigatorPanelWithUndo { |
| |
| /** UndoRedo support, substitute with your impl */ |
| private final UndoRedo undo = new UndoRedo.Manager(); |
| |
| public UndoRedo getUndoRedo () { |
| return undo; |
| } |
| |
| ... rest of the NavigatorPanelWithUndo impl ... |
| |
| } |
| </pre> |
| |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| <h5>Removing active Node/DataObject related NavigatorPanels from Navigator window</h5> |
| |
| <p>In certain situations it's not desired to show NavigatorPanel implementations |
| related to DataObject of active Node in Navigator window. Typically |
| you need to have active Node of some type, so that actions in the system |
| works properly. But you don't want to show NavigatorPanels that "come" |
| with such active Node. |
| </p> |
| |
| |
| <b>Steps to remove such NavigatorPanels:</b> |
| |
| |
| <ul> |
| |
| <li>Implement interface <a href="org/netbeans/spi/navigator/NavigatorLookupPanelsPolicy.html" shape="rect">NavigatorLookupPanelsPolicy</a>, |
| return kind of policy that suits you from <code>getPanelsPolicy()</code> method. |
| <p></p> |
| |
| </li> |
| |
| <li>Put implementation instance into your TopComponent's subclass lookup, |
| see <a href="../org-openide-windows/org/openide/windows/TopComponent.html#getLookup--" shape="rect">TopComponent.getLookup()</a> |
| for details. |
| <p></p> |
| |
| </li> |
| |
| <li>Now when your TopComponent becomes active in the system, found |
| panels policy is used to limit/affect set of available |
| <a href="org/netbeans/spi/navigator/NavigatorPanel.html" shape="rect">NavigatorPanel</a> |
| implementations. |
| <p></p> |
| |
| </li> |
| |
| </ul> |
| |
| |
| |
| |
| <h5>Integration of Explorer view into Navigator</h5> |
| |
| <p>Explorer views comes handy when showing Nodes in varienty of situations |
| and it is just natural to be able to integrate them into Navigator window. |
| Working with explorer views is described at |
| <a href="../org-openide-explorer/org/openide/explorer/ExplorerUtils.html" shape="rect">ExplorerUtils javadoc</a>. |
| Integration with Navigator is easy and there are only subtle differencies |
| from integration into TopComponent. |
| </p> |
| |
| |
| <b>Steps to integrate some kind of Explorer View into Navigator:</b> |
| |
| |
| <ul> |
| |
| <li>Implement <code>NavigatorPanel</code> interface and return created explorer |
| view from <code>getComponent()</code> method. Creating explorer view |
| is described in <a href="../org-openide-explorer/org/openide/explorer/ExplorerUtils.html" shape="rect">ExplorerUtils</a>. |
| <p></p> |
| |
| </li> |
| |
| |
| <li>Return lookup created using |
| <a href="../org-openide-explorer/org/openide/explorer/ExplorerUtils.html#createLookup-org.openide.explorer.ExplorerManager-javax.swing.ActionMap-" shape="rect"> |
| ExplorerUtils.createLookup(ExplorerManager, ActionMap)</a> |
| from <code>getLookup()</code> method of <code>NavigatorPanel</code>. |
| <p></p> |
| |
| </li> |
| |
| |
| <li>Use <a href="../org-openide-explorer/org/openide/explorer/ExplorerUtils.html#activateActions-org.openide.explorer.ExplorerManager-boolean-" shape="rect"> |
| ExplorerUtils.activateActions(ExplorerManager, boolean)</a> for actions activation and |
| deactivation in <code>panelActivated</code> and <code>panelDeactivated</code>. |
| <p></p> |
| |
| </li> |
| |
| |
| <li>Take inspiration from following example code which integrates |
| ListView with Navigator: |
| |
| <pre xml:space="preserve"> |
| public class ListViewNavigatorPanel extends JPanel implements NavigatorPanel, ExplorerManager.Provider { |
| |
| private ExplorerManager manager; |
| private ListView listView; |
| private Lookup lookup; |
| private Action copyAction; |
| |
| public ListViewNavigatorPanel () { |
| manager = new ExplorerManager(); |
| ActionMap map = getActionMap(); |
| copyAction = ExplorerUtils.actionCopy(manager); |
| map.put(DefaultEditorKit.copyAction, copyAction); |
| map.put(DefaultEditorKit.cutAction, ExplorerUtils.actionCut(manager)); |
| map.put(DefaultEditorKit.pasteAction, ExplorerUtils.actionPaste(manager)); |
| map.put("delete", ExplorerUtils.actionDelete(manager, true)); // or false |
| |
| lookup = ExplorerUtils.createLookup(manager, map); |
| |
| listView = new ListView(); |
| fillListView(listView); |
| |
| add(listView); |
| } |
| |
| public String getDisplayName() { |
| return "List view panel"; |
| } |
| |
| public String getDisplayHint() { |
| return "List view based navigator panel"; |
| } |
| |
| public JComponent getComponent() { |
| return this; |
| } |
| |
| public void panelActivated(Lookup context) { |
| ExplorerUtils.activateActions(manager, true); |
| } |
| |
| public void panelDeactivated() { |
| ExplorerUtils.activateActions(manager, false); |
| } |
| |
| public Lookup getLookup() { |
| return lookup; |
| } |
| |
| public ExplorerManager getExplorerManager() { |
| return manager; |
| } |
| |
| private void fillListView(ListView listView) { |
| try { |
| Node testNode = new AbstractNode(Children.LEAF); |
| manager.setRootContext(testNode); |
| manager.setSelectedNodes(new Node[]{testNode}); |
| } catch (PropertyVetoException ex) { |
| Exceptions.printStackTrace(ex); |
| } |
| } |
| } |
| </pre> |
| |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| </answer> |
| <h3>Exported Interfaces</h3> |
| |
| This table lists all of the module exported APIs |
| with |
| defined stability classifications. It is generated |
| based on answers to questions about the architecture |
| of the module. <a href="architecture-summary.html">Read them all</a>... |
| |
| |
| <a name="group-java"> |
| <h5>Group of java interfaces</h5> |
| </a> |
| <table cellpadding="1" cellspacing="0" border="0" class="tablebg" width="100%"> |
| <tr> |
| <td> |
| <table border="0" cellpadding="3" cellspacing="1" width="100%"> |
| <tr class="tablersh"> |
| <td align="CENTER" width="25%"><span class="titlectable">Interface Name</span></td><td align="CENTER" width="10%"><span class="titlectable">In/Out</span></td><td align="CENTER" width="10%"><span class="titlectable">Stability</span></td><td align="CENTER"><span class="titlectable">Specified in What Document?</span></td> |
| </tr> |
| <tr class="tabler"> |
| <td>org.netbeans.spi.navigator.NavigatorPanel</td><td>Exported</td><td><a href="http://wiki.netbeans.org/API_Stability#Stable">Stable</a></td><td><a name="java-org.netbeans.spi.navigator.NavigatorPanel"></a></td> |
| </tr> |
| <tr class="tabler"> |
| <td>org.netbeans.spi.navigator.NavigatorHandler</td><td>Exported</td><td><a href="http://wiki.netbeans.org/API_Stability#Devel">Under Development</a></td><td><a name="java-org.netbeans.spi.navigator.NavigatorHandler"></a></td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| <p></p> |
| <a name="group-lookup"> |
| <h5>Group of lookup interfaces</h5> |
| </a> |
| <table cellpadding="1" cellspacing="0" border="0" class="tablebg" width="100%"> |
| <tr> |
| <td> |
| <table border="0" cellpadding="3" cellspacing="1" width="100%"> |
| <tr class="tablersh"> |
| <td align="CENTER" width="25%"><span class="titlectable">Interface Name</span></td><td align="CENTER" width="10%"><span class="titlectable">In/Out</span></td><td align="CENTER" width="10%"><span class="titlectable">Stability</span></td><td align="CENTER"><span class="titlectable">Specified in What Document?</span></td> |
| </tr> |
| <tr class="tabler"> |
| <td>activated_node</td><td>Exported</td><td><a href="http://wiki.netbeans.org/API_Stability#Devel">Under Development</a></td><td><a name="lookup-activated_node"> |
| <p></p> |
| |
| <p> |
| Navigator listen to system activated node changes and sets activated |
| node for Navigator top component accordingly. Local activated node is |
| set from system activated node if any provider agrees to display content |
| for data object behind the node. Navigator relies on default lookup |
| mechanism of TopComponent to populate its activated node. |
| Currently it means that if node backed by JavaDataObject is activated node |
| in the system, it is also activated node for Navigator's top component. |
| So main menu actions like Compile File, Move Class etc. work as usual |
| when Navigator window is active. |
| Also, lookup of currently selected Node is searched for NavigatorPanel |
| SPI instances. |
| </p> |
| |
| <p></p> |
| </a></td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| <p></p> |
| <h3>Implementation Details</h3> |
| <h5>Where are the sources for the module?</h5> |
| |
| <p> |
| <p> |
| The sources for the module are in the |
| <a href="http://hg.netbeans.org/" shape="rect">NetBeans Mercurial repositories</a>. |
| </p> |
| </p> |
| |
| <h5>What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?</h5> |
| |
| <p> |
| Nothing. |
| </p> |
| |
| <p> |
| Read more about the implementation in the <a href="architecture-summary.html">answers to |
| architecture questions</a>. |
| </p></div> |
| </div> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li class="navBarCell1Rev">Overview</li> |
| <li><a href="org/netbeans/spi/navigator/package-summary.html">Package</a></li> |
| <li>Class</li> |
| <li>Use</li> |
| <li><a href="org/netbeans/spi/navigator/package-tree.html">Tree</a></li> |
| <li><a href="deprecated-list.html">Deprecated</a></li> |
| <li><a href="index-files/index-1.html">Index</a></li> |
| <li><a href="help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage">org.netbeans.spi.navigator/1 1.39.1 </div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev</li> |
| <li>Next</li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> |
| <li><a href="overview-summary.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small><span class="footnote">Built on September 14 2018. | Copyright © 2017-2018 Apache Software Foundation. All Rights Reserved.</span></small></p> |
| </body> |
| </html> |