本文整理了Java中javax.swing.JTree.isSelectionEmpty()
方法的一些代码示例,展示了JTree.isSelectionEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.isSelectionEmpty()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:isSelectionEmpty
暂无
代码示例来源:origin: bcdev/beam
OpendapLeaf getSelectedLeaf() {
if (jTree.isSelectionEmpty()) {
return null;
}
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) jTree.getAnchorSelectionPath().getLastPathComponent();
return (OpendapLeaf) selectedNode.getUserObject();
}
代码示例来源:origin: org.zaproxy/zap
private SiteNode getSiteTreeTarget() {
if (!extension.getView().getSiteTreePanel().getTreeSite().isSelectionEmpty()) {
return (SiteNode) extension.getView().getSiteTreePanel().getTreeSite().getSelectionPath()
.getLastPathComponent();
}
return null;
}
}
代码示例来源:origin: jpcsp/jpcsp
/** Configures a tree cell renderer and sets up sizing and the
* backing image from it */
public boolean configure (Object nd, JScrollPane tv, JTree tree, TreePath path, int row) {
setLastRendereredObject(nd);
setLastRenderedScrollPane (tv);
Component renderer = null;
bg = tree.getBackground();
boolean sel = tree.isSelectionEmpty() ? false :
tree.getSelectionModel().isPathSelected(path);
boolean exp = tree.isExpanded(path);
boolean leaf = !exp && tree.getModel().isLeaf(nd);
boolean lead = path.equals(tree.getSelectionModel().getLeadSelectionPath());
renderer = tree.getCellRenderer().getTreeCellRendererComponent(tree, nd, sel, exp, leaf, row, lead);
if (renderer != null) {
setComponent (renderer);
}
return true;
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
/** Configures a tree cell renderer and sets up sizing and the
* backing image from it */
public boolean configure (Object nd, JScrollPane tv, JTree tree, TreePath path, int row) {
boolean sameVn = setLastRendereredObject(nd);
boolean sameComp = setLastRenderedScrollPane (tv);
Component renderer = null;
bg = tree.getBackground();
boolean sel = tree.isSelectionEmpty() ? false :
tree.getSelectionModel().isPathSelected(path);
boolean exp = tree.isExpanded(path);
boolean leaf = !exp && tree.getModel().isLeaf(nd);
boolean lead = path.equals(tree.getSelectionModel().getLeadSelectionPath());
renderer = tree.getCellRenderer().getTreeCellRendererComponent(tree, nd, sel, exp, leaf, row, lead);
if (renderer != null) {
setComponent (renderer);
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!