本文整理匯總了Java中org.openide.nodes.Node.canRename方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.canRename方法的具體用法?Java Node.canRename怎麽用?Java Node.canRename使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.nodes.Node
的用法示例。
在下文中一共展示了Node.canRename方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: editingStopped
import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Implements <code>CellEditorListener</code> interface method. */
public void editingStopped(ChangeEvent e) {
//CellEditor sometimes(probably after stopCellEditing() call) gains one focus but loses two
if (stopped) {
return;
}
stopped = true;
TreePath lastP = lastPath;
if (lastP != null) {
Node n = Visualizer.findNode(lastP.getLastPathComponent());
if ((n != null) && n.canRename()) {
String newStr = (String) getCellEditorValue();
ViewUtil.nodeRename(n, newStr);
}
}
}
示例2: getTreeCellEditorComponent
import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Main method of the editor.
* @return component of editor
*/
@Override
public Component getTreeCellEditorComponent(
JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row
) {
Node ren = Visualizer.findNode(value);
if ((ren != null) && (ren.canRename())) {
delegate.setValue(ren.getName());
} else {
delegate.setValue(""); // NOI18N
}
editingIcon = ((VisualizerNode) value).getIcon(expanded, false);
((JTextField) editorComponent).selectAll();
return editorComponent;
}
示例3: editingStopped
import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Implements <code>CellEditorListener</code> interface method. */
public void editingStopped(ChangeEvent e) {
TreePath lastP = tree.getPathForRow(lastRow);
if (lastP != null) {
Node n = Visualizer.findNode(lastP.getLastPathComponent());
if ((n != null) && n.canRename()) {
String newStr = (String) getCellEditorValue();
ViewUtil.nodeRename(n, newStr);
}
}
}
示例4: isCellEditable
import org.openide.nodes.Node; //導入方法依賴的package包/類
@Override
public boolean isCellEditable(EventObject event) {
if ((event != null) && (event instanceof MouseEvent)) {
if (!SwingUtilities.isLeftMouseButton((MouseEvent) event) || ((MouseEvent) event).isPopupTrigger()) {
abortTimer();
return false;
}
if (!wasFocusOwner) {
wasFocusOwner = true;
return false;
}
}
if (lastPath != null) {
Node n = Visualizer.findNode(lastPath.getLastPathComponent());
if ((n == null) || !n.canRename()) {
return false;
}
} else {
// Disallow rename when multiple nodes are selected
return false;
}
// disallow editing if we are in DnD operation
if (dndActive) {
return false;
}
return super.isCellEditable(event);
}
示例5: isCellEditable
import org.openide.nodes.Node; //導入方法依賴的package包/類
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
if (columnIndex == 0) {
Node treeNode = getNodeAt(rowIndex);
return null != treeNode && treeNode.canRename();
}
return super.isCellEditable(rowIndex, columnIndex);
}
示例6: inspectNode
import org.openide.nodes.Node; //導入方法依賴的package包/類
private void inspectNode(Node n) {
n.getDisplayName();
n.getHtmlDisplayName();
n.getShortDescription();
n.getIcon(BeanInfo.ICON_COLOR_16x16);
n.canCopy();
n.canCut();
n.canRename();
n.getNewTypes();
n.getActions(true);
n.getPreferredAction();
inspectProperties(n);
}