本文整理了Java中javax.swing.JTree.getName()
方法的一些代码示例,展示了JTree.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.getName()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:getName
暂无
代码示例来源:origin: org.zaproxy/zap
private JTree getTree(Component invoker) {
if (invoker instanceof JTree) {
JTree tree = (JTree) invoker;
if (tree.getName().equals("treeSite")) {
return tree;
}
}
return null;
}
代码示例来源:origin: org.zaproxy/zap
@Override
public boolean isEnableForComponent(Component invoker) {
if (invoker instanceof JTree) {
JTree tree = (JTree) invoker;
if (tree.getName().equals("treeSite")) {
this.setEnabled(true);
return true;
}
}
return false;
}
代码示例来源:origin: org.zaproxy/zap
@Override
public void show(Component invoker, int x, int y) {
final int countSelectedNodes = treeAlert.getSelectionCount();
final ArrayList<HistoryReference> uniqueHistoryReferences = new ArrayList<>(countSelectedNodes);
if (countSelectedNodes > 0) {
SortedSet<Integer> historyReferenceIdsAdded = new TreeSet<>();
for (TreePath path : treeAlert.getSelectionPaths()) {
final AlertNode node = (AlertNode) path.getLastPathComponent();
final Object userObject = node.getUserObject();
if (userObject instanceof Alert) {
HistoryReference historyReference = ((Alert) userObject).getHistoryRef();
if (historyReference != null && !historyReferenceIdsAdded
.contains(Integer.valueOf(historyReference.getHistoryId()))) {
historyReferenceIdsAdded.add(Integer.valueOf(historyReference.getHistoryId()));
uniqueHistoryReferences.add(historyReference);
}
}
}
uniqueHistoryReferences.trimToSize();
}
SelectableHistoryReferencesContainer messageContainer = new DefaultSelectableHistoryReferencesContainer(
treeAlert.getName(),
treeAlert,
Collections.<HistoryReference> emptyList(),
uniqueHistoryReferences);
view.getPopupMenu().show(messageContainer, x, y);
}
});
代码示例来源:origin: joel-costigliola/assertj-swing
/**
* Returns the {@code String} representation of the given {@code Component}, which should be a {@code JTree} (or
* subclass).
*
* @param c the given {@code Component}.
* @return the {@code String} representation of the given {@code JTree}.
*/
@Override
@Nonnull protected String doFormat(@Nonnull Component c) {
JTree tree = (JTree) c;
String format = "%s[name=%s, selectionCount=%d, selectionPaths=%s, selectionMode=%s, enabled=%b, visible=%b, showing=%b";
return String.format(format, getRealClassName(c), quote(tree.getName()), tree.getSelectionCount(),
Arrays.format(selectionPaths(tree)), selectionMode(tree), tree.isEnabled(), tree.isVisible(),
tree.isShowing());
}
代码示例来源:origin: org.zaproxy/zap
treeSite.getName(),
treeSite,
Collections.<HistoryReference> emptyList(),
内容来源于网络,如有侵权,请联系作者删除!