当前位置: 首页>>代码示例>>Java>>正文


Java OpenAction类代码示例

本文整理汇总了Java中org.openide.actions.OpenAction的典型用法代码示例。如果您正苦于以下问题:Java OpenAction类的具体用法?Java OpenAction怎么用?Java OpenAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OpenAction类属于org.openide.actions包,在下文中一共展示了OpenAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defaultActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
/** 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),
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:AnnotationProviderTest.java

示例2: testRunImmediatelly

import org.openide.actions.OpenAction; //导入依赖的package包/类
public void testRunImmediatelly() throws Exception {
    String[] names = {
        "folder/"
    };
    FileSystem lfs = TestUtilHid.createLocalFileSystem(getWorkDir(), names);
    FileObject folder = lfs.findResource("folder");
    DataFolder f = DataFolder.findFolder(folder);

    InstanceDataObject.create(f, null, SaveAction.class);

    err.info("Creating InvCheckFolderInstance");
    RunImmediatelly instances = new RunImmediatelly(f);
    err.info("Computing result");
    List computed = (List)instances.instanceCreate();
    assertEquals("One action", 1, computed.size());

    InstanceDataObject.create(f, null, OpenAction.class);
    computed = (List)instances.instanceCreate();
    err.info("Result is here: " + computed);
    assertEquals("Two actions", 2, computed.size());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:FolderInstanceTaskOrderTest.java

示例3: createActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
/** 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)
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:PropertiesLocaleNode.java

示例4: getPossibleActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
@Override
protected Collection getPossibleActions () {
    Collection actions = new Vector(2);
    
    // XXX #48712 heuristics: enable open action only if tree editor installed
    boolean visualEditorInstalled = false;
    Lookup lookup = Lookup.getDefault();
    Lookup.Template t = new Lookup.Template(ModuleInfo.class);
    Iterator it = lookup.lookup(t).allInstances().iterator();
    while (it.hasNext()) {
        ModuleInfo next = (ModuleInfo) it.next();
        if (next.getCodeNameBase().equals("org.netbeans.modules.xml.tree") && next.isEnabled()) {  // NOI18N
            visualEditorInstalled = true;
            break;
        }
    }
    if (visualEditorInstalled) {                
        actions.add (SystemAction.get (OpenAction.class));
    }
    actions.add (SystemAction.get (ViewAction.class));
    return actions;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:XMLViewActions.java

示例5: getActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
@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()]);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VersionNode.java

示例6: isOpenAction

import org.openide.actions.OpenAction; //导入依赖的package包/类
private static boolean isOpenAction(final Action action) {
    if (action == null) {
        return false;
    }
    if (action instanceof OpenAction || action instanceof EditAction) {
        return true;
    }
    if ("org.netbeans.api.actions.Openable".equals(action.getValue("type"))) { //NOI18N
        return true;
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ActionFilterNode.java

示例7: getActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
public Action[] getActions(Phadhail ph, Lookup e) {
    return new Action[] {
        SystemAction.get(OpenAction.class),
        SystemAction.get(SaveAction.class),
        null,
        SystemAction.get(NewAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        SystemAction.get(RenameAction.class),
        //SystemAction.get(ToolsAction.class),
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:PhadhailLook.java

示例8: getActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
public Action[] getActions(boolean context) {
    return new Action[] {
        SystemAction.get(OpenAction.class),
        SystemAction.get(SaveAction.class),
        null,
        SystemAction.get(NewAction.class),
        null,
        SystemAction.get(DeleteAction.class),
        SystemAction.get(RenameAction.class),
        SystemAction.get(ToolsAction.class),
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:PhadhailNode.java

示例9: setUp

import org.openide.actions.OpenAction; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    FileObject fo = FileUtil.createFolder(
        FileUtil.getConfigRoot(),
        "Folder" + getName()
    );
    df = DataFolder.findFolder(fo);
    
    FileObject fileMenu = df.getPrimaryFile().createFolder("File");
    DataFolder fileM = DataFolder.findFolder(fileMenu);
    InstanceDataObject.create(fileM, null, OpenAction.class);
    
    mb = new MenuBar(df);
    mb.waitFinished();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:MenuBarFastFromAWTTest.java

示例10: testReorderingOfExecutionTasksIsOK

import org.openide.actions.OpenAction; //导入依赖的package包/类
@RandomlyFails // NB-Core-Build #3078
public void testReorderingOfExecutionTasksIsOK() throws Exception {
    String[] names = {
        "folder/"
    };
    FileSystem lfs = TestUtilHid.createLocalFileSystem(getWorkDir(), names);
    FileObject folder = lfs.findResource("folder");
    DataFolder f = DataFolder.findFolder(folder);

    InstanceDataObject.create(f, null, SaveAction.class);

    err.info("Creating InvCheckFolderInstance");
    ReorderTasksCheck instances = new ReorderTasksCheck(f);
    err.info("Computing result");
    instances.waitFinished(500);
    assertEquals("One task scheduled", 1, instances.tasks.size());

    InstanceDataObject.create(f, null, OpenAction.class);

    instances.waitFinished(500);
    assertEquals("Two tasks scheduled", 2, instances.tasks.size());

    // run in reverse order
    instances.tasks.get(1).run();
    instances.tasks.get(0).run();

    List computed = (List)instances.instanceCreate();
    err.info("Result is here: " + computed);
    assertEquals("Two actions", 2, computed.size());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:FolderInstanceTaskOrderTest.java

示例11: getActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    return new Action[] {
        SystemAction.get(OpenAction.class),
        SystemAction.get(RenameAction.class),
        SystemAction.get(DeleteAction.class)
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:BookmarkNode.java

示例12: createContextAwareInstance

import org.openide.actions.OpenAction; //导入依赖的package包/类
public Action createContextAwareInstance(Lookup selection) {
    final Project[] projects = selection.lookupAll(Project.class).toArray(new Project[0]);
    return new AbstractAction(SystemAction.get(OpenAction.class).getName()) {
        public void actionPerformed(ActionEvent ev) {
            OpenProjects.getDefault().open(projects, false);
        }
        @Override
        public boolean isEnabled() {
            return !Arrays.asList(OpenProjects.getDefault().getOpenProjects()).containsAll(Arrays.asList(projects));
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:FolderNodeFactory.java

示例13: ImageNode

import org.openide.actions.OpenAction; //导入依赖的package包/类
/** Constructs image node. */
public ImageNode(ImageDataObject obj) {
    super(obj, Children.LEAF);
    //setIconBase(IMAGE_ICON_BASE);
    setIconBaseWithExtension(IMAGE_ICON_BASE);
    setDefaultAction (SystemAction.get (OpenAction.class));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ImageDataObject.java

示例14: getActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    Action[] javaActions = super.getActions(context);
    Action[] formActions = new Action[javaActions.length+2];
    formActions[0] = SystemAction.get(OpenAction.class);
    formActions[1] = SystemAction.get(EditAction.class);
    formActions[2] = null;
    // Skipping the first (e.g. Open) action
    System.arraycopy(javaActions, 1, formActions, 3, javaActions.length-1);
    return formActions;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:FormDataNode.java

示例15: getActions

import org.openide.actions.OpenAction; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
    List<Action> actions = new ArrayList<>();
    actions.add((Action) OpenAction.findObject(OpenAction.class, true));
    actions.addAll(Lookups.forPath(OutlineTopComponent.NODE_ACTIONS_FOLDER).lookupAll(Action.class));
    return actions.toArray(new Action[actions.size()]);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:8,代码来源:CompilationNode.java


注:本文中的org.openide.actions.OpenAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。