/** * * @return whether any rows are selected in the profile. */ public boolean anyRowsSelected() { Outline outline = getResultsOutline(); return outline.getSelectedRows().length > 0; }
/** * * @return whether any rows are selected in the profile. */ public boolean anyRowsSelected() { Outline outline = getResultsOutline(); return outline.getSelectedRows().length > 0; }
public int [] getSelection() { return getOutline().getSelectedRows(); }
/** * * @return A list of the profile resource nodes selected in the outline. */ public List<ProfileResourceNode> getSelectedNodes() { List<ProfileResourceNode> results = new ArrayList<ProfileResourceNode>(); Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); ProfileResourceNode prn = (ProfileResourceNode) treeNode .getUserObject(); results.add(prn); } return results; }
/** * * @return A list of the profile resource nodes selected in the outline. */ public List<ProfileResourceNode> getSelectedNodes() { List<ProfileResourceNode> results = new ArrayList<ProfileResourceNode>(); Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); ProfileResourceNode prn = (ProfileResourceNode) treeNode .getUserObject(); results.add(prn); } return results; }
int[] selRows = view.getOutline().getSelectedRows(); ArrayList<Node> al = new ArrayList<Node> (selRows.length); for (int i = 0; i < selRows.length; i++) {
/** * Expands the selected nodes in the tree. * @param recursive whether to expand all children. */ public void expandSelectedNodes(boolean recursive) { Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); expandNode(treeNode, recursive, 1); } }
/** * Expands the selected nodes in the tree. * @param recursive whether to expand all children. */ public void expandSelectedNodes(boolean recursive) { Outline outline = getResultsOutline(); int[] selectedRows = outline.getSelectedRows(); for (int i = selectedRows.length; i > 0; i--) { int index = selectedRows[i - 1]; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) outline .getValueAt(index, 0); expandNode(treeNode, recursive, 1); } }
public void jButtonRemoveFilesAndFolderActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButtonRemoveFilesAndFolderActionPerformed if (droidContext.getSelectedProfile().getResultsOutline().getSelectedRows().length == 0) { DialogUtils.showNothingIsSelectedForRemoveDialog(this); } RemoveFilesAndFoldersAction removeAction = new RemoveFilesAndFoldersAction(droidContext, profileManager); removeAction.remove(); }// GEN-LAST:event_jButtonRemoveFilesAndFolderActionPerformed
public void jButtonRemoveFilesAndFolderActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButtonRemoveFilesAndFolderActionPerformed if (droidContext.getSelectedProfile().getResultsOutline().getSelectedRows().length == 0) { DialogUtils.showNothingIsSelectedForRemoveDialog(this); } RemoveFilesAndFoldersAction removeAction = new RemoveFilesAndFoldersAction(droidContext, profileManager); removeAction.remove(); }// GEN-LAST:event_jButtonRemoveFilesAndFolderActionPerformed
private void showPopup (final MouseEvent e) { int row = view.getOutline().rowAtPoint(e.getPoint()); if (row != -1) { boolean makeRowSelected = true; int [] selectedrows = view.getOutline().getSelectedRows(); for (int i = 0; i < selectedrows.length; i++) { if (row == selectedrows[i]) { makeRowSelected = false; break; } } if (makeRowSelected) { view.getOutline().getSelectionModel().setSelectionInterval(row, row); } } SwingUtilities.invokeLater(new Runnable() { @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()); } } }); }
ProfileInstance profile = selectedProfile.getProfile(); int[] selectedRows = outline.getSelectedRows();
ProfileInstance profile = selectedProfile.getProfile(); int[] selectedRows = outline.getSelectedRows();