org.netbeans.swing.outline.Outline.expandPath()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.netbeans.swing.outline.Outline.expandPath()方法的一些代码示例,展示了Outline.expandPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Outline.expandPath()方法的具体详情如下:
包路径:org.netbeans.swing.outline.Outline
类名称:Outline
方法名:expandPath

Outline.expandPath介绍

[英]Expand a tree path
[中]展开树路径

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-explorer

final public void actionPerformed(ActionEvent e) {
    if (LOGABLE) {
      log("should expand " + path); // NOI18N
    }
    view.getOutline().expandPath(path);
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** 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);
}

代码示例来源:origin: in.jlibs/org-netbeans-swing-outline

public void actionPerformed(ActionEvent e) {
    if( getSelectedRowCount() == 1 && isTreeColumnIndex (getSelectedColumn()) ) {
      int selRow = getSelectedRow();
      TreePath selPath = getLayoutCache().getPathForRow(selRow);
      if( null != selPath 
          && !getOutlineModel().isLeaf(selPath.getLastPathComponent()) ) {
        boolean expanded = getLayoutCache().isExpanded(selPath);
        if( expanded && !expand ) {
          collapsePath(selPath);
          return;
        } else if( !expanded && expand ) {
          expandPath(selPath);
          return;
        }
      }
    }
    if( null != origAction )
      origAction.actionPerformed(e);
  }
}

相关文章