Examples of OutlineView


Examples of org.openide.explorer.view.OutlineView

    }

    private void initialize() {
        initComponents();

        OutlineView ov = ((OutlineView) this.tableScrollPanel);
        ov.setAllowedDragActions(DnDConstants.ACTION_NONE);
        ov.setAllowedDropActions(DnDConstants.ACTION_NONE);

        ov.getOutline().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

        // don't show the root node
        ov.getOutline().setRootVisible(false);
        ov.getOutline().setDragEnabled(false);
    }
View Full Code Here

Examples of org.openide.explorer.view.OutlineView

    @Override
    public void expandNode(Node n) {
        super.expandNode(n);

        if (this.tableScrollPanel != null) {
            OutlineView ov = ((OutlineView) this.tableScrollPanel);
            ov.expandNode(n);
        }
    }
View Full Code Here

Examples of org.openide.explorer.view.OutlineView

     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tableScrollPanel = new OutlineView(this.firstColumnLabel);

        //new TreeTableView()
        tableScrollPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                tableScrollPanelComponentResized(evt);
View Full Code Here

Examples of org.openide.explorer.view.OutlineView

                Node root = selectedNode;
                dummyNodeListener.reset();
                root.addNodeListener(dummyNodeListener);
                setupTable(root);
            } else {
                final OutlineView ov = ((OutlineView) this.tableScrollPanel);
                Node emptyNode = new AbstractNode(Children.LEAF);
                em.setRootContext(emptyNode); // make empty node
                ov.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
                ov.setPropertyColumns(); // set the empty property header
            }
        } finally {
            this.setCursor(null);
        }
    }
View Full Code Here

Examples of org.openide.explorer.view.OutlineView

        //}

        em.setRootContext(root);


        final OutlineView ov = ((OutlineView) DataResultViewerTable.this.tableScrollPanel);

        if (ov == null) {
            return;
        }

        propertiesAcc.clear();

        DataResultViewerTable.this.getAllChildPropertyHeadersRec(root, 100);
        List<Node.Property<?>> props = new ArrayList<>(propertiesAcc);
        if (props.size() > 0) {
            Node.Property<?> prop = props.remove(0);
            ((DefaultOutlineModel) ov.getOutline().getOutlineModel()).setNodesColumnLabel(prop.getDisplayName());
        }


        // *********** Make the TreeTableView to be sortable ***************

        //First property column is sortable, but also sorted initially, so
        //initially this one will have the arrow icon:
        if (props.size() > 0) {
            props.get(0).setValue("TreeColumnTTV", Boolean.TRUE); // Identifies special property representing first (tree) column. NON-NLS
            props.get(0).setValue("SortingColumnTTV", Boolean.TRUE); // TreeTableView should be initially sorted by this property column. NON-NLS
        }

        // The rest of the columns are sortable, but not initially sorted,
        // so initially will have no arrow icon:
        String[] propStrings = new String[props.size() * 2];
        for (int i = 0; i < props.size(); i++) {
            props.get(i).setValue("ComparableColumnTTV", Boolean.TRUE); //NON-NLS
            propStrings[2 * i] = props.get(i).getName();
            propStrings[2 * i + 1] = props.get(i).getDisplayName();
        }

        ov.setPropertyColumns(propStrings);
        // *****************************************************************

        //            // set the first entry
        //            Children test = root.getChildren();
        //            Node firstEntryNode = test.getNodeAt(0);
        //            try {
        //                this.getExplorerManager().setSelectedNodes(new Node[]{firstEntryNode});
        //            } catch (PropertyVetoException ex) {}


        // show the horizontal scroll panel and show all the content & header

        int totalColumns = props.size();

        //int scrollWidth = ttv.getWidth();
        int margin = 4;
        int startColumn = 1;

        // If there is only one column (which was removed from props above)
        // Just let the table resize itself.
        ov.getOutline().setAutoResizeMode((props.size() > 0) ? JTable.AUTO_RESIZE_OFF : JTable.AUTO_RESIZE_ALL_COLUMNS);



        // get first 100 rows values for the table
        Object[][] content = null;
        content = getRowValues(root, 100);


        if (content != null) {
            // get the fontmetrics
            final Graphics graphics = ov.getGraphics();
            if (graphics != null) {
                final FontMetrics metrics = graphics.getFontMetrics();

                // for the "Name" column
                int nodeColWidth = Math.min(getMaxColumnWidth(0, metrics, margin, 40, firstColumnLabel, content), 250); // Note: 40 is the width of the icon + node lines. Change this value if those values change!
                ov.getOutline().getColumnModel().getColumn(0).setPreferredWidth(nodeColWidth);

                // get the max for each other column
                for (int colIndex = startColumn; colIndex <= totalColumns; colIndex++) {
                    int colWidth = Math.min(getMaxColumnWidth(colIndex, metrics, margin, 8, props, content), 350);
                    ov.getOutline().getColumnModel().getColumn(colIndex).setPreferredWidth(colWidth);
                }
            }
        }

        // if there's no content just auto resize all columns
        if (!(content.length > 0)) {
            // turn on the auto resize
            ov.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.