Java Code Examples for org.netbeans.spi.project.ActionProvider#COMMAND_RUN_SINGLE

The following examples show how to use org.netbeans.spi.project.ActionProvider#COMMAND_RUN_SINGLE . 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: AbstractOutputHandler.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private boolean isProtectedWait(Project proj, RunConfig config) {
    String action = config.getActionName();
    if(action == null || proj == null || !RunUtils.isCompileOnSaveEnabled(proj)) {
        return false;
    }
    switch(action) {
        case ActionProvider.COMMAND_RUN: 
        case ActionProvider.COMMAND_RUN_SINGLE:
        case ActionProvider.COMMAND_DEBUG:
        case ActionProvider.COMMAND_DEBUG_SINGLE:
        case ActionProviderImpl.COMMAND_DEBUG_MAIN:
        case ActionProviderImpl.COMMAND_RUN_MAIN:
            return true;
        default:
            return false;
    }
}
 
Example 2
Source File: BrowserCommand.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private boolean isFileCommand() {
    switch (commandId) {
        case ActionProvider.COMMAND_RUN_SINGLE:
        case ActionProvider.COMMAND_DEBUG_SINGLE:
            return true;
        default:
            return false;
    }
}
 
Example 3
Source File: Actions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static Action runSingle() {
    Action a = new FileAction(
        ActionProvider.COMMAND_RUN_SINGLE,
        NbBundle.getMessage(Actions.class, "LBL_RunSingleAction_Name"),
        null,
        null);
    a.putValue("iconBase","org/netbeans/modules/project/ui/resources/runSingle.png"); //NOI18N
    a.putValue("noIconInMenu", true); //NOI18N
    return a;
}
 
Example 4
Source File: HintsActionProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public String[] getSupportedActions() {
    return new String[]{ActionProvider.COMMAND_RUN_SINGLE};
}
 
