org.openide.actions.CopyAction Java Examples

The following examples show how to use org.openide.actions.CopyAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JmeNode.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
    public Action[] getActions(boolean context) {
//        return super.getActions(context);
        if (((JmeSpatialChildren) jmeChildren).readOnly) {
            return new Action[]{
                        SystemAction.get(CopyAction.class),};
        } else {
            return new Action[]{
                        new NewSpatialPopup(this),
                        new NewControlPopup(this),
                        new NewLightPopup(this),
                        Actions.alwaysEnabled(new AddUserDataAction(this), "Add User Data", "", false),
                        new ToolPopup(this),
                        SystemAction.get(RenameAction.class),
                        SystemAction.get(CopyAction.class),
                        SystemAction.get(CutAction.class),
                        SystemAction.get(PasteAction.class),
                        SystemAction.get(DeleteAction.class)
                    };
        }
    }
 
Example #2
Source File: JmeSpatial.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
    public Action[] getActions(boolean context) {
//        return super.getActions(context);
        if (((JmeSpatialChildren) jmeChildren).readOnly) {
            return new Action[]{
                        SystemAction.get(CopyAction.class),};
        } else {
            return new Action[]{
                        new NewControlPopup(this),
                        new NewLightPopup(this),
                        Actions.alwaysEnabled(new AddUserDataAction(this), "Add User Data", "", false),
                        new ToolPopup(this),
                        SystemAction.get(RenameAction.class),
                        SystemAction.get(CopyAction.class),
                        SystemAction.get(CutAction.class),
                        SystemAction.get(PasteAction.class),
                        SystemAction.get(DeleteAction.class)
                    };
        }
    }
 
Example #3
Source File: PropertiesLocaleNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Lazily initialize set of node's actions.
 * Overrides superclass method.
 *
 * @return array of actions for this node
 */
