本文整理汇总了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),
};
}
示例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());
}
示例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)
};
}
示例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;
}
示例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()]);
}
示例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;
}
示例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),
};
}
示例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),
};
}
示例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();
}
示例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());
}
示例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)
};
}
示例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));
}
};
}
示例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));
}
示例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;
}
示例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()]);
}