Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
import org.openide.util.NbBundle.Messages;
import org.openide.util.RequestProcessor;
import org.openide.util.Task;
import org.openide.util.TaskListener;
import org.openide.util.lookup.Lookups;

public final class ModuleActions implements ActionProvider, ExecProject {
private static final String RUN_ARGS_IDE = "run.args.ide"; // NOI18N

private static final String COMMAND_NBM = "nbm";
private static final String COMMAND_MAVEN_INSTALL = "maven-install";
private static final String MODULE_ACTIONS_TYPE = "org-netbeans-modules-apisupport-project";
private static final String MODULE_ACTIONS_PATH = "Projects/" + MODULE_ACTIONS_TYPE + "/Actions";

Expand Down Expand Up @@ -132,6 +132,7 @@ public void refresh() {
globalCommands.put(JavaProjectConstants.COMMAND_JAVADOC, new String[] {"javadoc-nb"}); // NOI18N
globalCommands.put(ActionProvider.COMMAND_TEST, new String[] {"test-unit"}); // NOI18N
globalCommands.put(COMMAND_NBM, new String[] {COMMAND_NBM});
globalCommands.put(COMMAND_MAVEN_INSTALL, new String[] {COMMAND_MAVEN_INSTALL});
supportedActionsSet.addAll(globalCommands.keySet());
supportedActionsSet.add(ActionProvider.COMMAND_COMPILE_SINGLE);
supportedActionsSet.add(JavaProjectConstants.COMMAND_DEBUG_FIX); // #47012
Expand All @@ -145,6 +146,9 @@ public void refresh() {
supportedActionsSet.add(SingleMethod.COMMAND_RUN_SINGLE_METHOD);
supportedActionsSet.add(SingleMethod.COMMAND_DEBUG_SINGLE_METHOD);
}
if (project.getModuleType() == NbModuleType.NETBEANS_ORG) {
supportedActionsSet.add(COMMAND_MAVEN_INSTALL);
}
supportedActionsSet.add(ActionProvider.COMMAND_RENAME);
supportedActionsSet.add(ActionProvider.COMMAND_MOVE);
supportedActionsSet.add(ActionProvider.COMMAND_COPY);
Expand All @@ -160,6 +164,7 @@ private static FileObject findBuildXml(NbModuleProject project) {
return project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
}

@Override
public boolean isActionEnabled(String command, Lookup context) {
if (ActionProvider.COMMAND_DELETE.equals(command) ||
ActionProvider.COMMAND_RENAME.equals(command) ||
Expand Down Expand Up @@ -208,6 +213,8 @@ public boolean isActionEnabled(String command, Lookup context) {
}
TestSources testSources = findTestSources(context, false);
return testSources != null && testSources.isSingle();
} else if (command.equals(COMMAND_MAVEN_INSTALL)) {
return project.getModuleType() == NbModuleType.NETBEANS_ORG;
} else {
// other actions are global
return true;
Expand Down Expand Up @@ -939,6 +946,14 @@ public static Action createNbm() {
return ProjectSensitiveActions.projectCommandAction(COMMAND_NBM, ACTION_nbm(), null);
}

@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.mavenInstall")
@ActionRegistration(displayName="#ACTION_maven_install", lazy=false)
@ActionReference(path=MODULE_ACTIONS_PATH, position=1700)
@Messages("ACTION_maven_install=Maven Install")
public static Action createMavenInstall() {
return ProjectSensitiveActions.projectCommandAction(COMMAND_MAVEN_INSTALL, ACTION_maven_install(), null);
}

@ActionID(category="Project", id="org.netbeans.modules.apisupport.project.arch")
@ActionRegistration(displayName="#ACTION_arch", lazy=false)
@ActionReference(path=MODULE_ACTIONS_PATH, position=1900)
Expand Down
2 changes: 1 addition & 1 deletion nbbuild/templates/projectized.xml
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@
<arg value="-DnetbeansNbmDirectory=${maven.tmp.nbms}"/>
<arg value="-DnetbeansSourcesDirectory=${maven.tmp.sources}"/>
<arg value="-DnetbeansJavadocDirectory=${maven.tmp.javadoc}"/>
<arg value="org.apache.netbeans.utilities:nb-repository-plugin:1.5:populate"/>
<arg value="org.apache.netbeans.utilities:nb-repository-plugin:14.5:populate"/>
</exec>
</target>

Expand Down
Loading