Skip to content

Commit

Permalink
Improved Workspace status panel (#7998)
Browse files Browse the repository at this point in the history
* Squashed commit of the following:

commit 783d12f
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 20 17:30:49 2017 +0200

    Add missing loading pieces

commit 41288b8
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 20 16:13:09 2017 +0200

    Add missing loading pieces

commit 7cdadf8
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Tue Dec 19 15:38:03 2017 +0200

    Add missing loading pieces

commit 79b88c7
Merge: 33a9af0 ec91a22
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Tue Dec 19 15:16:06 2017 +0200

    Merge branch 'che6' into CHE-7330

commit 33a9af0
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Tue Dec 19 15:15:11 2017 +0200

    Add missing loading pieces

commit c032500
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Tue Dec 19 11:25:20 2017 +0200

    Add missing loading pieces

commit b8ad09f
Merge: 16936f5 ec0edba
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Mon Dec 18 09:46:12 2017 +0200

    Merge branch 'che6' into CHE-7330

commit 16936f5
Merge: b9aad88 419824c
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 13 16:54:35 2017 +0200

    Merge branch 'che6' into CHE-7330

commit b9aad88
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 13 16:50:23 2017 +0200

    Add missing loading pieces

commit aa25599
Merge: 3262c44 9af677e
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 13 13:01:38 2017 +0200

    Merge branch 'CHE-7330' of github.com:eclipse/che into CHE-7330

commit 3262c44
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 13 13:00:32 2017 +0200

    Add missing loading pieces

commit 9af677e
Author: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
Date:   Sat Dec 9 19:05:46 2017 +0200

    Add an ability to hide machines output tabs

    Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>

commit a9ccd73
Author: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
Date:   Fri Dec 8 11:39:02 2017 +0200

    Add event to display output event by machine name (#7782)

    Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>

commit f051d59
Merge: fb4f8c0 4ca92c9
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Thu Dec 7 09:32:14 2017 +0200

    Merge branch 'che6' into CHE-7330

commit fb4f8c0
Author: Vitaliy Guliy <vguliy@codenvy.com>
Date:   Wed Dec 6 17:22:15 2017 +0200

    Add missing loading pieces

* Add missing loading pieces

* Add missing loading pieces

* Add missing loading pieces

* Add missing loading pieces

* Add missing loading pieces

* Move MachineStatusChangedEvent to che-core-ide-app from ide-api

* Fix formatting

* Rename 'serverDefined' on 'serverRunning'

* Revert script for test language server.
  • Loading branch information
Vitaliy Guliy committed Dec 27, 2017
1 parent 98bc582 commit 467e45b
Show file tree
Hide file tree
Showing 37 changed files with 1,721 additions and 807 deletions.
Expand Up @@ -161,6 +161,8 @@ protected void configure() {
.asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.ServerStatusJsonRpcMessenger.class)
.asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.InstallerStatusJsonRpcMessenger.class)
.asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.InstallerLogJsonRpcMessenger.class)
.asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.MachineLogJsonRpcMessenger.class)
Expand Down
Expand Up @@ -47,11 +47,6 @@ public List<String> identifyType(final VirtualFile file) {
}

public void registerNewExtension(String extension, List<String> contentTypes) {
if (mappings.containsKey(extension)) {
Log.warn(
ExtensionFileTypeIdentifier.class,
"Replacing content types for extension '" + extension + "'.");
}
mappings.put(extension, contentTypes);
}

Expand Down
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2012-2017 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.ide.api.workspace.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

/** Fired when installer in some machine goes into a failed state. */
public class InstallerFailedEvent extends GwtEvent<InstallerFailedEvent.Handler> {

public static final Type<InstallerFailedEvent.Handler> TYPE = new Type<>();

private final String installer;
private final String error;
private final String machineName;

public InstallerFailedEvent(String installer, String error, String machineName) {
this.installer = installer;
this.error = error;
this.machineName = machineName;
}

/** Returns the installer identifier. */
public String getInstaller() {
return installer;
}

/** Returns the error message. */
public String getError() {
return error;
}

/** Returns the related machine's name. */
public String getMachineName() {
return machineName;
}

@Override
public Type<Handler> getAssociatedType() {
return TYPE;
}

@Override
protected void dispatch(Handler handler) {
handler.onInstallerFailed(this);
}

public interface Handler extends EventHandler {
void onInstallerFailed(InstallerFailedEvent event);
}
}
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2012-2017 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.ide.api.workspace.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