@Override
protected SystemAction[] createActions () {
    return new SystemAction[] {
        SystemAction.get(EditAction.class),
        SystemAction.get(OpenAction.class),
        null,
        SystemAction.get(CutAction.class),
        SystemAction.get(CopyAction.class),
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        SystemAction.get(LangRenameAction.class),
        null,
        SystemAction.get(NewAction.class),
        SystemAction.get(SaveAsTemplateAction.class),
        null,
        SystemAction.get(FileSystemAction.class),
        null,
        SystemAction.get(ToolsAction.class),
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #4
Source File: FavoritesNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Add action 'Add to Favorites'. */
private Action [] createActionsForFile (Action [] arr) {
    boolean added = false;
    List<Action> newArr = new ArrayList<Action>();
    for (int i = 0; i < arr.length; i++) {
        //Add before CopyAction or CutAction
        if (!added && ((arr[i] instanceof CopyAction) || (arr[i] instanceof CutAction))) {
            added = true;
            newArr.add(Actions.add());
            newArr.add(null);
        }
        newArr.add(arr[i]);
    }
    if (!added) {
        added = true;
        newArr.add(null);
        newArr.add(Actions.add());
    }
    return newArr.toArray (new Action[newArr.size()]);
}
 
Example #5
Source File: FavoritesNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Add action 'Add to Favorites'. */
private Action [] createActionsForFolder (Action [] arr) {
    boolean added = false;
    List<Action> newArr = new ArrayList<Action>();
    for (int i = 0; i < arr.length; i++) {
        //Add before CopyAction or CutAction
        if (!added && ((arr[i] instanceof CopyAction) || (arr[i] instanceof CutAction))) {
            added = true;
            newArr.add(Actions.add());
            newArr.add(null);
        }
        newArr.add(arr[i]);
    }
    if (!added) {
        added = true;
        newArr.add(null);
        newArr.add(Actions.add());
    }
    return newArr.toArray (new Action[newArr.size()]);
}
 
Example #6
Source File: AnnotationProviderTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Gets default system actions. Overrides superclass method. */
protected SystemAction[] defaultActions() {
    return new SystemAction[] {
        SystemAction.get(OpenAction.class),
        SystemAction.get (FileSystemAction.class),
        null,
        SystemAction.get(CutAction.class),
        SystemAction.get(CopyAction.class),
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        SystemAction.get(RenameAction.class),
        null,
        SystemAction.get(SaveAsTemplateAction.class),
        null,
        SystemAction.get(ToolsAction.class),
        SystemAction.get(PropertiesAction.class),
    };
}
 
Example #7
Source File: FavoritesNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Add action 'Remove from Favorites'. */
private Action [] createActionsForFavoriteFile (Action [] arr) {
    boolean added = false;
    List<Action> newArr = new ArrayList<Action>();
    for (int i = 0; i < arr.length; i++) {
        //Add before CopyAction or CutAction
        if (!added && ((arr[i] instanceof CopyAction) || (arr[i] instanceof CutAction))) {
            added = true;
            newArr.add(Actions.remove());
            newArr.add(null);
        }
        //Do not add Delete action
        if (!(arr[i] instanceof DeleteAction)) {
            newArr.add(arr[i]);
        }
    }
    if (!added) {
        added = true;
        newArr.add(null);
        newArr.add(Actions.remove());
    }
    return newArr.toArray (new Action[newArr.size()]);
}
 
Example #8
Source File: FavoritesNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Add action 'Remove from Favorites'. */
private Action [] createActionsForFavoriteFolder (Action [] arr) {
    boolean added = false;
    List<Action> newArr = new ArrayList<Action>();
    for (int i = 0; i < arr.length; i++) {
        //Add before CopyAction or CutAction
        if (!added && ((arr[i] instanceof CopyAction) || (arr[i] instanceof CutAction))) {
            added = true;
            newArr.add(Actions.remove());
            newArr.add(null);
        }
        //Do not add Delete action
        if (!(arr[i] instanceof DeleteAction)) {
            newArr.add(arr[i]);
        }
    }
    if (!added) {
        added = true;
        newArr.add(null);
        newArr.add(Actions.remove());
    }
    
    return newArr.toArray (new Action[newArr.size()]);
}
 
Example #9
Source File: SceneExplorerTopComponent.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void initActions() {
    CutAction cut = SystemAction.get(CutAction.class);
    getActionMap().put(cut.getActionMapKey(), ExplorerUtils.actionCut(explorerManager));
    CopyAction copy = SystemAction.get(CopyAction.class);
    getActionMap().put(copy.getActionMapKey(), ExplorerUtils.actionCopy(explorerManager));
    PasteAction paste = SystemAction.get(PasteAction.class);
    getActionMap().put(paste.getActionMapKey(), ExplorerUtils.actionPaste(explorerManager));
    DeleteAction delete = SystemAction.get(DeleteAction.class);
    getActionMap().put(delete.getActionMapKey(), ExplorerUtils.actionDelete(explorerManager, true));
}
 
Example #10
Source File: VersionNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    Artifact artifact = RepositoryUtil.createArtifact(record);
    List<Action> actions = new ArrayList<Action>();
    actions.add(new ShowArtifactAction(record));
    actions.add(new AddAsDependencyAction(artifact));
    actions.add(CommonArtifactActions.createFindUsages(artifact));
    actions.add(CommonArtifactActions.createViewJavadocAction(artifact));
    actions.add(OpenAction.get(OpenAction.class));
    actions.add(new DownloadAction(artifact));
    actions.add(new DownloadAction(artifact, false));
    actions.add(new DownloadAction(artifact, true));
    actions.add(CopyAction.get(CopyAction.class));
    return actions.toArray(new Action[actions.size()]);
}
 
Example #11
Source File: AssetPackBrowserTopComponent.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void initActions() {
//        CutAction cut = SystemAction.get(CutAction.class);
//        getActionMap().put(cut.getActionMapKey(), ExplorerUtils.actionCut(explorerManager));
        CopyAction copy = SystemAction.get(CopyAction.class);
        getActionMap().put(copy.getActionMapKey(), ExplorerUtils.actionCopy(explorerManager));
//        PasteAction paste = SystemAction.get(PasteAction.class);
//        getActionMap().put(paste.getActionMapKey(), ExplorerUtils.actionPaste(explorerManager));
//        DeleteAction delete = SystemAction.get(DeleteAction.class);
//        getActionMap().put(delete.getActionMapKey(), ExplorerUtils.actionDelete(explorerManager, true));
    }
 
Example #12
Source File: ApkDataObject.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        SystemAction.get(SaveAsAction.class),
        SystemAction.get(InstallApkAction.class),
        SystemAction.get(CopyAction.class),
        SystemAction.get(DeleteAction.class),
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #13
Source File: DiffViewImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void editorActivated(final JEditorPane editor) {
    final Action copy = getAction (DefaultEditorKit.copyAction, editor);
    if (copy != null) {
        final CallbackSystemAction sysCopy
        = ((CallbackSystemAction) SystemAction.get (CopyAction.class));
        final ActionPerformer perf = new ActionPerformer () {
            public void performAction (SystemAction action) {
                copy.actionPerformed (new ActionEvent (editor, 0, "")); // NOI18N
            }
        };
        sysCopy.setActionPerformer(copy.isEnabled() ? perf : null);
        PropertyChangeListener copyListener;
        copy.addPropertyChangeListener(copyListener = new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if ("enabled".equals(evt.getPropertyName())) { // NOI18N
                    if (((Boolean)evt.getNewValue()).booleanValue()) {
                        sysCopy.setActionPerformer(perf);
                    } else if (sysCopy.getActionPerformer() == perf) {
                        sysCopy.setActionPerformer(null);
                    }
                }
            }
        });
        if (editor.equals(jEditorPane1)) copyL = copyListener;
        else copyP = copyListener;
    }
}
 
