當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.canRename方法代碼示例

本文整理匯總了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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:TreeViewCellEditor.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:TreeViewCellEditor.java

示例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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:TreeTable.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:32,代碼來源:TreeViewCellEditor.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:OutlineView.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:AsynchronousTest.java


注:本文中的org.openide.nodes.Node.canRename方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。