类org.openide.util.actions.NodeAction源码实例Demo

下面列出了怎么用org.openide.util.actions.NodeAction的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: TencentKona-8   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
源代码2 项目: jdk8u60   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
源代码3 项目: openjdk-jdk8u   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
源代码5 项目: openjdk-jdk9   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(GarbageCollectAction.get(GarbageCollectAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }
    }
 
源代码6 项目: hottub   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
源代码7 项目: openjdk-8-source   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
源代码8 项目: openjdk-8   文件: OutlineTopComponent.java
private void initToolbar() {

        Toolbar toolbar = new Toolbar();
        Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N
        toolbar.setBorder(b);
        this.add(toolbar, BorderLayout.NORTH);

        toolbar.add(ImportAction.get(ImportAction.class));
        toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(RemoveAllAction.get(RemoveAllAction.class));

        toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup()));
        toolbar.add(SaveAllAction.get(SaveAllAction.class));

        toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter());

        for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) {
            tb.setVisible(false);
        }

        initOrganizers();
    }
 
源代码9 项目: netbeans   文件: JavaRefactoringGlobalAction.java
private boolean isMethodOverridden(NodeAction d, String name) {
    try {
        Method m = d.getClass().getMethod(name, new Class[0]);

        return m.getDeclaringClass() != CallableSystemAction.class;
    } catch (java.lang.NoSuchMethodException ex) {
        ex.printStackTrace();
        throw new IllegalStateException("Error searching for method " + name + " in " + d); // NOI18N
    }
}
 
源代码10 项目: netbeans   文件: JavaRefactoringGlobalAction.java
private boolean isMethodOverridden(NodeAction d, String name) {
    try {
        Method m = d.getClass().getMethod(name, new Class[0]);

        return m.getDeclaringClass() != CallableSystemAction.class;
    } catch (java.lang.NoSuchMethodException ex) {
        ex.printStackTrace();
        throw new IllegalStateException("Error searching for method " + name + " in " + d); // NOI18N
    }
}
 
源代码11 项目: netbeans   文件: RefactoringGlobalAction.java
private boolean isMethodOverridden(NodeAction d, String name) {
    try {
        Method m = d.getClass().getMethod(name, new Class[0]);

        return m.getDeclaringClass() != CallableSystemAction.class;
    } catch (java.lang.NoSuchMethodException ex) {
        ex.printStackTrace();
        throw new IllegalStateException("Error searching for method " + name + " in " + d); // NOI18N
    }
}
 
源代码12 项目: netbeans   文件: HtmlRefactoringGlobalAction.java
private boolean isMethodOverridden(NodeAction d, String name) {
    try {
        Method m = d.getClass().getMethod(name, new Class[0]);

        return m.getDeclaringClass() != CallableSystemAction.class;
    } catch (java.lang.NoSuchMethodException ex) {
        ex.printStackTrace();
        throw new IllegalStateException("Error searching for method " + name + " in " + d); // NOI18N
    }
}
 
源代码13 项目: netbeans   文件: IndexedEditorPanel.java
/** Creates new form IndexedEditorPanel */
public IndexedEditorPanel(Node node, Node.Property[] props) {
    treeTableView1 = new TreeTableView();

    // install proper border
    setBorder((Border) UIManager.get("Nb.ScrollPane.border")); // NOI18N
    initComponents();
    propertiesLabel.setLabelFor(treeTableView1);

    jPanel2.setLayout(new java.awt.BorderLayout());
    jPanel2.add(treeTableView1);

    detailsPanel.setLayout(new java.awt.BorderLayout());
    getExplorerManager().setRootContext(node);

    rootNode = node;
    prop = props[0];
    getExplorerManager().addPropertyChangeListener(this);
    treeTableView1.setProperties(props);
    treeTableView1.setRootVisible(false);
    treeTableView1.setDefaultActionAllowed(false);
    treeTableView1.setTreePreferredWidth(200);

    node.addPropertyChangeListener(this);

    try {
        ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);
        if (l == null) {
            l = Thread.currentThread().getContextClassLoader();
        }
        if (l == null) {
            l = getClass().getClassLoader();
        }
        
        selectedLookup = org.openide.util.lookup.Lookups.proxy(this);

        NodeAction globalMoveUp = SystemAction.get(Class.forName("org.openide.actions.MoveUpAction", true, l).asSubclass(NodeAction.class)); // NOI18N
        NodeAction globalMoveDown = SystemAction.get(Class.forName("org.openide.actions.MoveDownAction", true, l).asSubclass(NodeAction.class)); // NOI18N
        NodeAction globalNewAction = SystemAction.get(Class.forName("org.openide.actions.NewAction", true, l).asSubclass(NodeAction.class)); // NOI18N

        // Get context aware instances.
        moveUp = globalMoveUp.createContextAwareInstance(selectedLookup);
        moveDown = globalMoveDown.createContextAwareInstance(selectedLookup);
        newAction = globalNewAction.createContextAwareInstance(selectedLookup);
    } catch (ClassNotFoundException cnfe) {
        LOG.log(Level.INFO, "Maybe missing openide.actions module?", cnfe);
    }

    java.util.ResourceBundle bundle = NbBundle.getBundle(IndexedEditorPanel.class);
    treeTableView1.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Properties"));
    newButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_New"));
    deleteButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_Delete"));
    upButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveUp"));
    downButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_MoveDown"));
    getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IndexedEditorPanel"));
}
 
源代码14 项目: netbeans   文件: NewAction.java
public DelegateAction(NodeAction a, Lookup actionContext) {
    this.delegate = a;
    this.model = new ActSubMenuModel(actionContext);
}