Skip to content

Commit

Permalink
CODENVY-425: do not show terminal in factory workspaces, use newTermi…
Browse files Browse the repository at this point in the history
…nal action instead. (#1128)

Signed-off-by: Max Shaposhnik <[email protected]>
  • Loading branch information
mshaposhnik authored and Roman Iuvshin committed Apr 27, 2016
1 parent e88fc75 commit b272065
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.action.DefaultActionGroup;
import org.eclipse.che.ide.api.action.IdeActions;
import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.constraints.Constraints;
import org.eclipse.che.ide.api.extension.Extension;
import org.eclipse.che.ide.api.icon.Icon;
Expand Down Expand Up @@ -81,6 +82,7 @@ public class MachineExtension {
public MachineExtension(MachineResources machineResources,
final EventBus eventBus,
final WorkspaceAgent workspaceAgent,
final AppContext appContext,
final ConsolesPanelPresenter consolesPanelPresenter,
final Provider<ServerPortProvider> machinePortProvider,
final OutputsContainerPresenter outputsContainerPresenter,
Expand All @@ -94,11 +96,12 @@ public MachineExtension(MachineResources machineResources,
public void onWsAgentStarted(WsAgentStateEvent event) {
machinePortProvider.get();
perspectiveManager.setPerspectiveId(PROJECT_PERSPECTIVE_ID);

workspaceAgent.openPart(outputsContainerPresenter, PartStackType.INFORMATION);
workspaceAgent.openPart(consolesPanelPresenter, PartStackType.INFORMATION);

consolesPanelPresenter.newTerminal();
if (appContext.getFactory() == null) {
consolesPanelPresenter.newTerminal();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ protected void validateProjectActions(Factory factory) throws BadRequestExceptio

for (Action applicationAction : applicationActions) {
String id = applicationAction.getId();
if ("openFile".equals(id) || "findReplace".equals(id) || "runCommand".equals(id)) {
if ("openFile".equals(id) || "findReplace".equals(id) || "runCommand".equals(id) || "newTerminal".equals(id)) {
throw new BadRequestException(format(FactoryConstants.INVALID_ACTION_SECTION, id));
}
}
Expand Down

0 comments on commit b272065

Please sign in to comment.