本文整理汇总了Java中org.netbeans.spi.project.ui.support.CommonProjectActions类的典型用法代码示例。如果您正苦于以下问题:Java CommonProjectActions类的具体用法?Java CommonProjectActions怎么用?Java CommonProjectActions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CommonProjectActions类属于org.netbeans.spi.project.ui.support包,在下文中一共展示了CommonProjectActions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
private static void close(final Project prj) {
Mutex.EVENT.readAccess(new Mutex.Action<Object>() {
public Object run() {
LifecycleManager.getDefault().saveAll();
Action closeAction = CommonProjectActions.closeProjectAction();
closeAction = closeAction instanceof ContextAwareAction ? ((ContextAwareAction) closeAction).createContextAwareInstance(Lookups.fixed(new Object[] {prj})) : null;
if (closeAction != null && closeAction.isEnabled()) {
closeAction.actionPerformed(new ActionEvent(prj, -1, "")); // NOI18N
} else {
//fallback:
OpenProjects.getDefault().close(new Project[] {prj});
}
return null;
}
});
}
示例2: testOperationActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
public void testOperationActions() throws Exception { // #72397
final NbModuleProject project = generateStandaloneModule("module");
cgpi.setProject(project);
DialogDisplayerImpl dd = (DialogDisplayerImpl) Lookup.getDefault().lookup(DialogDisplayer.class);
FileObject lock = FileUtil.createData(project.getProjectDirectory(), "build/testuserdir/lock");
RandomAccessFile raf = new RandomAccessFile(FileUtil.toFile(lock), "rw");
FileLock lck = raf.getChannel().lock();
EventQueue.invokeAndWait(new Runnable() {
@Override public void run() {
((ContextAwareAction) CommonProjectActions.deleteProjectAction()).createContextAwareInstance(Lookups.singleton(project)).actionPerformed(null);
}
});
assertNotNull("warning message emitted", dd.getLastNotifyDescriptor());
assertEquals("warning message emitted", dd.getLastNotifyDescriptor().getMessage(),
Bundle.ERR_ModuleIsBeingRun());
dd.reset();
lck.release();
raf.close();
lock.delete();
EventQueue.invokeAndWait(new Runnable() {
@Override public void run() {
CommonProjectActions.deleteProjectAction().actionPerformed(null);
}
});
assertNull("no warning message", dd.getLastNotifyDescriptor());
}
示例3: getActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@Override
@Messages({"BTN_Generate_Site=Generate Site", "BTN_Deploy_Site=Deploy Site"})
public javax.swing.Action[] getActions(boolean param) {
if (isTopLevelNode) {
Action[] toReturn = new Action[4];
toReturn[0] = CommonProjectActions.newFileAction();
toReturn[1] = null;
NetbeansActionMapping mapp = new NetbeansActionMapping();
mapp.addGoal("site"); //NOI18N
toReturn[2] = ActionProviderImpl.createCustomMavenAction(BTN_Generate_Site(), mapp, true, Lookup.EMPTY, project);
mapp = new NetbeansActionMapping();
mapp.addGoal("site:deploy"); //NOI18N
toReturn[3] = ActionProviderImpl.createCustomMavenAction(BTN_Deploy_Site(), mapp, false, Lookup.EMPTY, project);
return toReturn;
} else {
return super.getActions(param);
}
}
示例4: instantiate
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@Override
@Messages({"PRG_Dir=Creating directory", "PRG_FINISH=Finishing..."})
public Set<FileObject> instantiate (ProgressHandle handle) throws IOException {
handle.start();
try {
handle.progress(Bundle.PRG_Dir());
ProjectInfo vi = new ProjectInfo((String) wiz.getProperty("groupId"), (String) wiz.getProperty("artifactId"), (String) wiz.getProperty("version"), (String) wiz.getProperty("package")); //NOI18N
String[] splitlog = StringUtils.split(log, ":");
ArchetypeWizardUtils.logUsage(splitlog[0], splitlog[1], splitlog[2]);
File projFile = FileUtil.normalizeFile((File) wiz.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER)); // NOI18N
CreateProjectBuilder builder = createBuilder(projFile, vi, handle);
builder.create();
handle.progress(Bundle.PRG_FINISH());
return ArchetypeWizardUtils.openProjects(projFile, null);
} finally {
handle.finish();
}
}
示例5: getActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@NonNull
@Override
public Action[] getActions(final boolean context) {
if (context) {
return super.getActions(context);
} else {
if (actions == null) {
actions = new Action[] {
CommonProjectActions.newFileAction(),
null,
SystemAction.get(FindAction.class),
null,
SystemAction.get(PasteAction.class ),
null,
SystemAction.get(FileSystemAction.class ),
null,
SystemAction.get(ToolsAction.class )
};
}
return actions;
}
}
示例6: getActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
/**
* Get the set of actions of this node. This set is used to construct the context menu for the node.
*
* @param context - whether to find actions for context meaning or for the node itself.
* @return A list of valid actions for a Salesforce project.
*/
@Override
public Action[] getActions(boolean context) {
List<Action> actions = new ArrayList<>();
actions.add(CommonProjectActions.newFileAction());
actions.add(CommonProjectActions.deleteProjectAction());
actions.add(CommonProjectActions.customizeProjectAction());
actions.add(CommonProjectActions.closeProjectAction());
actions.add(null);
actions.addAll(Utilities.actionsForPath("Projects/Actions"));
actions.add(null);
actions.add(SystemAction.get(DownloadProjectAction.class));
actions.add(SystemAction.get(UploadUpdatedFilesAction.class));
actions.add(SystemAction.get(DeployProjectAction.class));
Action[] actionsToReturn = actions.toArray(new Action[]{});
return actionsToReturn;
}
示例7: getActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
Collection<? extends ProjectActionsPathProvider> addonPaths =
project.getLookup().lookupAll(ProjectActionsPathProvider.class);
String[] layerPaths = new String[]{
BMProject.getLayerProjectActionsPath(project.getType()),
BMProject.getLayerProjectActionsPath(BMProject.TYPE_ANY)
};
layerPaths = BMProjectUtils.aggregateLayerPaths(addonPaths, layerPaths);
Action[] defaultProjectActions = new Action[]{
// CommonProjectActions.newFileAction(),
CommonProjectActions.renameProjectAction(),
CommonProjectActions.deleteProjectAction(),
CommonProjectActions.closeProjectAction(),
CommonProjectActions.customizeProjectAction(),
};
Action[] actions = NodeSubmenuUtils.createActions(context, defaultProjectActions, layerPaths);
return actions;
}
示例8: getActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@Override
public Action[] getActions(boolean arg0) {
Action[] nodeActions = {
CommonProjectActions.newFileAction(),
null,
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, Bundle.LBL_BuildAction_Name(), null),
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, Bundle.LBL_CleanBuildAction_Name(), null),
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, Bundle.LBL_CleanAction_Name(), null),
null,
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_RUN, Bundle.LBL_RunAction_Name(), null),
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, Bundle.LBL_DebugAction_Name(), null),
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_PROFILE, Bundle.LBL_ProfileAction_Name(), null),
ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_TEST, Bundle.LBL_TestAction_Name(), null),
null,
CommonProjectActions.copyProjectAction(),
CommonProjectActions.deleteProjectAction(),
CommonProjectActions.setAsMainProjectAction(),
CommonProjectActions.closeProjectAction(),
};
return nodeActions;
}
示例9: createRootNodeActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
/**
* Creates actions for package root.
* @return the array of {@link Action}s
*/
@NonNull
static Action[] createRootNodeActions() {
return new Action[] {
CommonProjectActions.newFileAction(),
null,
SystemAction.get( FindAction.class ),
null,
SystemAction.get( PasteAction.class ),
null,
SystemAction.get( FileSystemAction.class ),
null,
SystemAction.get( ToolsAction.class ),
};
}
示例10: createNewProject
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@Override
public void createNewProject(File workingDir) {
Action newProjectAction = CommonProjectActions.newProjectAction();
if (newProjectAction != null) {
ProjectChooser.setProjectsFolder(workingDir);
newProjectAction.actionPerformed(new ActionEvent(this,
ActionEvent.ACTION_PERFORMED, "command")); // NOI18N
}
}
示例11: packageMenu
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.suite.package")
@ActionRegistration(displayName="#SUITE_ACTION_package_menu", lazy=false)
@ActionReference(path=SUITE_ACTIONS_PATH, position=600)
@Messages("SUITE_ACTION_package_menu=Package as")
public static Action packageMenu() {
return new SubMenuAction(SUITE_ACTION_package_menu(), Arrays.asList(CommonProjectActions.forType(SUITE_PACKAGE_ACTIONS_TYPE)));
}
示例12: jnlpMenu
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.suite.jnlpMenu")
@ActionRegistration(displayName="#SUITE_ACTION_jnlp_menu", lazy=false)
@ActionReference(path=SUITE_ACTIONS_PATH, position=1300)
@Messages("SUITE_ACTION_jnlp_menu=JNLP")
public static Action jnlpMenu() {
return new SubMenuAction(SUITE_ACTION_jnlp_menu(), Arrays.asList(CommonProjectActions.forType(SUITE_JNLP_ACTIONS_TYPE)));
}
示例13: osgiMenu
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.suite.osgiMenu")
@ActionRegistration(displayName="#SUITE_ACTION_osgi_menu", lazy=false)
@ActionReference(path=SUITE_ACTIONS_PATH, position=1400)
@Messages("SUITE_ACTION_osgi_menu=OSGi")
public static Action osgiMenu() {
return new SubMenuAction(SUITE_ACTION_osgi_menu(), Arrays.asList(CommonProjectActions.forType(SUITE_OSGI_ACTIONS_TYPE)));
}
示例14: transientActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@NonNull
private Action[] transientActions() {
Action[] res = actions;
if (res == null) {
res = actions = new Action[] {
CommonProjectActions.closeProjectAction()
};
}
return res;
}
示例15: getActions
import org.netbeans.spi.project.ui.support.CommonProjectActions; //导入依赖的package包/类
@Override
public Action[] getActions(boolean context) {
OpenProjectList.preferredProject(LazyProject.this);
return new Action[] {
SystemAction.get(LazyProjectInitializing.class),
CommonProjectActions.closeProjectAction()
};
}