Example #14
Source File: DiffPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void editorActivated(final JEditorPane editor) {
    //System.out.println("editor("+editor+") activated.");
    final Action copy = getAction (DefaultEditorKit.copyAction, editor);
    if (copy != null) {
        final CallbackSystemAction sysCopy
        = ((CallbackSystemAction) SystemAction.get (CopyAction.class));
        final ActionPerformer perf = new ActionPerformer () {
            public void performAction (SystemAction action) {
                copy.actionPerformed (new ActionEvent (editor, 0, "")); // NOI18N
            }
        };
        sysCopy.setActionPerformer(copy.isEnabled() ? perf : null);
        PropertyChangeListener copyListener;
        copy.addPropertyChangeListener(copyListener = new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if ("enabled".equals(evt.getPropertyName())) { // NOI18N
                    if (((Boolean)evt.getNewValue()).booleanValue()) {
                        sysCopy.setActionPerformer(perf);
                    } else if (sysCopy.getActionPerformer() == perf) {
                        sysCopy.setActionPerformer(null);
                    }
                }
            }
        });
        if (editor.equals(jEditorPane1)) copyL = copyListener;
        else copyP = copyListener;
    }
}
 
Example #15
Source File: MergePanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void editorActivated(final JEditorPane editor) {
    //System.out.println("editor("+editor+") activated.");
    final Action copy = getAction (DefaultEditorKit.copyAction, editor);
    if (copy != null) {
        final CallbackSystemAction sysCopy
        = ((CallbackSystemAction) SystemAction.get (CopyAction.class));
        final ActionPerformer perf = new ActionPerformer () {
            public void performAction (SystemAction action) {
                copy.actionPerformed (new ActionEvent (editor, 0, "")); // NOI18N
            }
        };
        sysCopy.setActionPerformer(copy.isEnabled() ? perf : null);
        PropertyChangeListener copyListener;
        copy.addPropertyChangeListener(copyListener = new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if ("enabled".equals(evt.getPropertyName())) { // NOI18N
                    if (((Boolean)evt.getNewValue()).booleanValue()) {
                        sysCopy.setActionPerformer(perf);
                    } else if (sysCopy.getActionPerformer() == perf) {
                        sysCopy.setActionPerformer(null);
                    }
                }
            }
        });
        if (editor.equals(jEditorPane1)) copyL = copyListener;
        else copyP = copyListener;
    }
}
 
