本文整理了Java中javax.swing.JTree.getCellEditor()
方法的一些代码示例,展示了JTree.getCellEditor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.getCellEditor()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:getCellEditor
暂无
代码示例来源:origin: stackoverflow.com
tree.setCellRenderer(new TreeCellRenderer() {
@Override
public Component getTreeCellRendererComponent(
JTree tree, Object value,
boolean selected, boolean expanded,
boolean leaf, int row, boolean hasFocus) {
return tree.getCellEditor().getTreeCellEditorComponent(tree, value,
selected, expanded, leaf, row);
}
});
代码示例来源:origin: tinyMediaManager/tinyMediaManager
/**
* Return the wrapped cell editor.
*
* @return the cell editor
*/
public javax.swing.tree.TreeCellEditor getCellEditor() {
final javax.swing.tree.TreeCellEditor ed = super.getCellEditor();
if (ed == null)
return null;
if (wrapper == null)
wrapper = new RendererEditorWrapper();
wrapper.ed = ed;
return wrapper;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
public void dragGestureRecognized (DragGestureEvent dge) {
super.dragGestureRecognized (dge);
// notify tree cell editor that DnD operationm is active
if (exDnD.isDnDActive ()) {
TreeCellEditor tce = ((JTree)tree).getCellEditor ();
if (tce instanceof TreeViewCellEditor)
((TreeViewCellEditor)tce).setDnDActive (true);
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
@Override
public void run() {
TreeCellEditor cellEditor = tree.getCellEditor();
if (cellEditor instanceof TreeViewCellEditor) {
((TreeViewCellEditor) cellEditor).abortTimer();
}
tree.cancelEditing();
final Node rc = manager.getRootContext();
LOG.log(Level.FINE, "synchronizeRootContext {0}", rc);
treeModel.setNode(rc, visHolder);
}
});
代码示例来源:origin: org.netbeans.api/org-openide-explorer
@Override
public void dragGestureRecognized(DragGestureEvent dge) {
super.dragGestureRecognized(dge);
// notify tree cell editor that DnD operationm is active
if (exDnD.isDnDActive()) {
TreeCellEditor tce = tree.getCellEditor();
if (tce instanceof TreeViewCellEditor) {
((TreeViewCellEditor) tce).setDnDActive(true);
}
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public void dragGestureRecognized (DragGestureEvent dge) {
super.dragGestureRecognized (dge);
// notify tree cell editor that DnD operationm is active
if (exDnD.isDnDActive ()) {
TreeCellEditor tce = ((JTree)tree).getCellEditor ();
if (tce instanceof TreeViewCellEditor)
((TreeViewCellEditor)tce).setDnDActive (true);
}
}
代码示例来源:origin: net.sf.jt400/jt400
public CellEditor startEditing (VObject object, Object propertyIdentifier)
{
// Validate the parameters.
if (object == null)
throw new NullPointerException ("object");
if (propertyIdentifier == null)
throw new NullPointerException ("propertyIdentifier");
if (allowActions_ == false)
return null;
// Edit.
//@B0A - Swing 1.1 bug. JTree.startEditingAtPath() will cause
// a NullPointerException when it calls getPathBounds()
// internally when the node isn't in the tree.
if (tree_.getPathBounds(model_.getPath(object)) != null) //@B0A
{ //@B0A
tree_.startEditingAtPath (model_.getPath (object)); //@B0A
} //@B0A
return tree_.getCellEditor ();
}
}
代码示例来源:origin: javax.help/javahelp
public void treeNodesChanged(javax.swing.event.TreeModelEvent treeModelEvent) {
debug("node changed");
TreeCellEditor editor = tree.getCellEditor();
Object newName = editor.getCellEditorValue();
if((newName instanceof String) && selectedItem != null){
debug("new name");
//data of old item
Map.ID itemID = (Map.ID)dataMap.get(selectedItem);
//remove old data from dataMap
dataMap.remove(selectedItem);
FavoritesNode fromRootNode = (FavoritesNode)connections.get(getSelectedNode());
//change name of old Item
selectedItem.setName((String)newName);
selectedNode.setUserObject(selectedItem);
if(fromRootNode != null){
FavoritesItem fromRootItem = (FavoritesItem) fromRootNode.getUserObject();
fromRootItem.setName((String)newName);
}
//put data to the dataMap
dataMap.put(selectedItem,itemID);
saveFavorites();
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
TreeCellEditor tce = tree.getCellEditor();
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
TreeCellEditor tce = tree.getCellEditor();
if (tce instanceof TreeViewCellEditor)
((TreeViewCellEditor)tce).setDnDActive (false);
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
TreeCellEditor tce = tree.getCellEditor();
if (tce instanceof TreeViewCellEditor)
((TreeViewCellEditor)tce).setDnDActive (false);
代码示例来源:origin: org.netbeans.api/org-openide-explorer
TreeCellEditor tce = tree.getCellEditor();
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
TreeCellEditor tce = tree.getCellEditor ();
if (tce instanceof TreeViewCellEditor)
((TreeViewCellEditor)tce).setDnDActive (false);
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
TreeCellEditor tce = tree.getCellEditor ();
if (tce instanceof TreeViewCellEditor)
((TreeViewCellEditor)tce).setDnDActive (false);
内容来源于网络,如有侵权,请联系作者删除!