Java Code Examples for org.openide.explorer.view.OutlineView#addTreeExpansionListener()

The following examples show how to use org.openide.explorer.view.OutlineView#addTreeExpansionListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResultsOutlineSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void createOutlineView() {
    outlineView = new OutlineView(UiUtils.getText(
            "BasicSearchResultsPanel.outline.nodes"));              //NOI18N
    outlineView.getOutline().setDefaultRenderer(Node.Property.class,
            new ResultsOutlineCellRenderer());
    setOutlineColumns();
    outlineView.getOutline().setAutoCreateColumnsFromModel(false);
    outlineView.addTreeExpansionListener(
            new ExpandingTreeExpansionListener());
    outlineView.getOutline().setRootVisible(false);
    outlineView.addHierarchyListener(new HierarchyListener() {
        @Override
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED)
                    != 0) {
                if (outlineView.isDisplayable()) {
                    outlineView.expandNode(resultsNode);
                }
            }
        }
    });
    outlineView.getOutline().getColumnModel().addColumnModelListener(
            new ColumnsListener());
    outlineView.getOutline().getInputMap().remove(
            KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); //#209949
    outlineView.getOutline().getInputMap().put(KeyStroke.getKeyStroke(
            KeyEvent.VK_DELETE,
            0), "hide"); //NOI18N
    outlineView.getOutline().getActionMap().put("hide", SystemAction.get( //NOI18N
            HideResultAction.class));
    outlineView.getOutline().setShowGrid(false);
    Font font = outlineView.getOutline().getFont();
    FontMetrics fm = outlineView.getOutline().getFontMetrics(font);
    outlineView.getOutline().setRowHeight(
            Math.max(16, fm.getHeight()) + VERTICAL_ROW_SPACE);
    outlineView.setTreeHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_POLICY);
    setTooltipHidingBehavior();
}
 
Example 2
Source File: TreeModelRoot.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private DefaultTreeFeatures (OutlineView view) {
    this.outline = view;
    view.addTreeExpansionListener(this);
}