| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| = DevFaqExplorerViews |
| :jbake-type: wiki |
| :jbake-tags: wiki, devfaq, needsreview |
| :jbake-status: published |
| :keywords: Apache NetBeans wiki DevFaqExplorerViews |
| :description: Apache NetBeans wiki DevFaqExplorerViews |
| :toc: left |
| :toc-title: |
| :syntax: true |
| |
| === What is an Explorer view? |
| |
| An explorer view is a GUI component which can display a link:DevFaqWhatIsANode.asciidoc[Node ] and (optionally) its child nodes. While Nodes are, by definition, a tree structure, explorer views are much more than just JTrees. Here is a list of the components available: |
| |
| * BeanTreeView - the classic tree view, as seen in the Projects and Files tabs in the IDE |
| * ListView - a JList based node view component - you can see it in the right hand list in |
| * ChoiceView - a ComboBox based explorer view - older versions of the NetBeans IDE used this to display a list of methods in the editor toolbar |
| * ContextTreeView - like a BeanTreeView, but sets its manager's explorered context. The "master" part of a master-detail component that uses two views. |
| * MenuView - a JMenu view of a Node and its children |
| * TableView - an Explorer view displaying nodes in a table. |
| * TreeTableView - a TreeTable view of a Node and its children, in which the left column of the table is a tree of nodes, and the other columns display/edit a specified set of properties of those nodes |
| * OutlineView - replacement for TreeTableView |
| * IconView - a view similar to that of the left pane in Windows Explorer - a table of equidistant icons. Not currently used anywhere in the IDE's UI. |
| * PropertySheetView - doesn't show Nodes per-se at all, but rather, shows a property sheet for editing a Node's properties |
| |
| With the exception of PropertySheetView, all of these classes live in the package `org.openide.explorer.view` (sources in openide/explorer in link:DevFaqAccessSourcesUsingCvs.asciidoc[NetBeans' CVS]). |
| |
| An explorer view's content is controlled by its link:DevFaqExplorerManager.asciidoc[ExplorerManager] - you don't set the root node directly on the view component, you use its manager. This is so that more than one view can share a single manager, to do master-detail views (for example, the first page of the New Project wizard is one such view - the right hand panel displays children of the left hand panel's selection). |
| |
| There are a number of advantages to using Nodes and Explorer Views |
| |
| * it is possible to create a rich UI with very little UI code |
| * they integrate well with standard menu/toolbar actions that are sensitive to selection |
| * they contain convenient and well tested features (start randomly typing in a tree or list view - a little popup will appear and search for a matching node) |
| * there is a lot of logic built into NetBeans for creating Nodes simply and easily, for example, from link:http://www.netbeans.org/download/dev/javadoc/org-openide-nodes/org/openide/nodes/BeanNode.html[any POJO JavaBean] and persisting the things they represent, so you can do a lot with very little code by using Nodes and Explorer Views |
| |
| A common usage is to get a Node for some folder on disk or in the link:DevFaqSystemFilesystem.asciidoc[configuration filesystem], optionally create a `FilterNode` to filter out some child nodes of it or its children, and display that. |
| |
| === Apache Migration Information |
| |
| The content in this page was kindly donated by Oracle Corp. to the |
| Apache Software Foundation. |
| |
| This page was exported from link:http://wiki.netbeans.org/DevFaqExplorerViews[http://wiki.netbeans.org/DevFaqExplorerViews] , |
| that was last modified by NetBeans user LiborJelinek |
| on 2011-08-09T16:07:51Z. |
| |
| |
| *NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed. |