Example 5
Source File: JavaActionProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NonNull
public ScriptAction createDefaultScriptAction(
        @NonNull final String command,
        final boolean javaModelSensitive,
        final boolean scanSensitive,
        final boolean enabledInCoS,
        @NonNull final Supplier<? extends String[]> targets,
        @NullAllowed final CustomFileExecutor customFileExecutor) {
    Parameters.notNull("command", command);         //NOI18N
    Parameters.notNull("targets", targets);         //NOI18N
    switch (command) {
        case ActionProvider.COMMAND_CLEAN:
            return createNonCosAction(command, false, javaModelSensitive, scanSensitive, enabledInCoS, targets, Collections.emptyMap());
        case ActionProvider.COMMAND_REBUILD:
            return createNonCosAction(command, true, javaModelSensitive, scanSensitive, enabledInCoS, targets, Collections.emptyMap());
        case ActionProvider.COMMAND_BUILD:
            return createBuildAction(javaModelSensitive, scanSensitive, enabledInCoS, targets, mfs);
        case ActionProvider.COMMAND_RUN:
        case ActionProvider.COMMAND_DEBUG:
        case ActionProvider.COMMAND_DEBUG_STEP_INTO:
        case ActionProvider.COMMAND_PROFILE:
            return createRunAction(command, javaModelSensitive, scanSensitive, enabledInCoS, targets, mfs, mainClassServices);
        case ActionProvider.COMMAND_TEST:
            return createNonCosAction(command, true, javaModelSensitive, scanSensitive, enabledInCoS, targets, Collections.singletonMap("ignore.failing.tests", "true"));  //NOI18N);
        case ActionProvider.COMMAND_COMPILE_SINGLE:
            return createCompileSingleAction(javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        case ActionProvider.COMMAND_RUN_SINGLE:
        case ActionProvider.COMMAND_DEBUG_SINGLE:
        case ActionProvider.COMMAND_PROFILE_SINGLE:
            return createRunSingleAction(
                    command, javaModelSensitive, scanSensitive, enabledInCoS,
                    sourceRoots, testRoots, targets, customFileExecutor);
        case ActionProvider.COMMAND_TEST_SINGLE:
            return createTestSingleAction(javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        case ActionProvider.COMMAND_DEBUG_TEST_SINGLE:
        case ActionProvider.COMMAND_PROFILE_TEST_SINGLE:
            return createDebugTestSingleAction(command, javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        case SingleMethod.COMMAND_RUN_SINGLE_METHOD:
        case SingleMethod.COMMAND_DEBUG_SINGLE_METHOD:
            return createRunSingleMethodAction(command, javaModelSensitive, scanSensitive, enabledInCoS, testRoots, targets);
        case JavaProjectConstants.COMMAND_DEBUG_FIX:
            return createDebugFixAction(command, javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        default:
            throw new UnsupportedOperationException(String.format("Unsupported command: %s", command)); //NOI18N
    }
}
 
Example 6
Source File: SingleJavaSourceRunActionProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String[] getSupportedActions() {
    return new String[]{ActionProvider.COMMAND_RUN_SINGLE};
}
 
Example 7
Source File: RunJSAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private RunJSAction(FileObject fo) {
    super(Bundle.RunJSActionName(), fo, ActionProvider.COMMAND_RUN_SINGLE);
}
 
Example 8
Source File: RunFileActionProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override public String[] getSupportedActions() {
    return new String[] {ActionProvider.COMMAND_RUN_SINGLE};
}
 
Example 9
Source File: RunFileCommand.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String getCommandId() {
    return ActionProvider.COMMAND_RUN_SINGLE;
}
 
Example 10
Source File: ActionProviderImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NbBundle.Messages({
    "# {0} - artifactId", "TXT_Run=Run ({0})",
    "# {0} - artifactId", "TXT_Debug=Debug ({0})",
    "# {0} - artifactId", "TXT_ApplyCodeChanges=Apply Code Changes ({0})",
    "# {0} - artifactId", "TXT_Profile=Profile ({0})",
    "# {0} - artifactId", "TXT_Test=Test ({0})",
    "# {0} - artifactId", "TXT_Build=Build ({0})",
    "# {0} - artifactId", "TXT_Delete=Delete ({0})",
})

static String taskName(Project project, String action, Lookup lkp) {
    String title;
    DataObject dobj = lkp.lookup(DataObject.class);
    String dobjName = dobj != null ? dobj.getName() : "";
    Project prj = project != null ? project : lkp.lookup(Project.class);
    String prjLabel = prj != null ? ProjectUtils.getInformation(prj).getDisplayName() : "No Project on Lookup"; //NOI18N
    switch (action) {
        case ActionProvider.COMMAND_RUN:
            title = TXT_Run(prjLabel);
            break;
        case ActionProvider.COMMAND_DEBUG:
            title = TXT_Debug(prjLabel);
            break;
        case ActionProvider.COMMAND_DELETE:
            title = TXT_Delete(prjLabel);
            break;
        case ActionProvider.COMMAND_PROFILE:
            title = TXT_Profile(prjLabel);
            break;
        case ActionProvider.COMMAND_TEST:
            title = TXT_Test(prjLabel);
            break;
        case ActionProvider.COMMAND_RUN_SINGLE:
            title = TXT_Run(dobjName);
            break;
        case ActionProvider.COMMAND_DEBUG_SINGLE:
        case ActionProvider.COMMAND_DEBUG_TEST_SINGLE:
            title = TXT_Debug(dobjName);
            break;
        case ActionProvider.COMMAND_PROFILE_SINGLE:
        case ActionProvider.COMMAND_PROFILE_TEST_SINGLE:
            title = TXT_Profile(dobjName);
            break;
        case ActionProvider.COMMAND_TEST_SINGLE:
            title = TXT_Test(dobjName);
            break;
        case "debug.fix":
            title = TXT_ApplyCodeChanges(prjLabel);
            break;
        default:
            title = TXT_Build(prjLabel);
    }
    return title;
}
 
Example 11
Source File: RunFileActionProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public String[] getSupportedActions() {
    return new String[] {ActionProvider.COMMAND_RUN_SINGLE, ActionProvider.COMMAND_DEBUG_SINGLE};
}
 
Example 12
Source File: RunSQLAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public String[] getSupportedActions() {
    return new String[] { ActionProvider.COMMAND_RUN_SINGLE };
}