Example #16
Source File: Hk2ItemNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Get the set of actions that are associated with this node.
     * <p/>
     * This set is used to construct the context menu for the node.
     * By default this method delegates to the deprecated getActions
     * or getContextActions method depending on the value of supplied argument.
     * It is supposed to be overridden by subclasses accordingly.
     * <p/>
     * @param context Whether to find actions for context meaning or for
     *                the node itself.
     * @return {@see List} of actions (you may include nulls for separators).
     */
    @Override
    public Action[] getActions(boolean context) {
        List<Action> actions = new ArrayList<Action>();
        if(decorator.isRefreshable()) {
            actions.add(SystemAction.get(RefreshModulesAction.class));
        }
        if(decorator.canDeployTo()) {
//            actions.add(SystemAction.get(DeployDirectoryAction.class));
        }
        if(decorator.canUndeploy()) {
            actions.add(SystemAction.get(UndeployModuleAction.class));
        }
        if(decorator.canEnable()) {
            actions.add(SystemAction.get(EnableModulesAction.class));
        }
        if(decorator.canDisable()) {
            actions.add(SystemAction.get(DisableModulesAction.class));
        }
        if(decorator.canUnregister()) {
            actions.add(SystemAction.get(UnregisterResourceAction.class));
        }
        if(decorator.canShowBrowser()) {
            actions.add(SystemAction.get(OpenURLAction.class));
        }
        if(decorator.canTest()) {
            actions.add(SystemAction.get(OpenTestURLAction.class));
        }
        if(decorator.canCopy()) {
            actions.add(SystemAction.get(CopyAction.class));
        }
        if (decorator.canEditDetails()) {
            actions.add(SystemAction.get(EditDetailsAction.class));
        }
        return actions.toArray(new Action[actions.size()]);
    }
 
Example #17
Source File: DataLoaderGetActionsTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected SystemAction[] defaultActions() {
    return new SystemAction[] {
        SystemAction.get(CutAction.class),
        null,
        SystemAction.get(CopyAction.class),
        null,
        SystemAction.get(DeleteAction.class),
    };
}
 
Example #18
Source File: BrokenDataShadow.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Action[] getActions(boolean context) {
    return new Action[] {
                SystemAction.get (CutAction.class),
                SystemAction.get (CopyAction.class),
                SystemAction.get (PasteAction.class),
                null,
                SystemAction.get (DeleteAction.class),
                null,
                SystemAction.get (ToolsAction.class),
                SystemAction.get (PropertiesAction.class)
            };
}
 
Example #19
Source File: MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testAntXmlPopup(){
    MimeLookup lookup = MimeLookup.getMimeLookup("text/xml"); //NOI18N
    Class layerObjects[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class};
    testPopupItems(lookup, layerObjects);
    lookup = MimeLookup.getMimeLookup("text/x-ant+xml"); //NOI18N
    Class layerObjects2[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class, FindAction.class};
    testPopupItems(lookup, layerObjects2);
}
 
Example #20
Source File: MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Issue #61216: MimeLookup should support layer hidding
 */
public void testHidding(){
    Lookup lookup = MimeLookup.getLookup(MimePath.get("text/xml"));
    checkLookupObject(lookup, CopyAction.class, true);
    checkLookupObject(lookup, ReplaceAction.class, true);
    checkLookupObject(lookup, PasteAction.class, false);
    lookup = MimeLookup.getLookup(MimePath.get("text/x-ant+xml"));
    checkLookupObject(lookup, CutAction.class, true);
    checkLookupObject(lookup, CopyAction.class, false);
    checkLookupObject(lookup, PasteAction.class, true);
    checkLookupObject(lookup, ReplaceAction.class, false);
}
 
