From d04af7c029e0a937a4bcce204bbf3bd3b9c17fdc Mon Sep 17 00:00:00 2001 From: Vitaliy Guliy Date: Tue, 30 Aug 2016 12:21:37 +0300 Subject: [PATCH 1/2] artik-ide#108 Cannot open the terminal of ARTIK board, after connect multiple boards --- .../machine/client/MachineResources.java | 4 ++- .../console/OutputConsoleViewImpl.ui.xml | 1 - .../client/processes/ProcessTreeRenderer.java | 10 +++---- .../panel/ProcessesPanelPresenter.java | 8 ++++++ .../ide/extension/machine/client/machine.css | 28 ++++++++++++++++--- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/MachineResources.java b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/MachineResources.java index b08e22d874..418798d3fa 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/MachineResources.java +++ b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/MachineResources.java @@ -173,7 +173,7 @@ public interface MachineResources extends ClientBundle { String badgeVisible(); - String processButton(); + String newTerminalButton(); String sshButton(); @@ -181,6 +181,8 @@ public interface MachineResources extends ClientBundle { String processOutputPanel(); + String machineMonitors(); + /** Returns the CSS class name for close button of process in 'Consoles' panel. */ String processesPanelCloseButtonForProcess(); diff --git a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/outputspanel/console/OutputConsoleViewImpl.ui.xml b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/outputspanel/console/OutputConsoleViewImpl.ui.xml index f452a299fe..9dac4a1a0f 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/outputspanel/console/OutputConsoleViewImpl.ui.xml +++ b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/outputspanel/console/OutputConsoleViewImpl.ui.xml @@ -139,7 +139,6 @@ */ .consolePanel { background-color: outputBackgroundColor; - border-top: 1px solid separatorColor; position: absolute; overflow: hidden; } diff --git a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/ProcessTreeRenderer.java b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/ProcessTreeRenderer.java index 0da7785abd..437fb958d8 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/ProcessTreeRenderer.java +++ b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/ProcessTreeRenderer.java @@ -133,7 +133,7 @@ public class ProcessTreeRenderer implements NodeRenderer { MIDDLE, locale.viewMachineRunningTooltip()); - SpanElement newTerminalButton = Elements.createSpanElement(resources.getCss().processButton()); + SpanElement newTerminalButton = Elements.createSpanElement(resources.getCss().newTerminalButton()); newTerminalButton.appendChild((Node)new SVGImage(resources.addTerminalIcon()).getElement()); root.appendChild(newTerminalButton); @@ -195,9 +195,7 @@ public class ProcessTreeRenderer implements NodeRenderer { newTerminalButton.addEventListener(Event.CLICK, blockMouseListener, true); newTerminalButton.addEventListener(Event.DBLCLICK, blockMouseListener, true); - Element monitorsElement = Elements.createSpanElement(); - monitorsElement.getStyle().setProperty("float", "right"); - monitorsElement.getStyle().setProperty("cursor", "default"); + Element monitorsElement = Elements.createSpanElement(resources.getCss().machineMonitors()); root.appendChild(monitorsElement); Node monitorNode = (Node)machineMonitors.getMonitorWidget(machine.getId(), this).getElement(); @@ -245,6 +243,8 @@ public class ProcessTreeRenderer implements NodeRenderer { private SpanElement createTerminalElement(ProcessTreeNode node) { SpanElement root = Elements.createSpanElement(); + root.appendChild(createCloseElement(node)); + SVGResource icon = node.getTitleIcon(); if (icon != null) { SpanElement iconElement = Elements.createSpanElement(resources.getCss().processIcon()); @@ -256,8 +256,6 @@ public class ProcessTreeRenderer implements NodeRenderer { divElement.appendChild((Node)new SVGImage(icon).getElement()); } - root.appendChild(createCloseElement(node)); - Element nameElement = Elements.createSpanElement(); nameElement.setTextContent(node.getName()); root.appendChild(nameElement); diff --git a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java index 96ef232a4c..3ab7e517d9 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java +++ b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java @@ -694,6 +694,14 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP @Override public void apply(List arg) throws OperationException { for (MachineProcessDto machineProcessDto : arg) { + /** + * Do not show the process if the command line has prefix #hidden + */ + if (machineProcessDto.getCommandLine() != null && !machineProcessDto.getCommandLine().isEmpty() + && machineProcessDto.getCommandLine().startsWith("#hidden")) { + continue; + } + final CommandDto commandDto = dtoFactory.createDto(CommandDto.class) .withName(machineProcessDto.getName()) .withAttributes(machineProcessDto.getAttributes()) diff --git a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/resources/org/eclipse/che/ide/extension/machine/client/machine.css b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/resources/org/eclipse/che/ide/extension/machine/client/machine.css index 1e942578c2..2c02c4b9f9 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/resources/org/eclipse/che/ide/extension/machine/client/machine.css +++ b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/resources/org/eclipse/che/ide/extension/machine/client/machine.css @@ -300,9 +300,12 @@ margin-right: 2px; color: categoryHeaderButtonColor; cursor: pointer; + position: absolute; + right: 24px; + top: 0px; } -.processTree .processButton { +.processTree .newTerminalButton { float: right; margin: 3px 6px 0 5px; width: 12px; @@ -313,23 +316,34 @@ box-sizing: border-box; text-align: center; cursor: pointer; + position: absolute; + right: 0px; + top: 0px; } -.processTree .processButton > svg { +.processTree .newTerminalButton > svg { margin-top: 2px; } -.processButton span:hover { +.newTerminalButton span:hover { fill: categoryHeaderButtonHoverColor; stroke: categoryHeaderButtonHoverColor; } -.processButton:hover, +.newTerminalButton:hover, .sshButton:hover { filter: brightness(120%); -webkit-filter: brightness(120%); } +.processTree .machineMonitors { + float: right; + cursor: default; + position: absolute; + right: 24px; + top: 0px; +} + .processTree .processIcon { height: 16px; margin-top: 1px; @@ -404,6 +418,9 @@ border-radius: 2px; box-sizing: border-box; cursor: pointer; + position: absolute; + right: 24px; + top: 0px; } .processesPanelStopButtonForProcess:hover { @@ -423,6 +440,9 @@ padding-right: 9px; float: right; fill: editorTabIconColor; + position: absolute; + right: 0px; + top: 0px; } .processesPanelCloseButtonForProcess svg g, From 54bcac13975a0890081650276587c2b4996f061a Mon Sep 17 00:00:00 2001 From: Vitaliy Guliy Date: Tue, 30 Aug 2016 12:21:37 +0300 Subject: [PATCH 2/2] artik-ide#108 Cannot open the terminal of ARTIK board, after connect multiple boards Signed-off-by: Vitaliy Guliy --- .../client/processes/panel/ProcessesPanelPresenter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java index 629f5bf3c3..f994c04bde 100644 --- a/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java +++ b/plugins/plugin-machine/che-plugin-machine-ext-client/src/main/java/org/eclipse/che/ide/extension/machine/client/processes/panel/ProcessesPanelPresenter.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.che.ide.extension.machine.client.processes.panel; +import com.google.common.base.Strings; import com.google.gwt.core.client.Scheduler; import com.google.gwt.user.client.ui.AcceptsOneWidget; import com.google.gwt.user.client.ui.IsWidget; @@ -714,8 +715,7 @@ public class ProcessesPanelPresenter extends BasePresenter implements ProcessesP /** * Do not show the process if the command line has prefix #hidden */ - if (machineProcessDto.getCommandLine() != null && !machineProcessDto.getCommandLine().isEmpty() - && machineProcessDto.getCommandLine().startsWith("#hidden")) { + if (!Strings.isNullOrEmpty(machineProcessDto.getCommandLine()) && machineProcessDto.getCommandLine().startsWith("#hidden")) { continue; }