Search in sources :

Example 1 with StartUpAction

use of org.eclipse.che.ide.api.app.StartUpAction in project che by eclipse.

the class StartUpActionsParserTest method test2.

@Test
public void test2() {
    final StartUpAction startUpAction = StartUpActionsParser.parseActionQuery("createProject:projectName;projectType");
    assertEquals("createProject", startUpAction.getActionId());
    assertNotNull(startUpAction.getParameters());
    assertEquals(2, startUpAction.getParameters().size());
    assertTrue(startUpAction.getParameters().containsKey("projectName"));
    assertTrue(startUpAction.getParameters().containsKey("projectType"));
    assertNull(startUpAction.getParameters().get("projectName"));
    assertNull(startUpAction.getParameters().get("projectType"));
}
Also used : StartUpAction(org.eclipse.che.ide.api.app.StartUpAction) Test(org.junit.Test)

Example 2 with StartUpAction

use of org.eclipse.che.ide.api.app.StartUpAction in project che by eclipse.

the class StartUpActionsParserTest method test.

@Test
public void test() {
    final StartUpAction startUpAction = StartUpActionsParser.parseActionQuery("createProject:projectName=test;projectType=maven");
    assertEquals("createProject", startUpAction.getActionId());
    assertNotNull(startUpAction.getParameters());
    assertEquals(2, startUpAction.getParameters().size());
    assertTrue(startUpAction.getParameters().containsKey("projectName"));
    assertTrue(startUpAction.getParameters().containsKey("projectType"));
    assertNotNull(startUpAction.getParameters().get("projectName"));
    assertNotNull(startUpAction.getParameters().get("projectType"));
    assertEquals("test", startUpAction.getParameters().get("projectName"));
    assertEquals("maven", startUpAction.getParameters().get("projectType"));
}
Also used : StartUpAction(org.eclipse.che.ide.api.app.StartUpAction) Test(org.junit.Test)

Example 3 with StartUpAction

use of org.eclipse.che.ide.api.app.StartUpAction in project che by eclipse.

the class StartUpActionsParserTest method test3.

@Test
public void test3() {
    final StartUpAction startUpAction = StartUpActionsParser.parseActionQuery("createProject");
    assertEquals("createProject", startUpAction.getActionId());
    assertNull(startUpAction.getParameters());
}
Also used : StartUpAction(org.eclipse.che.ide.api.app.StartUpAction) Test(org.junit.Test)

Example 4 with StartUpAction

use of org.eclipse.che.ide.api.app.StartUpAction in project che by eclipse.

the class StartUpActionsParser method getStartUpActions.

public static List<StartUpAction> getStartUpActions() {
    final Map<String, List<String>> parameterMap = Window.Location.getParameterMap();
    List<StartUpAction> startUpActions = new ArrayList<>();
    if (!parameterMap.isEmpty() && parameterMap.containsKey("action")) {
        final List<String> actions = parameterMap.get("action");
        for (String action : actions) {
            final StartUpAction startUpAction = parseActionQuery(action);
            startUpActions.add(startUpAction);
        }
    }
    return startUpActions;
}
Also used : ArrayList(java.util.ArrayList) StartUpAction(org.eclipse.che.ide.api.app.StartUpAction) List(java.util.List) ArrayList(java.util.ArrayList)

Example 5 with StartUpAction

use of org.eclipse.che.ide.api.app.StartUpAction in project che by eclipse.

the class StartUpActionsProcessor method start.

@Override
public void start(Callback<WsAgentComponent, Exception> callback) {
    final List<StartUpAction> startAppActions = appContext.getStartAppActions();
    if (startAppActions != null && !startAppActions.isEmpty()) {
        for (StartUpAction action : startAppActions) {
            actionManager.performAction(action.getActionId(), action.getParameters());
        }
    }
    callback.onSuccess(this);
}
Also used : StartUpAction(org.eclipse.che.ide.api.app.StartUpAction)

Aggregations

StartUpAction (org.eclipse.che.ide.api.app.StartUpAction)5 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)1 List (java.util.List)1