use of org.eclipse.che.ide.workspace.DefaultWorkspaceComponent in project che by eclipse.
the class CreateWorkspacePresenter method createWorkspace.
private void createWorkspace() {
WorkspaceConfigDto workspaceConfig = getWorkspaceConfig();
workspaceClient.create(workspaceConfig, null).then(new Operation<WorkspaceDto>() {
@Override
public void apply(WorkspaceDto workspace) throws OperationException {
DefaultWorkspaceComponent component = wsComponentProvider.get();
component.startWorkspace(workspace, callback);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
callback.onFailure(new Exception(arg.getCause()));
}
});
}
use of org.eclipse.che.ide.workspace.DefaultWorkspaceComponent in project che by eclipse.
the class StartWorkspacePresenter method onWorkspaceSelected.
/** {@inheritDoc} */
@Override
public void onWorkspaceSelected(WorkspaceDto workspace) {
selectedWorkspace = workspace;
String wsName = workspace.getConfig().getDefaultEnv();
view.setWsName(wsName);
view.setEnableStartButton(!wsName.isEmpty());
if (RUNNING.equals(workspace.getStatus())) {
DefaultWorkspaceComponent workspaceComponent = wsComponentProvider.get();
workspaceComponent.setCurrentWorkspace(workspace);
workspaceComponent.startWorkspace(workspace, callback);
view.hide();
}
}
use of org.eclipse.che.ide.workspace.DefaultWorkspaceComponent in project che by eclipse.
the class StartWorkspacePresenter method onStartWorkspaceClicked.
/** {@inheritDoc} */
@Override
public void onStartWorkspaceClicked() {
DefaultWorkspaceComponent workspaceComponent = wsComponentProvider.get();
workspaceComponent.startWorkspace(selectedWorkspace, callback);
view.hide();
}
Aggregations