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"));
}
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"));
}
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());
}
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;
}
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);
}
Aggregations