本文整理了Java中javax.swing.JTree.setEditable()
方法的一些代码示例,展示了JTree.setEditable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.setEditable()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:setEditable
暂无
代码示例来源:origin: camunda/camunda-bpm-platform
protected void init() {
// Put visible lines on the JTree.
putClientProperty("JTree.lineStyle", "Angled");
// Configure the Tree with the appropriate Renderers and Editors.
CategoryNodeRenderer renderer = new CategoryNodeRenderer();
setEditable(true);
setCellRenderer(renderer);
CategoryNodeEditor editor = new CategoryNodeEditor(_model);
setCellEditor(new CategoryImmediateEditor(this,
new CategoryNodeRenderer(),
editor));
setShowsRootHandles(true);
setToolTipText("");
ensureRootExpansion();
}
代码示例来源:origin: stackoverflow.com
m_tree.setEditable(false);
代码示例来源:origin: pentaho/mondrian
workbench, tree, renderer, comboEditor);
tree.setCellEditor(editor);
tree.setEditable(true);
代码示例来源:origin: ron190/jsql-injection
this.tree.setEditable(true);
this.tree.setShowsRootHandles(true);
this.tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders
TemplatesTreeView() {
tree.setEditable(false);
// install proper border
setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
}
代码示例来源:origin: stackoverflow.com
JTree tree = new JTree(new String[]{"a", "b", "c"});
tree.setEditable(true);
InputMap m = tree.getInputMap(JComponent.WHEN_FOCUSED);
KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0);
m.put(ks, "actionMapKey");
tree.getActionMap().put("actionMapKey", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
// do your stuff
}
});
代码示例来源:origin: de.schlichtherle.truezip/truezip-file
@Override
public void setEditable(final boolean editable) {
if (editable) {
super.setEditable(true);
getCellEditor().addCellEditorListener(controller);
} else {
final CellEditor ce = getCellEditor();
if (ce != null)
ce.removeCellEditorListener(controller);
super.setEditable(false);
}
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-config
protected void createDetectedCallBack() {
$objectMap.put("detectedCallBack", detectedCallBack = new JTree());
detectedCallBack.setName("detectedCallBack");
detectedCallBack.setEditable(false);
detectedCallBack.setRootVisible(false);
detectedCallBack.setRowHeight(24);
}
代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-config
protected void createDetectedCallBack() {
$objectMap.put("detectedCallBack", detectedCallBack = new JTree());
detectedCallBack.setName("detectedCallBack");
detectedCallBack.setEditable(false);
detectedCallBack.setRootVisible(false);
detectedCallBack.setRowHeight(24);
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets-config
protected void createDetectedCallBack() {
$objectMap.put("detectedCallBack", detectedCallBack = new JTree());
detectedCallBack.setName("detectedCallBack");
detectedCallBack.setEditable(false);
detectedCallBack.setRootVisible(false);
detectedCallBack.setRowHeight(24);
}
代码示例来源:origin: com.github.danielpacak.osgi.swingconsole/osgi.swingconsole
public BundleManifest() {
treeModel = new BundleManifestTreeModel();
tree = new JTree(treeModel);
tree.setName("tree.bundle.manifest");
tree.setEditable(false);
setLayout(new BorderLayout());
add(tree, BorderLayout.CENTER);
}
代码示例来源:origin: igvteam/igv
private void initTree(DefaultMutableTreeNode rootNode) {
tree = new JTree(rootNode);
tree.setExpandsSelectedPaths(true);
tree.setCellRenderer(new NodeRenderer());
tree.setCellEditor(new ResourceEditor(tree));
tree.setEditable(true);
}
代码示例来源:origin: stackoverflow.com
JTree t = new JTree();
t.setEditable(true);
TreeCellRenderer cellRenderer = t.getCellRenderer();
DefaultTreeCellEditor cellEditor = new DefaultTreeCellEditor(t, (DefaultTreeCellRenderer) cellRenderer){
@Override
public boolean isCellEditable(EventObject arg0) {
if(arg0 instanceof MouseEvent){
return ((MouseEvent)arg0).getClickCount() > 2;
}
return super.isCellEditable(arg0);
}
};
t.setCellEditor(cellEditor);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project
public CheckTreeView(TransferSelectorModel model) {
CheckListener listener = new CheckListener(model);
tree.addMouseListener(listener);
tree.addKeyListener(listener);
CheckRenderer renderer = new CheckRenderer(model);
tree.setCellRenderer(renderer);
tree.setEditable(false);
}
代码示例来源:origin: infinitest/infinitest
private static JTree createTree() {
JTree resultsTree = new JTree();
resultsTree.setName("TREEVIEW");
resultsTree.setRootVisible(false);
resultsTree.setEditable(false);
resultsTree.setShowsRootHandles(true);
resultsTree.setCellRenderer(new FailureCellRenderer());
ToolTipManager tipManager = ToolTipManager.sharedInstance();
tipManager.registerComponent(resultsTree);
resultsTree.addKeyListener(new EnterPressListener());
return resultsTree;
}
代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit
public HelpTOCPanel(HelpViewerInterface helpViewer)
{
super(new BorderLayout());
this.helpViewer = helpViewer;
nodes = new Hashtable();
toc = new TOCTree();
// looks bad with the OS X L&F, apparently...
if(!OperatingSystem.isMacOSLF())
toc.putClientProperty("JTree.lineStyle", "Angled");
toc.setCellRenderer(new TOCCellRenderer());
toc.setEditable(false);
toc.setShowsRootHandles(true);
add(BorderLayout.CENTER,new JScrollPane(toc));
load();
} //}}}
代码示例来源:origin: dcaoyuan/nbscala
public PlatformsView () {
super ();
this.setPopupAllowed (false);
this.setDefaultActionAllowed(false);
this.setRootVisible (false);
this.tree.setEditable(false);
this.tree.setShowsRootHandles(false);
this.setBorder(UIManager.getBorder("Nb.ScrollPane.border")); // NOI18N
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-platform-ui
public PlatformsView () {
super ();
this.setPopupAllowed (false);
this.setDefaultActionAllowed(false);
this.setRootVisible (false);
this.tree.setEditable(false);
this.tree.setShowsRootHandles(false);
this.setBorder(UIManager.getBorder("Nb.ScrollPane.border")); // NOI18N
setPreferredSize(new java.awt.Dimension(200, 334));
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-project-libraries-ui
@Messages("AD_Libraries=N/A")
LibrariesView() {
this.setRootVisible(false);
this.setPopupAllowed(false);
this.setDefaultActionAllowed(false);
this.tree.setEditable (false);
this.tree.setShowsRootHandles (false);
this.getAccessibleContext().setAccessibleDescription(AD_Libraries());
}
代码示例来源:origin: org.apache/log4j
protected void init() {
// Put visible lines on the JTree.
putClientProperty("JTree.lineStyle", "Angled");
// Configure the Tree with the appropriate Renderers and Editors.
CategoryNodeRenderer renderer = new CategoryNodeRenderer();
setEditable(true);
setCellRenderer(renderer);
CategoryNodeEditor editor = new CategoryNodeEditor(_model);
setCellEditor(new CategoryImmediateEditor(this,
new CategoryNodeRenderer(),
editor));
setShowsRootHandles(true);
setToolTipText("");
ensureRootExpansion();
}
内容来源于网络,如有侵权,请联系作者删除!