@Override public int getPreferredHeight () { return view.getOutline().getPreferredSize().height; }
private void showPopup(Point p) { JPopupMenu menu = getPopup(); if (menu != null) { menu.show(view.getOutline(), p.x, p.y); } }
@Override public void run() { // invoke later so the selection on the table will be set first JPopupMenu menu = getPopup(); if (menu != null) { menu.show(view.getOutline(), e.getX(), e.getY()); } } });
final public void actionPerformed(ActionEvent e) { if (LOGABLE) { log("should expand " + path); // NOI18N } view.getOutline().expandPath(path); } }
@Override public void actionPerformed(ActionEvent e) { showPopup(org.netbeans.modules.versioning.util.Utils.getPositionForPopup(view.getOutline())); } });
@Override public void run() { int width = view.getWidth(); view.getOutline().getColumnModel().getColumn(0).setPreferredWidth(width * 40 / 100); view.getOutline().getColumnModel().getColumn(1).setPreferredWidth(width * 20 / 100); view.getOutline().getColumnModel().getColumn(2).setPreferredWidth(width * 40 / 100); } });
/** Get a node on given point or null if there none*/ private Node getNodeForDrop(Point p) { int row = view.getOutline().rowAtPoint(p); return view.getNodeFromRow(row); }
/** Collapses the tree under given node. * * @param n node to collapse */ public void collapseNode(Node n) { if (n == null) { throw new IllegalArgumentException(); } TreePath treePath = new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, n))); getOutline().collapsePath(treePath); }
/** Enables/disables dragging support. * @param state true enables dragging support, false disables it. */ public void setDragSource(boolean state) { // create drag support if needed if (state && (dragSupport == null)) { dragSupport = new OutlineViewDragSupport(this, getOutline()); } // activate / deactivate support according to the state dragActive = state; if (dragSupport != null) { dragSupport.activate(dragActive); } }
@Override public int getPreferredHeaderHeight () { return view.getOutline().getTableHeader().getPreferredSize().height; }
@Override public T getNodeAtPosition (int position) { for (int i = 0; i < view.getOutline().getRowCount(); ++i) { Node n = getNodeAt(view.getOutline().convertRowIndexToModel(i)); T converted = convertNode(n); if (converted != null) { if (position-- == 0) { return converted; } } } return null; }
/** Test whether a node is expanded in the tree or not * @param n the node to test * @return true if the node is expanded */ public boolean isExpanded(Node n) { TreePath treePath = new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, n))); return getOutline().isExpanded(treePath); }
/** Expands the node in the tree. * * @param n node */ public void expandNode(Node n) { if (n == null) { throw new IllegalArgumentException(); } lookupExplorerManager(); TreePath treePath = new TreePath(treeModel.getPathToRoot(VisualizerNode.getVisualizer(null, n))); getOutline().expandPath(treePath); }
public ToolTipView() { final OutlineView ov = new OutlineView(); ov.setPropertyColumns("value", "Value"); //NOI18N ov.getOutline().getColumnModel().getColumn(0).setHeaderValue("Name"); //NOI18N ov.getOutline().setRootVisible(true); ov.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(getForeground()), BorderFactory.createEmptyBorder(0, 0, 0, 0))); setLayout(new BorderLayout()); add(ov, BorderLayout.CENTER); }
@SuppressWarnings("unchecked") private void setupColumns() { view.setPropertyColumns(DiffNode.COLUMN_NAME_STATUS, columnLabels.get(DiffNode.COLUMN_NAME_STATUS)[0], DiffNode.COLUMN_NAME_LOCATION, columnLabels.get(DiffNode.COLUMN_NAME_LOCATION)[0]); view.setPropertyColumnDescription(DiffNode.COLUMN_NAME_STATUS, columnLabels.get(DiffNode.COLUMN_NAME_STATUS)[1]); view.setPropertyColumnDescription(DiffNode.COLUMN_NAME_LOCATION, columnLabels.get(DiffNode.COLUMN_NAME_LOCATION)[1]); view.getAccessibleContext().setAccessibleName(NbBundle.getMessage(DiffFileTreeImpl.class, "ACSN_DiffTable")); // NOI18N view.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DiffFileTreeImpl.class, "ACSD_DiffTable")); // NOI18N view.getOutline().setRenderDataProvider(createRenderProvider()); }
public void addTreeExpansionListener( TreeExpansionListener l ) { TreePathSupport tps = getOutline().getOutlineModel().getTreePathSupport(); if( tps != null ) tps.addTreeExpansionListener(l); }
public void removeTreeExpansionListener( TreeExpansionListener l ) { TreePathSupport tps = getOutline().getOutlineModel().getTreePathSupport(); if( tps != null ) tps.removeTreeExpansionListener(l); }
private Node getNodeAt( int rowIndex ) { Node result = null; TreePath path = view.getOutline().getOutlineModel().getLayout().getPathForRow(rowIndex); if (path != null) { result = Visualizer.findNode(path.getLastPathComponent()); } return result; }
@Override public void addNotify() { super.addNotify(); if (outlineView == null) { outlineView = new OutlineView(Bundle.CTL_FoundModes()); outlineView.getOutline().setRootVisible(false); tree.add(outlineView); outlineView.setDefaultActionAllowed(false); outlineView.setVisible(false); tree.setMinimumSize(outlineView.getPreferredSize()); } }
public void jbuttonActionPerformance(ActionEvent ev){ TopComponent findTopComponent = WindowManager.getDefault().findTopComponent("OutlineTopComponent"); // TODO add your handling code here: findTopComponent.setVisible(false); findTopComponent.removeAll(); findTopComponent.setLayout(new BorderLayout()); OutlineView myView2 = new OutlineView("Filename"); Outline outline2 = myView2.getOutline(); findTopComponent.add(myView2, BorderLayout.CENTER); findTopComponent.setVisible(true); findTopComponent.open();findTopComponent.requestActive(); }