Example #21
Source File: MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Testing MIME level popup items lookup, inheritance and sorting */
public void testMimeLevelPopupsWithStringAndSeparator(){
    MimePath mp = MimePath.parse("text/x-java/text/html/text/xml"); //NOI18N
    Lookup lookup = MimeLookup.getLookup(mp);
    Class layerObjects[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class, JSeparator.class, String.class};
    testPopupItems(lookup, layerObjects);
}
 
Example #22
Source File: MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Testing MIME level popup items lookup, inheritance and sorting */
public void testMimeLevelPopups(){
    MimePath mp = MimePath.parse("text/x-java/text/html"); //NOI18N
    Lookup lookup = MimeLookup.getLookup(mp);
    Class layerObjects[] = {CutAction.class, CopyAction.class, NewAction.class, PasteAction.class};
    testPopupItems(lookup, layerObjects);
}
 
Example #23
Source File: Depr_MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testAntXmlPopup(){
    MimeLookup lookup = MimeLookup.getMimeLookup("text/xml"); //NOI18N
    Class layerObjects[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class};
    testPopupItems(lookup, layerObjects);
    lookup = MimeLookup.getMimeLookup("text/x-ant+xml"); //NOI18N
    Class layerObjects2[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class, FindAction.class};
    testPopupItems(lookup, layerObjects2);
}
 
Example #24
Source File: Depr_MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Issue #61216: MimeLookup should support layer hidding
 */
public void testHidding(){
    MimeLookup lookup = MimeLookup.getMimeLookup("text/xml");
    checkLookupObject(lookup, CopyAction.class, true);
    checkLookupObject(lookup, ReplaceAction.class, true);
    checkLookupObject(lookup, PasteAction.class, false);
    lookup = MimeLookup.getMimeLookup("text/x-ant+xml");
    checkLookupObject(lookup, CutAction.class, true);
    checkLookupObject(lookup, CopyAction.class, false);
    checkLookupObject(lookup, PasteAction.class, true);
    checkLookupObject(lookup, ReplaceAction.class, false);
}
 
Example #25
Source File: ExplorerPanelTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Tests whether the cut, copy (callback) actions are enabled/disabled
 * in the right time, see # */
public void testCutCopyActionsEnabling() throws Exception {
    assertTrue ("Can run only in AWT thread", java.awt.EventQueue.isDispatchThread());

    TestNode enabledNode = new TestNode(true, true, true);
    TestNode disabledNode = new TestNode(false, false, false);

    manager.setRootContext(new TestRoot(
        new Node[] {enabledNode, disabledNode}));

    Action copy = ((ContextAwareAction)SystemAction.get(CopyAction.class)).createContextAwareInstance(context);
    Action cut = ((ContextAwareAction)SystemAction.get(CutAction.class)).createContextAwareInstance(context);

    assertTrue("Copy action has to be disabled", !copy.isEnabled());
    assertTrue("Cut action has to be disabled", !cut.isEnabled());

    manager.setSelectedNodes(new Node[] {enabledNode});
    manager.waitActionsFinished();

    assertTrue("Copy action has to be enabled", copy.isEnabled());
    assertTrue("Cut action has to be enabled", cut.isEnabled());
    
    copy.actionPerformed (new java.awt.event.ActionEvent (this, 0, "waitFinished"));
    assertEquals ("clipboardCopy invoked", 1, enabledNode.countCopy);
    
    cut.actionPerformed (new java.awt.event.ActionEvent (this, 0, "waitFinished"));
    assertEquals ("clipboardCut invoked", 1, enabledNode.countCut);
    

    manager.setSelectedNodes(new Node[] {disabledNode});
    manager.waitActionsFinished();

    assertTrue("Copy action has to be disabled", !copy.isEnabled());
    assertTrue("Cut action has to be disabled", !cut.isEnabled());
}
 