/** Fired when installer in some machine goes into a running state. */
public class InstallerRunningEvent extends GwtEvent<InstallerRunningEvent.Handler> {

public static final Type<InstallerRunningEvent.Handler> TYPE = new Type<>();

private final String installer;
private final String machineName;
private final boolean serverRunning;

public InstallerRunningEvent(String installer, String machineName, boolean serverRunning) {
this.installer = installer;
this.machineName = machineName;
this.serverRunning = serverRunning;
}

/** Returns the installer identifier. */
public String getInstaller() {
return installer;
}

/** Returns the related machine's name. */
public String getMachineName() {
return machineName;
}

/** Returns true if corresponding server is defined and running. */
public boolean isServerRunning() {
return serverRunning;
}

@Override
public Type<Handler> getAssociatedType() {
return TYPE;
}

@Override
protected void dispatch(Handler handler) {
handler.onInstallerRunning(this);
}

public interface Handler extends EventHandler {
void onInstallerRunning(InstallerRunningEvent event);
}
}
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2012-2017 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.ide.api.workspace.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

/** Fired when installer in some machine goes into a starting state. */
public class InstallerStartingEvent extends GwtEvent<InstallerStartingEvent.Handler> {

public static final Type<InstallerStartingEvent.Handler> TYPE = new Type<>();

private final String installer;
private final String machineName;

public InstallerStartingEvent(String installer, String machineName) {
this.installer = installer;
this.machineName = machineName;
}

/** Returns the installer identifier. */
public String getInstaller() {
return installer;
}

/** Returns the related machine's name. */
public String getMachineName() {
return machineName;
}

@Override
public Type<Handler> getAssociatedType() {
return TYPE;
}

@Override
protected void dispatch(Handler handler) {
handler.onInstallerStarting(this);
}

public interface Handler extends EventHandler {
void onInstallerStarting(InstallerStartingEvent event);
}
}
Expand Up @@ -690,6 +690,9 @@ public interface CoreLocalizationConstant extends Messages {
@Key("workspace.not.running")
String workspaceNotRunning();

@Key("workspace.status.title")
String workspaceStatusTitle();

@Key("start.ws.error.title")
String startWsErrorTitle();

Expand Down Expand Up @@ -1208,6 +1211,12 @@ String sshConnectInfo(
@Key("control.terminal.create.description")
String newTerminalDescription();

@Key("machine.output.action.title")
String machineOutputActionTitle();

@Key("machine.output.action.description")
String machineOutputActionDescription();

@Key("control.connect.ssh")
String connectViaSSH();

Expand Down
Expand Up @@ -206,6 +206,9 @@ public interface Resources
@Source("panel/panel-selector-right.svg")
SVGResource panelSelectorRight();

@Source("machine/machine-cube.svg")
SVGResource machineCube();

@Source("searchMatch.svg")
SVGResource searchMatch();

Expand Down
Expand Up @@ -73,7 +73,13 @@ interface ToolbarCSS extends CssResource {

String processesListExecLabel();

String processesListLoadLabel();
String processesListLoader();

String processesListLoaderBar1();

String processesListLoaderBar2();

String processesListLoaderBar3();

String processWidgetText();

Expand Down
Expand Up @@ -32,6 +32,7 @@ public class ProcessesListViewImpl implements ProcessesListView {
private final Map<Process, ProcessItemRenderer> renderers;
private final FlowPanel rootPanel;
private final DropdownList dropdownList;
private final CommandResources resources;
private final EmptyListWidget emptyListWidget;
private final ToolbarMessages messages;
private final CreateCommandItem createCommandItem;
Expand All @@ -40,7 +41,7 @@ public class ProcessesListViewImpl implements ProcessesListView {
private ActionDelegate delegate;

private final Label execLabel;
private final Label loadLabel;
private final FlowPanel loadAnimation;

private FlowPanel loadInfo;
private FlowPanel loadingLabel;
Expand All @@ -49,6 +50,7 @@ public class ProcessesListViewImpl implements ProcessesListView {
@Inject
public ProcessesListViewImpl(
CommandResources resources, EmptyListWidget emptyListWidget, ToolbarMessages messages) {
this.resources = resources;
this.emptyListWidget = emptyListWidget;
this.messages = messages;

Expand All @@ -58,8 +60,7 @@ public ProcessesListViewImpl(
execLabel = new Label("EXEC");
execLabel.addStyleName(resources.commandToolbarCss().processesListExecLabel());

loadLabel = new Label("LOAD");
loadLabel.addStyleName(resources.commandToolbarCss().processesListLoadLabel());
loadAnimation = getAnimationWidget();

dropdownList = new DropdownList(emptyListWidget, true);
dropdownList.setWidth("100%");
Expand All @@ -79,7 +80,7 @@ public ProcessesListViewImpl(

rootPanel = new FlowPanel();
rootPanel.add(execLabel);
rootPanel.add(loadLabel);
rootPanel.add(loadAnimation);
rootPanel.add(dropdownList);

createCommandItem = new CreateCommandItem();
Expand All @@ -99,12 +100,36 @@ public ProcessesListViewImpl(
loadInfo.add(loadingProgress);
}

/**
* Creates an animation widget containing three animated vertical bars.
*
* @return animation widget
*/
private FlowPanel getAnimationWidget() {
FlowPanel animation = new FlowPanel();
animation.addStyleName(resources.commandToolbarCss().processesListLoader());

FlowPanel bar1 = new FlowPanel();
bar1.addStyleName(resources.commandToolbarCss().processesListLoaderBar1());
animation.add(bar1);

FlowPanel bar2 = new FlowPanel();
bar2.addStyleName(resources.commandToolbarCss().processesListLoaderBar2());
animation.add(bar2);

FlowPanel bar3 = new FlowPanel();
bar3.addStyleName(resources.commandToolbarCss().processesListLoaderBar3());
animation.add(bar3);

return animation;
}

@Override
public void setLoadMode() {
execLabel.getElement().getStyle().setDisplay(Style.Display.NONE);
dropdownList.getElement().getStyle().setDisplay(Style.Display.NONE);

loadLabel.getElement().getStyle().setDisplay(Style.Display.BLOCK);
loadAnimation.getElement().getStyle().setDisplay(Style.Display.BLOCK);
loadInfo.getElement().getStyle().setDisplay(Style.Display.INLINE_BLOCK);
}

Expand All @@ -113,7 +138,7 @@ public void setExecMode() {
execLabel.getElement().getStyle().clearDisplay();
dropdownList.getElement().getStyle().clearDisplay();

loadLabel.getElement().getStyle().clearDisplay();
loadAnimation.getElement().getStyle().clearDisplay();
loadInfo.getElement().getStyle().clearDisplay();
}

Expand Down
Expand Up @@ -181,7 +181,6 @@

.consoleLines[wrap] > pre {
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
}

Expand Down
Expand Up @@ -141,8 +141,10 @@
import org.eclipse.che.ide.part.explorer.project.synchronize.ProjectConfigSynchronized;
import org.eclipse.che.ide.processes.NewTerminalAction;
import org.eclipse.che.ide.processes.actions.CloseConsoleAction;
import org.eclipse.che.ide.processes.actions.DisplayMachineOutputAction;
import org.eclipse.che.ide.processes.actions.ReRunProcessAction;
import org.eclipse.che.ide.processes.actions.StopProcessAction;
import org.eclipse.che.ide.processes.loading.ShowWorkspaceStatusAction;
import org.eclipse.che.ide.resources.action.CopyResourceAction;
import org.eclipse.che.ide.resources.action.CutResourceAction;
import org.eclipse.che.ide.resources.action.PasteResourceAction;
Expand Down Expand Up @@ -345,6 +347,8 @@ public interface ParserResource extends ClientBundle {

@Inject private StopWorkspaceAction stopWorkspaceAction;

@Inject private ShowWorkspaceStatusAction showWorkspaceStatusAction;

@Inject private RunCommandAction runCommandAction;

@Inject private NewTerminalAction newTerminalAction;
Expand All @@ -355,6 +359,8 @@ public interface ParserResource extends ClientBundle {

@Inject private CloseConsoleAction closeConsoleAction;

@Inject private DisplayMachineOutputAction displayMachineOutputAction;

@Inject private ShowConsoleTreeAction showConsoleTreeAction;

@Inject private AddToFileWatcherExcludesAction addToFileWatcherExcludesAction;
Expand Down Expand Up @@ -508,6 +514,7 @@ public void initialize() {

workspaceGroup.addSeparator();
workspaceGroup.add(stopWorkspaceAction);
workspaceGroup.add(showWorkspaceStatusAction);

// Project (New Menu)
DefaultActionGroup projectGroup = (DefaultActionGroup) actionManager.getAction(GROUP_PROJECT);
Expand Down Expand Up @@ -678,6 +685,7 @@ public void initialize() {

// Processes panel actions
actionManager.registerAction("stopWorkspace", stopWorkspaceAction);
actionManager.registerAction("showWorkspaceStatus", showWorkspaceStatusAction);
actionManager.registerAction("runCommand", runCommandAction);
actionManager.registerAction("newTerminal", newTerminalAction);

Expand Down Expand Up @@ -780,6 +788,9 @@ public void initialize() {
consolesTreeContextMenu.add(stopProcessAction);
consolesTreeContextMenu.add(closeConsoleAction);

actionManager.registerAction(DisplayMachineOutputAction.ID, displayMachineOutputAction);
consolesTreeContextMenu.add(displayMachineOutputAction);

// Editor context menu group
DefaultActionGroup editorTabContextMenu =
(DefaultActionGroup) actionManager.getAction(GROUP_EDITOR_TAB_CONTEXT_MENU);
Expand Down

0 comments on commit 467e45b

Please sign in to comment.