Example #26
Source File: Hk2ItemNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Get the set of actions that are associated with this node.
     * <p/>
     * This set is used to construct the context menu for the node.
     * By default this method delegates to the deprecated getActions
     * or getContextActions method depending on the value of supplied argument.
     * It is supposed to be overridden by subclasses accordingly.
     * <p/>
     * @param context Whether to find actions for context meaning or for
     *                the node itself.
     * @return {@see List} of actions (you may include nulls for separators).
     */
    @Override
    public Action[] getActions(boolean context) {
        List<Action> actions = new ArrayList<Action>();
        if(decorator.isRefreshable()) {
            actions.add(SystemAction.get(RefreshModulesAction.class));
        }
        if(decorator.canDeployTo()) {
//            actions.add(SystemAction.get(DeployDirectoryAction.class));
        }
        if(decorator.canUndeploy()) {
            actions.add(SystemAction.get(UndeployModuleAction.class));
        }
        if(decorator.canEnable()) {
            actions.add(SystemAction.get(EnableModulesAction.class));
        }
        if(decorator.canDisable()) {
            actions.add(SystemAction.get(DisableModulesAction.class));
        }
        if(decorator.canCDIProbeEnable()) {
            actions.add(SystemAction.get(EnableCDIProbeModeAction.class));
        }
        if(decorator.canCDIProbeDisable()) {
            actions.add(SystemAction.get(DisableCDIProbeModeAction.class));
        }
        if(decorator.canUnregister()) {
            actions.add(SystemAction.get(UnregisterResourceAction.class));
        }
        if(decorator.canShowBrowser()) {
            actions.add(SystemAction.get(OpenURLAction.class));
        }
        if(decorator.canTest()) {
            actions.add(SystemAction.get(OpenTestURLAction.class));
        }
        if(decorator.canCopy()) {
            actions.add(SystemAction.get(CopyAction.class));
        }
        if (decorator.canEditDetails()) {
            actions.add(SystemAction.get(EditDetailsAction.class));
        }
        return actions.toArray(new Action[actions.size()]);
    }
 
Example #27
Source File: MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Testing Base level popup items lookup and sorting */
public void testBaseLevelPopups(){
    MimeLookup lookup = MimeLookup.getMimeLookup(""); //NOI18N
    Class layerObjects[] = {CutAction.class, CopyAction.class, PasteAction.class};
    testPopupItems(lookup, layerObjects);
}
 
Example #28
Source File: MMDGraphEditor.java    From netbeans-mmd-plugin with Apache License 2.0 4 votes vote down vote up
private void restoreSystemCCPActions(@Nonnull final JComponent component) {
  final ActionMap actionMap = component.getActionMap();
  actionMap.put(DefaultEditorKit.copyAction, SystemAction.get(CopyAction.class));
  actionMap.put(DefaultEditorKit.cutAction, SystemAction.get(CutAction.class));
  actionMap.put(DefaultEditorKit.pasteAction, SystemAction.get(PasteAction.class));
}
 
Example #29
Source File: Depr_MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Testing MIME level popup items lookup, inheritance and sorting */
public void testMimeLevelPopupsWithStringAndSeparator(){
    MimeLookup lookup = MimeLookup.getMimeLookup("text/x-java").childLookup("text/html").childLookup("text/xml"); //NOI18N
    Class layerObjects[] = {CutAction.class, CopyAction.class, PasteAction.class, ReplaceAction.class, JSeparator.class, String.class};
    testPopupItems(lookup, layerObjects);
}
 
Example #30
Source File: Depr_MimeLookupInheritanceTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Testing MIME level popup items lookup, inheritance and sorting */
public void testMimeLevelPopups(){
    MimeLookup lookup = MimeLookup.getMimeLookup("text/x-java").childLookup("text/html"); //NOI18N
    Class layerObjects[] = {CutAction.class, CopyAction.class, NewAction.class, PasteAction.class};
    testPopupItems(lookup, layerObjects);
}