CHE-377 Add actions to re-run and stop a command
Signed-off-by: Vitaliy Guliy <vguliy@codenvy.com>6.19.x
parent
1b9fb049fb
commit
a9a3ccddf0
|
|
@ -993,6 +993,48 @@ public interface Theme {
|
|||
*/
|
||||
String processTreeBackgroundColor();
|
||||
|
||||
/**
|
||||
* Background color for toolbar in consoles panel.
|
||||
*
|
||||
* @return color
|
||||
*/
|
||||
String consolesToolbarBackground();
|
||||
|
||||
/**
|
||||
* Border color for consoles toolbar border.
|
||||
*
|
||||
* @return color
|
||||
*/
|
||||
String colsolesToolbarBorderColor();
|
||||
|
||||
/**
|
||||
* Button color on consoles toolbar.
|
||||
*
|
||||
* @return color
|
||||
*/
|
||||
String consolesToolbarButtonColor();
|
||||
|
||||
/**
|
||||
* Hovered button color on consoles toolbar.
|
||||
*
|
||||
* @return color
|
||||
*/
|
||||
String consolesToolbarHoveredButtonColor();
|
||||
|
||||
/**
|
||||
* Disabled button on the consoles toolbar.
|
||||
*
|
||||
* @return color
|
||||
*/
|
||||
String consolesToolbarDisabledButtonColor();
|
||||
|
||||
/**
|
||||
* Toggled button on the consoles toolbar.
|
||||
*
|
||||
* @return color
|
||||
*/
|
||||
String consolesToolbarToggledButtonColor();
|
||||
|
||||
/**
|
||||
* Text color for DEV label in process tree.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -58,7 +58,15 @@
|
|||
@eval partToolbarSeparatorTopColor org.eclipse.che.ide.api.theme.Style.theme.partToolbarSeparatorTopColor();
|
||||
@eval partToolbarSeparatorBottomColor org.eclipse.che.ide.api.theme.Style.theme.partToolbarSeparatorBottomColor();
|
||||
|
||||
@eval outputBackgroundColor org.eclipse.che.ide.api.theme.Style.theme.outputBackgroundColor();
|
||||
|
||||
@eval consolePanelColor org.eclipse.che.ide.api.theme.Style.theme.consolePanelColor();
|
||||
@eval consolesToolbarBackground org.eclipse.che.ide.api.theme.Style.theme.consolesToolbarBackground();
|
||||
@eval colsolesToolbarBorderColor org.eclipse.che.ide.api.theme.Style.theme.colsolesToolbarBorderColor();
|
||||
@eval consolesToolbarButtonColor org.eclipse.che.ide.api.theme.Style.theme.consolesToolbarButtonColor();
|
||||
@eval consolesToolbarHoveredButtonColor org.eclipse.che.ide.api.theme.Style.theme.consolesToolbarHoveredButtonColor();
|
||||
@eval consolesToolbarDisabledButtonColor org.eclipse.che.ide.api.theme.Style.theme.consolesToolbarDisabledButtonColor();
|
||||
@eval consolesToolbarToggledButtonColor org.eclipse.che.ide.api.theme.Style.theme.consolesToolbarToggledButtonColor();
|
||||
|
||||
@eval tabBorderShadow org.eclipse.che.ide.api.theme.Style.theme.tabBorderShadow();
|
||||
|
||||
|
|
@ -180,6 +188,9 @@
|
|||
@def largeDropdownLabel 12px;
|
||||
@def buttonFontSize 11px;
|
||||
|
||||
@def consoleFontSize 11px;
|
||||
@def consoleLineHeight 13px;
|
||||
|
||||
/* Fonts */
|
||||
@def alternativeFontFamily "Helvetica Neue", "Myriad Pro","open sans", arial, sans-serif;
|
||||
@def fileTreeFontFamily "Helvetica Neue", "Myriad Pro","Lucida Grande", Verdana, Arial;
|
||||
|
|
|
|||
|
|
@ -766,6 +766,36 @@ public class DarkTheme implements Theme {
|
|||
return "#21252b";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarBackground() {
|
||||
return "#21252B";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String colsolesToolbarBorderColor() {
|
||||
return "#121416";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarButtonColor() {
|
||||
return "#aaaaaa";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarHoveredButtonColor() {
|
||||
return "#e0e0e0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarDisabledButtonColor() {
|
||||
return "#777777";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarToggledButtonColor() {
|
||||
return "rgba(0, 0, 0, 0.6)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String processTreeDevLabel() {
|
||||
return "white";
|
||||
|
|
|
|||
|
|
@ -742,6 +742,36 @@ public class LightTheme implements Theme {
|
|||
return "white";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarBackground() {
|
||||
return "#D6D6D9";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String colsolesToolbarBorderColor() {
|
||||
return "#8e8e8e";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarButtonColor() {
|
||||
return "#aaaaaa";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarHoveredButtonColor() {
|
||||
return "#e0e0e0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarDisabledButtonColor() {
|
||||
return "#777777";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String consolesToolbarToggledButtonColor() {
|
||||
return "rgba(0, 0, 0, 0.6)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String processTreeDevLabel() {
|
||||
return "white";
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ import org.eclipse.che.ide.api.mvp.View;
|
|||
* @author Andrey Plotnikov
|
||||
*/
|
||||
public interface GitOutputPartView extends View<GitOutputPartView.ActionDelegate> {
|
||||
public interface ActionDelegate {
|
||||
|
||||
interface ActionDelegate {
|
||||
/**
|
||||
* Handle user clicks on clear console button.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.che.ide.ext.git.client.outputconsole;
|
||||
|
||||
import com.google.gwt.dom.client.Node;
|
||||
import com.google.gwt.dom.client.PreElement;
|
||||
import com.google.gwt.user.client.DOM;
|
||||
import org.eclipse.che.ide.api.parts.PartStackUIResources;
|
||||
|
||||
import com.google.gwt.safehtml.shared.SimpleHtmlSanitizer;
|
||||
|
|
@ -25,6 +28,7 @@ import com.google.inject.Inject;
|
|||
import org.eclipse.che.ide.ext.git.client.GitLocalizationConstant;
|
||||
import org.eclipse.che.ide.ui.button.ConsoleButton;
|
||||
import org.eclipse.che.ide.ui.button.ConsoleButtonFactory;
|
||||
import org.eclipse.che.ide.util.loging.Log;
|
||||
import org.vectomatic.dom.svg.ui.SVGResource;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
|
@ -49,10 +53,10 @@ public class GitOutputPartViewImpl extends Composite implements GitOutputPartVie
|
|||
FlowPanel buttons;
|
||||
|
||||
@UiField
|
||||
FlowPanel consoleArea;
|
||||
ScrollPanel scrollPanel;
|
||||
|
||||
@UiField
|
||||
ScrollPanel scrollPanel;
|
||||
FlowPanel consoleLines;
|
||||
|
||||
@Inject
|
||||
public GitOutputPartViewImpl(GitLocalizationConstant constant,
|
||||
|
|
@ -82,31 +86,29 @@ public class GitOutputPartViewImpl extends Composite implements GitOutputPartVie
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void print(String text) {
|
||||
String preStyle = " style='margin:0px; font-size: 12px;' ";
|
||||
|
||||
HTML html = new HTML();
|
||||
html.setHTML("<pre" + preStyle + ">" + SimpleHtmlSanitizer.sanitizeHtml(text).asString() + "</pre>");
|
||||
html.getElement().setAttribute("style", "padding-left: 2px;");
|
||||
|
||||
consoleArea.add(html);
|
||||
PreElement pre = DOM.createElement("pre").cast();
|
||||
pre.setInnerText(text.isEmpty() ? " " : text);
|
||||
consoleLines.getElement().appendChild(pre);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(String text, String color) {
|
||||
String preStyle = " style='margin:0px; font-size: 12px;' ";
|
||||
PreElement pre = DOM.createElement("pre").cast();
|
||||
pre.setInnerText(text.isEmpty() ? " " : text);
|
||||
|
||||
HTML html = new HTML();
|
||||
html.setHTML("<pre" + preStyle + "><span style='color:" + SimpleHtmlSanitizer.sanitizeHtml(color).asString() +
|
||||
";'>" + SimpleHtmlSanitizer.sanitizeHtml(text).asString() + "</span></pre>");
|
||||
try {
|
||||
pre.getStyle().setColor(SimpleHtmlSanitizer.sanitizeHtml(color).asString());
|
||||
} catch (Exception e) {
|
||||
Log.error(getClass(), "Unable to set color [" + color + "]", e);
|
||||
}
|
||||
|
||||
html.getElement().setAttribute("style", "padding-left: 2px;");
|
||||
consoleArea.add(html);
|
||||
consoleLines.getElement().appendChild(pre);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void clear() {
|
||||
consoleArea.clear();
|
||||
consoleLines.clear();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
|
|||
|
|
@ -14,26 +14,66 @@
|
|||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
|
||||
<ui:style>
|
||||
.scrollPanel {
|
||||
border: 1px solid #242424;
|
||||
padding: 3px;
|
||||
<ui:style src="org/eclipse/che/ide/api/ui/style.css">
|
||||
|
||||
@eval outputBackgroundColor org.eclipse.che.ide.api.theme.Style.theme.outputBackgroundColor();
|
||||
|
||||
/**
|
||||
* Toolbar on the left with buttons.
|
||||
*/
|
||||
.toolbar {
|
||||
background-color: #373737;
|
||||
}
|
||||
|
||||
.backgroundColor {
|
||||
background-color: #373737;
|
||||
/**
|
||||
* Console output area.
|
||||
*/
|
||||
.console {
|
||||
background-color: outputBackgroundColor;
|
||||
color: outputFontColor;
|
||||
border-top: 1px solid separatorColor;
|
||||
|
||||
-moz-user-select: text;
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
outline: none;
|
||||
|
||||
padding: 1px 3px 3px 3px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.console pre {
|
||||
font-family: outputFontFamily;
|
||||
font-size: consoleFontSize;
|
||||
line-height: consoleLineHeight;
|
||||
}
|
||||
|
||||
.consoleLines {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.consoleLines > pre {
|
||||
width: inherit;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.consoleLines[wrap] > pre {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
</ui:style>
|
||||
|
||||
<g:DockLayoutPanel unit="PX" >
|
||||
<g:west size="18" >
|
||||
<g:FlowPanel ui:field="buttons" styleName="{style.backgroundColor}"/>
|
||||
<g:FlowPanel ui:field="buttons" styleName="{style.toolbar}"/>
|
||||
</g:west>
|
||||
|
||||
<g:center>
|
||||
<g:ScrollPanel width="100%" height="100%" ui:field="scrollPanel" debugId="consolePart" styleName="{style.scrollPanel}">
|
||||
<g:FlowPanel width="100%" height="100%" ui:field="consoleArea" />
|
||||
<g:ScrollPanel width="100%" height="100%" ui:field="scrollPanel" debugId="consolePart" styleName="{style.console}">
|
||||
<g:FlowPanel width="100%" ui:field="consoleLines" debugId="gitOutputConsoleLines" styleName="{style.consoleLines}" />
|
||||
</g:ScrollPanel>
|
||||
</g:center>
|
||||
</g:DockLayoutPanel>
|
||||
|
|
|
|||
|
|
@ -248,7 +248,6 @@ public interface MachineLocalizationConstant extends Messages {
|
|||
@Key("view.targets.delete.error")
|
||||
String targetsViewDeleteError(String target);
|
||||
|
||||
|
||||
@Key("process.active")
|
||||
String processActive();
|
||||
|
||||
|
|
@ -381,6 +380,23 @@ public interface MachineLocalizationConstant extends Messages {
|
|||
@Key("view.consoles.title")
|
||||
String viewConsolesTitle();
|
||||
|
||||
|
||||
@Key("consoles.reRunButton.tooltip")
|
||||
String consolesReRunButtonTooltip();
|
||||
|
||||
@Key("consoles.stopButton.tooltip")
|
||||
String consolesStopButtonTooltip();
|
||||
|
||||
@Key("consoles.clearOutputsButton.tooltip")
|
||||
String consolesClearOutputsButtonTooltip();
|
||||
|
||||
@Key("consoles.wrapTextButton.tooltip")
|
||||
String consolesWrapTextButtonTooltip();
|
||||
|
||||
@Key("consoles.autoScrollButton.tooltip")
|
||||
String consolesAutoScrollButtonTooltip();
|
||||
|
||||
|
||||
@Key("view.processes.tooltip")
|
||||
String viewProcessesTooltip();
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,21 @@ public interface MachineResources extends ClientBundle {
|
|||
@Source("images/process/add-terminal.svg")
|
||||
SVGResource addTerminalIcon();
|
||||
|
||||
@Source("images/process/re-run.svg")
|
||||
SVGResource reRunIcon();
|
||||
|
||||
@Source("images/process/stop.svg")
|
||||
SVGResource stopIcon();
|
||||
|
||||
@Source("images/process/clear-outputs.svg")
|
||||
SVGResource clearOutputsIcon();
|
||||
|
||||
@Source("images/process/scroll-to-bottom.svg")
|
||||
SVGResource scrollToBottomIcon();
|
||||
|
||||
@Source("images/process/line-wrap.svg")
|
||||
SVGResource lineWrapIcon();
|
||||
|
||||
/** Returns the icon for 'Custom' command type. */
|
||||
@Source("command/arbitrary/custom-command-type.svg")
|
||||
SVGResource customCommandType();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.eclipse.che.api.promises.client.OperationException;
|
|||
import org.eclipse.che.ide.extension.machine.client.MachineResources;
|
||||
import org.eclipse.che.ide.extension.machine.client.command.CommandConfiguration;
|
||||
import org.eclipse.che.ide.extension.machine.client.command.CommandManager;
|
||||
import org.eclipse.che.ide.extension.machine.client.processes.event.ProcessFinishedEvent;
|
||||
import org.eclipse.che.ide.extension.machine.client.processes.ProcessFinishedEvent;
|
||||
import org.eclipse.che.ide.rest.DtoUnmarshallerFactory;
|
||||
import org.eclipse.che.ide.util.loging.Log;
|
||||
import org.eclipse.che.ide.websocket.MessageBus;
|
||||
|
|
@ -55,6 +55,7 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
private final CommandConfiguration commandConfiguration;
|
||||
private final EventBus eventBus;
|
||||
private final String machineId;
|
||||
private final CommandManager commandManager;
|
||||
|
||||
private MessageBus messageBus;
|
||||
private int pid;
|
||||
|
|
@ -62,6 +63,12 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
private MessageHandler outputHandler;
|
||||
private boolean finished;
|
||||
|
||||
/** Wrap text or not */
|
||||
private boolean wrapText = false;
|
||||
|
||||
/** Follow output when printing text */
|
||||
private boolean followOutput = true;
|
||||
|
||||
private List<ConsoleOutputListener> outputListenes = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
|
|
@ -82,6 +89,7 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
this.machineId = machineId;
|
||||
this.messageBus = messageBusProvider.getMessageBus();
|
||||
this.eventBus = eventBus;
|
||||
this.commandManager = commandManager;
|
||||
|
||||
view.setDelegate(this);
|
||||
|
||||
|
|
@ -90,7 +98,7 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
commandManager.substituteProperties(previewUrl).then(new Operation<String>() {
|
||||
@Override
|
||||
public void apply(String arg) throws OperationException {
|
||||
view.printPreviewUrl(arg);
|
||||
view.showPreviewUrl(arg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
@ -120,6 +128,9 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
|
||||
@Override
|
||||
public void listenToOutput(String wsChannel) {
|
||||
view.enableStopButton(true);
|
||||
view.toggleScrollToEndButton(true);
|
||||
|
||||
outputChannel = wsChannel;
|
||||
outputHandler = new SubscriptionHandler<String>(new OutputMessageUnmarshaller()) {
|
||||
@Override
|
||||
|
|
@ -144,7 +155,7 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
public void attachToProcess(final MachineProcessDto process) {
|
||||
this.pid = process.getPid();
|
||||
|
||||
view.printCommandLine(process.getCommandLine());
|
||||
view.showCommandLine(process.getCommandLine());
|
||||
|
||||
final Unmarshallable<MachineProcessEvent> unmarshaller = dtoUnmarshallerFactory.newWSUnmarshaller(MachineProcessEvent.class);
|
||||
final String processStateChannel = "machine:process:" + machineId;
|
||||
|
|
@ -160,11 +171,14 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
switch (result.getEventType()) {
|
||||
case STOPPED:
|
||||
finished = true;
|
||||
view.enableStopButton(false);
|
||||
|
||||
eventBus.fireEvent(new ProcessFinishedEvent(null));
|
||||
break;
|
||||
|
||||
case ERROR:
|
||||
finished = true;
|
||||
view.enableStopButton(false);
|
||||
|
||||
eventBus.fireEvent(new ProcessFinishedEvent(null));
|
||||
|
||||
|
|
@ -183,6 +197,8 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
@Override
|
||||
protected void onErrorReceived(Throwable exception) {
|
||||
finished = true;
|
||||
view.enableStopButton(false);
|
||||
|
||||
wsUnsubscribe(processStateChannel, this);
|
||||
wsUnsubscribe(outputChannel, outputHandler);
|
||||
}
|
||||
|
|
@ -227,4 +243,49 @@ public class CommandOutputConsolePresenter implements CommandOutputConsole, Outp
|
|||
outputListenes.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reRunProcessButtonClicked() {
|
||||
if (isFinished()) {
|
||||
commandManager.execute(commandConfiguration);
|
||||
} else {
|
||||
machineServiceClient.stopProcess(machineId, pid).then(new Operation<Void>() {
|
||||
@Override
|
||||
public void apply(Void arg) throws OperationException {
|
||||
commandManager.execute(commandConfiguration);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopProcessButtonClicked() {
|
||||
stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearOutputsButtonClicked() {
|
||||
view.clearConsole();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrapTextButtonClicked() {
|
||||
wrapText = !wrapText;
|
||||
view.wrapText(wrapText);
|
||||
view.toggleWrapTextButton(wrapText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollToBottomButtonClicked() {
|
||||
followOutput = !followOutput;
|
||||
|
||||
view.toggleScrollToEndButton(followOutput);
|
||||
view.enableAutoScroll(followOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOutputScrolled(boolean bottomReached) {
|
||||
followOutput = bottomReached;
|
||||
view.toggleScrollToEndButton(bottomReached);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,31 +19,106 @@ import org.eclipse.che.ide.api.mvp.View;
|
|||
*/
|
||||
public interface OutputConsoleView extends View<OutputConsoleView.ActionDelegate> {
|
||||
|
||||
/** Print the command line to the console. */
|
||||
void printCommandLine(String commandLine);
|
||||
|
||||
/** Print the command preview Url. */
|
||||
void printPreviewUrl(String previewUrl);
|
||||
/**
|
||||
* Shows the command line to the console.
|
||||
*
|
||||
* @param commandLine
|
||||
* command line
|
||||
*/
|
||||
void showCommandLine(String commandLine);
|
||||
|
||||
/**
|
||||
* Print the message.
|
||||
* Shows the command preview URL.
|
||||
*
|
||||
* @param message
|
||||
* @param previewUrl
|
||||
* preview URL
|
||||
*/
|
||||
void showPreviewUrl(String previewUrl);
|
||||
|
||||
/**
|
||||
* Prints text.
|
||||
*
|
||||
* @param text
|
||||
* text to print
|
||||
* @param cr
|
||||
* if {@code true} - next message should replace the current one,
|
||||
* if {@code false} - next message will be printed in a new line
|
||||
*/
|
||||
void print(String message, boolean cr);
|
||||
void print(String text, boolean cr);
|
||||
|
||||
/** Hides command title and command label */
|
||||
/**
|
||||
* Hides command title and command label.
|
||||
*/
|
||||
void hideCommand();
|
||||
|
||||
/** Hides preview title and preview label */
|
||||
/**
|
||||
* Hides preview title and preview label.
|
||||
*/
|
||||
void hidePreview();
|
||||
|
||||
/**
|
||||
* Wraps text in the console.
|
||||
*
|
||||
* @param wrap
|
||||
* set <code>true</code> to wrap the text
|
||||
*/
|
||||
void wrapText(boolean wrap);
|
||||
|
||||
/**
|
||||
* Enables auto scroll when output.
|
||||
*/
|
||||
void enableAutoScroll(boolean enable);
|
||||
|
||||
/**
|
||||
* Clears the console.
|
||||
*/
|
||||
void clearConsole();
|
||||
|
||||
/**
|
||||
* Toggles `Wrap text` button.
|
||||
*
|
||||
* @param toggle
|
||||
* use <code>true</code> to toggle the button
|
||||
*/
|
||||
void toggleWrapTextButton(boolean toggle);
|
||||
|
||||
/**
|
||||
* Toggles `Scroll to the end` button.
|
||||
*
|
||||
* @param toggle
|
||||
* use <code>true</code> to toggle the button
|
||||
*/
|
||||
void toggleScrollToEndButton(boolean toggle);
|
||||
|
||||
/**
|
||||
* Enables or disables Stop process button.
|
||||
*
|
||||
* @param enable
|
||||
* new enabled state for the button
|
||||
*/
|
||||
void enableStopButton(boolean enable);
|
||||
|
||||
/** Action handler for the view actions/controls. */
|
||||
interface ActionDelegate {
|
||||
|
||||
/** Handle click on `Run process` button. */
|
||||
void reRunProcessButtonClicked();
|
||||
|
||||
/** Handle click on `Stop process` button. */
|
||||
void stopProcessButtonClicked();
|
||||
|
||||
/** Handle click on `Clear console` button. */
|
||||
void clearOutputsButtonClicked();
|
||||
|
||||
/** Handle click on `Wrap text` button. */
|
||||
void wrapTextButtonClicked();
|
||||
|
||||
/** Handle click on `Scroll to end` button. */
|
||||
void scrollToBottomButtonClicked();
|
||||
|
||||
/** Handle scrolling the output. */
|
||||
void onOutputScrolled(boolean bottomReached);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import com.google.gwt.core.client.GWT;
|
|||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.dom.client.Node;
|
||||
import com.google.gwt.dom.client.PreElement;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.dom.client.ScrollEvent;
|
||||
import com.google.gwt.event.dom.client.ScrollHandler;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
|
|
@ -28,6 +30,12 @@ import com.google.gwt.user.client.ui.Label;
|
|||
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.che.ide.extension.machine.client.MachineLocalizationConstant;
|
||||
import org.eclipse.che.ide.extension.machine.client.MachineResources;
|
||||
import org.eclipse.che.ide.ui.Tooltip;
|
||||
import static org.eclipse.che.ide.ui.menu.PositionController.HorizontalAlign.MIDDLE;
|
||||
import static org.eclipse.che.ide.ui.menu.PositionController.VerticalAlign.BOTTOM;
|
||||
import org.vectomatic.dom.svg.ui.SVGImage;
|
||||
|
||||
/**
|
||||
* View representation of output console.
|
||||
|
|
@ -42,6 +50,8 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
|
||||
private static final OutputConsoleViewUiBinder UI_BINDER = GWT.create(OutputConsoleViewUiBinder.class);
|
||||
|
||||
private ActionDelegate delegate;
|
||||
|
||||
@UiField
|
||||
DockLayoutPanel consolePanel;
|
||||
|
||||
|
|
@ -66,6 +76,21 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
@UiField
|
||||
Anchor previewUrlLabel;
|
||||
|
||||
@UiField
|
||||
FlowPanel reRunProcessButton;
|
||||
|
||||
@UiField
|
||||
FlowPanel stopProcessButton;
|
||||
|
||||
@UiField
|
||||
FlowPanel clearOutputsButton;
|
||||
|
||||
@UiField
|
||||
FlowPanel wrapTextButton;
|
||||
|
||||
@UiField
|
||||
FlowPanel scrollToBottomButton;
|
||||
|
||||
/** If true - next printed line should replace the previous one. */
|
||||
private boolean carriageReturn;
|
||||
|
||||
|
|
@ -76,13 +101,93 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
private boolean followScheduled = false;
|
||||
|
||||
@Inject
|
||||
public OutputConsoleViewImpl() {
|
||||
public OutputConsoleViewImpl(MachineResources resources,
|
||||
MachineLocalizationConstant localization) {
|
||||
initWidget(UI_BINDER.createAndBindUi(this));
|
||||
|
||||
reRunProcessButton.add(new SVGImage(resources.reRunIcon()));
|
||||
stopProcessButton.add(new SVGImage(resources.stopIcon()));
|
||||
clearOutputsButton.add(new SVGImage(resources.clearOutputsIcon()));
|
||||
|
||||
wrapTextButton.add(new SVGImage(resources.lineWrapIcon()));
|
||||
scrollToBottomButton.add(new SVGImage(resources.scrollToBottomIcon()));
|
||||
|
||||
scrollPanel.addDomHandler(this, ScrollEvent.getType());
|
||||
|
||||
reRunProcessButton.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if (!reRunProcessButton.getElement().hasAttribute("disabled") && delegate != null) {
|
||||
delegate.reRunProcessButtonClicked();
|
||||
}
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
|
||||
stopProcessButton.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if (!stopProcessButton.getElement().hasAttribute("disabled") && delegate != null) {
|
||||
delegate.stopProcessButtonClicked();
|
||||
}
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
|
||||
clearOutputsButton.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if (!clearOutputsButton.getElement().hasAttribute("disabled") && delegate != null) {
|
||||
delegate.clearOutputsButtonClicked();
|
||||
}
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
|
||||
wrapTextButton.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
if (!wrapTextButton.getElement().hasAttribute("disabled") && delegate != null) {
|
||||
delegate.wrapTextButtonClicked();
|
||||
}
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
|
||||
scrollToBottomButton.addDomHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if (!scrollToBottomButton.getElement().hasAttribute("disabled") && delegate != null) {
|
||||
delegate.scrollToBottomButtonClicked();
|
||||
}
|
||||
}
|
||||
}, ClickEvent.getType());
|
||||
|
||||
Tooltip.create((elemental.dom.Element) reRunProcessButton.getElement(),
|
||||
BOTTOM,
|
||||
MIDDLE,
|
||||
localization.consolesReRunButtonTooltip());
|
||||
|
||||
Tooltip.create((elemental.dom.Element) stopProcessButton.getElement(),
|
||||
BOTTOM,
|
||||
MIDDLE,
|
||||
localization.consolesStopButtonTooltip());
|
||||
|
||||
Tooltip.create((elemental.dom.Element) clearOutputsButton.getElement(),
|
||||
BOTTOM,
|
||||
MIDDLE,
|
||||
localization.consolesClearOutputsButtonTooltip());
|
||||
|
||||
Tooltip.create((elemental.dom.Element) wrapTextButton.getElement(),
|
||||
BOTTOM,
|
||||
MIDDLE,
|
||||
localization.consolesWrapTextButtonTooltip());
|
||||
|
||||
Tooltip.create((elemental.dom.Element) scrollToBottomButton.getElement(),
|
||||
BOTTOM,
|
||||
MIDDLE,
|
||||
localization.consolesAutoScrollButtonTooltip());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDelegate(ActionDelegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -96,12 +201,59 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
}
|
||||
|
||||
@Override
|
||||
public void printCommandLine(String commandLine) {
|
||||
public void wrapText(boolean wrap) {
|
||||
if (wrap) {
|
||||
consoleLines.getElement().setAttribute("wrap", "");
|
||||
} else {
|
||||
consoleLines.getElement().removeAttribute("wrap");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableAutoScroll(boolean enable) {
|
||||
followOutput = enable;
|
||||
followOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearConsole() {
|
||||
consoleLines.getElement().setInnerHTML("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleWrapTextButton(boolean toggle) {
|
||||
if (toggle) {
|
||||
wrapTextButton.getElement().setAttribute("toggled", "");
|
||||
} else {
|
||||
wrapTextButton.getElement().removeAttribute("toggled");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleScrollToEndButton(boolean toggle) {
|
||||
if (toggle) {
|
||||
scrollToBottomButton.getElement().setAttribute("toggled", "");
|
||||
} else {
|
||||
scrollToBottomButton.getElement().removeAttribute("toggled");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableStopButton(boolean enable) {
|
||||
if (enable) {
|
||||
stopProcessButton.getElement().removeAttribute("disabled");
|
||||
} else {
|
||||
stopProcessButton.getElement().setAttribute("disabled", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCommandLine(String commandLine) {
|
||||
commandLabel.setText(commandLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printPreviewUrl(String previewUrl) {
|
||||
public void showPreviewUrl(String previewUrl) {
|
||||
if (Strings.isNullOrEmpty(previewUrl)) {
|
||||
hidePreview();
|
||||
} else {
|
||||
|
|
@ -112,7 +264,7 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
}
|
||||
|
||||
@Override
|
||||
public void print(String message, boolean cr) {
|
||||
public void print(String text, boolean cr) {
|
||||
if (carriageReturn) {
|
||||
Node lastChild = consoleLines.getElement().getLastChild();
|
||||
if (lastChild != null) {
|
||||
|
|
@ -123,7 +275,7 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
carriageReturn = cr;
|
||||
|
||||
PreElement pre = DOM.createElement("pre").cast();
|
||||
pre.setInnerText(message.isEmpty() ? " " : message);
|
||||
pre.setInnerText(text.isEmpty() ? " " : text);
|
||||
consoleLines.getElement().appendChild(pre);
|
||||
|
||||
followOutput();
|
||||
|
|
@ -133,6 +285,10 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
public void onScroll(ScrollEvent event) {
|
||||
// Do nothing if content height less scroll area height
|
||||
if (scrollPanel.getElement().getScrollHeight() < scrollPanel.getElement().getOffsetHeight()) {
|
||||
followOutput = true;
|
||||
if (delegate != null) {
|
||||
delegate.onOutputScrolled(followOutput);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -142,6 +298,10 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
} else {
|
||||
followOutput = false;
|
||||
}
|
||||
|
||||
if (delegate != null) {
|
||||
delegate.onOutputScrolled(followOutput);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -155,6 +315,7 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
/** Scroll bottom immediately if view is visible */
|
||||
if (scrollPanel.getElement().getOffsetParent() != null) {
|
||||
scrollPanel.scrollToBottom();
|
||||
scrollPanel.scrollToLeft();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -172,6 +333,7 @@ public class OutputConsoleViewImpl extends Composite implements OutputConsoleVie
|
|||
|
||||
if (scrollPanel.getElement().getOffsetParent() != null) {
|
||||
scrollPanel.scrollToBottom();
|
||||
scrollPanel.scrollToLeft();
|
||||
followScheduled = false;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,82 @@
|
|||
<ui:with field="locale" type="org.eclipse.che.ide.extension.machine.client.MachineLocalizationConstant"/>
|
||||
|
||||
<ui:style src="org/eclipse/che/ide/api/ui/style.css">
|
||||
.background {
|
||||
|
||||
/**
|
||||
* Toolbar on the left with buttons.
|
||||
*/
|
||||
.toolbar {
|
||||
overflow: hidden;
|
||||
background-color: consolesToolbarBackground;
|
||||
border-right: 1px solid colsolesToolbarBorderColor;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.toolbarButton {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-left: 2px;
|
||||
margin-top: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 9px;
|
||||
line-height: 17px;
|
||||
font-family: "Droid Sans Mono", monospace;
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
overflow: hidden;
|
||||
color: consolesToolbarButtonColor;
|
||||
opacity: 0.8;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wrapTextButton {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: 22px;
|
||||
}
|
||||
|
||||
.scrollToEndButton {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: 4px;
|
||||
}
|
||||
|
||||
.toolbarButton > svg {
|
||||
position: absolute;
|
||||
left: 3px;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
.toolbarButton:HOVER {
|
||||
color: consolesToolbarHoveredButtonColor;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.toolbarButton:ACTIVE {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.toolbarButton[toggled] {
|
||||
opacity: 1;
|
||||
background: consolesToolbarToggledButtonColor;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.toolbarButton[disabled],
|
||||
.toolbarButton[disabled]:HOVER,
|
||||
.toolbarButton[disabled]:ACTIVE {
|
||||
opacity: 0.4;
|
||||
color: consolesToolbarDisabledButtonColor;
|
||||
background-color: transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Header with command line and preview URL.
|
||||
*/
|
||||
.header {
|
||||
background-color: editorPanelBackgroundColor;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
|
|
@ -59,41 +134,74 @@
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
.commandConsole {
|
||||
/**
|
||||
* Console output area.
|
||||
*/
|
||||
.consolePanel {
|
||||
background-color: outputBackgroundColor;
|
||||
border-top: 1px solid separatorColor;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.console {
|
||||
color: outputFontColor;
|
||||
|
||||
-moz-user-select: text;
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
color: outputFontColor;
|
||||
outline: none;
|
||||
border-top: 1px solid separatorColor;
|
||||
-webkit-box-shadow: outputBoxShadow;
|
||||
-moz-box-shadow: outputBoxShadow;
|
||||
box-shadow: outputBoxShadow;
|
||||
padding: 1px 3px 3px 3px;
|
||||
margin-bottom: 3px;
|
||||
|
||||
padding: 1px 3px 3px 0px;
|
||||
|
||||
border-left: 6px solid transparent;
|
||||
box-sizing: border-box;
|
||||
border-top: 2px solid transparent;
|
||||
|
||||
overflow: auto;
|
||||
position: absolute!important;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.commandConsole pre {
|
||||
.console pre {
|
||||
font-family: outputFontFamily;
|
||||
font-size: fontSize;
|
||||
font-size: consoleFontSize;
|
||||
line-height: consoleLineHeight;
|
||||
}
|
||||
|
||||
.commandConsoleLines {
|
||||
.consoleLines {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.commandConsoleLines > pre {
|
||||
word-wrap: break-word;
|
||||
.consoleLines > pre {
|
||||
width: inherit;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.consoleLines[wrap] > pre {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
</ui:style>
|
||||
|
||||
<g:DockLayoutPanel ui:field="consolePanel" unit="PX" width="100%" height="100%">
|
||||
<g:west size="19">
|
||||
<g:FlowPanel styleName="{style.toolbar}">
|
||||
<g:FlowPanel ui:field="reRunProcessButton" styleName="{style.toolbarButton}" />
|
||||
<g:FlowPanel ui:field="stopProcessButton" styleName="{style.toolbarButton}" />
|
||||
<g:FlowPanel ui:field="clearOutputsButton" styleName="{style.toolbarButton}" />
|
||||
<g:FlowPanel ui:field="wrapTextButton" styleName="{style.toolbarButton}" addStyleNames="{style.wrapTextButton}" />
|
||||
<g:FlowPanel ui:field="scrollToBottomButton" styleName="{style.toolbarButton}" addStyleNames="{style.scrollToEndButton}" />
|
||||
</g:FlowPanel>
|
||||
</g:west>
|
||||
<g:north size="14">
|
||||
<g:FlowPanel ui:field="commandPanel" styleName="{style.background}">
|
||||
<g:FlowPanel ui:field="commandPanel" styleName="{style.header}">
|
||||
<g:Label ui:field="commandTitle" text="{locale.viewProcessesCommandTitle}"
|
||||
addStyleNames="{style.label} {style.commandTitle}"/>
|
||||
<g:Label ui:field="commandLabel"
|
||||
|
|
@ -101,18 +209,18 @@
|
|||
</g:FlowPanel>
|
||||
</g:north>
|
||||
<g:north size="14">
|
||||
<g:FlowPanel ui:field="previewPanel" styleName="{style.background}">
|
||||
<g:Label text="preview:"
|
||||
addStyleNames="{style.label} {style.commandTitle}"/>
|
||||
<g:FlowPanel ui:field="previewPanel" styleName="{style.header}">
|
||||
<g:Label text="preview:" addStyleNames="{style.label} {style.commandTitle}"/>
|
||||
<g:Anchor ui:field="previewUrlLabel" target="_blank" title="Open in new window"
|
||||
addStyleNames="{style.link} {style.value} {style.commandTitle}"/>
|
||||
</g:FlowPanel>
|
||||
</g:north>
|
||||
<g:center>
|
||||
<g:ScrollPanel ui:field="scrollPanel" debugId="commandConsoleScrollPanel" addStyleNames="{style.commandConsole}">
|
||||
<g:FlowPanel width="100%" ui:field="consoleLines" debugId="commandConsoleLines"
|
||||
styleName="{style.commandConsoleLines}"/>
|
||||
</g:ScrollPanel>
|
||||
<g:FlowPanel styleName="{style.consolePanel}">
|
||||
<g:ScrollPanel ui:field="scrollPanel" debugId="commandConsoleScrollPanel" styleName="{style.console}">
|
||||
<g:FlowPanel width="100%" ui:field="consoleLines" debugId="commandConsoleLines" styleName="{style.consoleLines}"/>
|
||||
</g:ScrollPanel>
|
||||
</g:FlowPanel>
|
||||
</g:center>
|
||||
</g:DockLayoutPanel>
|
||||
</ui:UiBinder>
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ import org.eclipse.che.ide.extension.machine.client.outputspanel.console.Command
|
|||
import org.eclipse.che.ide.extension.machine.client.outputspanel.console.CommandOutputConsole;
|
||||
import org.eclipse.che.ide.extension.machine.client.outputspanel.console.DefaultOutputConsole;
|
||||
import org.eclipse.che.ide.extension.machine.client.perspective.terminal.TerminalPresenter;
|
||||
import org.eclipse.che.ide.extension.machine.client.processes.event.ProcessFinishedEvent;
|
||||
import org.eclipse.che.ide.extension.machine.client.processes.event.ProcessFinishedHandler;
|
||||
import org.eclipse.che.ide.api.dialogs.ConfirmCallback;
|
||||
import org.eclipse.che.ide.api.dialogs.DialogFactory;
|
||||
import org.eclipse.che.ide.util.loging.Log;
|
||||
|
|
@ -79,7 +77,7 @@ import static org.eclipse.che.ide.extension.machine.client.processes.ProcessTree
|
|||
@Singleton
|
||||
public class ConsolesPanelPresenter extends BasePresenter implements ConsolesPanelView.ActionDelegate,
|
||||
HasView,
|
||||
ProcessFinishedHandler,
|
||||
ProcessFinishedEvent.Handler,
|
||||
OutputConsole.ConsoleOutputListener,
|
||||
WorkspaceStoppedHandler,
|
||||
MachineStateEvent.Handler {
|
||||
|
|
|
|||
|
|
@ -8,16 +8,24 @@
|
|||
* Contributors:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.ide.extension.machine.client.processes.event;
|
||||
package org.eclipse.che.ide.extension.machine.client.processes;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
* @author Dmitry Shnurenko
|
||||
*/
|
||||
public class ProcessFinishedEvent extends GwtEvent<ProcessFinishedHandler> {
|
||||
public class ProcessFinishedEvent extends GwtEvent<ProcessFinishedEvent.Handler> {
|
||||
|
||||
public static final Type<ProcessFinishedHandler> TYPE = new Type<>();
|
||||
public interface Handler extends EventHandler {
|
||||
|
||||
/** Implement this method to handle ProcessFinishedEvent. */
|
||||
void onProcessFinished(ProcessFinishedEvent event);
|
||||
|
||||
}
|
||||
|
||||
public static final Type<ProcessFinishedEvent.Handler> TYPE = new Type<>();
|
||||
|
||||
private final String processID;
|
||||
|
||||
|
|
@ -30,12 +38,12 @@ public class ProcessFinishedEvent extends GwtEvent<ProcessFinishedHandler> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Type<ProcessFinishedHandler> getAssociatedType() {
|
||||
public Type<ProcessFinishedEvent.Handler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(ProcessFinishedHandler handler) {
|
||||
protected void dispatch(Handler handler) {
|
||||
handler.onProcessFinished(this);
|
||||
}
|
||||
|
||||
|
|
@ -298,7 +298,6 @@ public class ProcessTreeRenderer implements NodeRenderer<ProcessTreeNode> {
|
|||
return stopProcessButton;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateNodeContents(TreeNodeElement<ProcessTreeNode> treeNode) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
* 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:
|
||||
* Codenvy, S.A. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.che.ide.extension.machine.client.processes.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* @author Dmitry Shnurenko
|
||||
*/
|
||||
public interface ProcessFinishedHandler extends EventHandler {
|
||||
|
||||
/**Performs some actions when process finished or cancelled by reason of error.*/
|
||||
void onProcessFinished(ProcessFinishedEvent event);
|
||||
|
||||
}
|
||||
|
|
@ -168,6 +168,12 @@ view.machine.running.tooltip=Machine is running
|
|||
view.stop.process.tooltip=Stop process
|
||||
view.close.processOutput.tooltip=Close
|
||||
|
||||
consoles.reRunButton.tooltip=Re-run
|
||||
consoles.stopButton.tooltip=Stop
|
||||
consoles.clearOutputsButton.tooltip=Clear outputs
|
||||
consoles.wrapTextButton.tooltip=Wrap the text
|
||||
consoles.autoScrollButton.tooltip=Scroll to bottom automatically
|
||||
|
||||
failed.to.execute.command=Failed to execute command
|
||||
failed.to.create.recipe=Failed to create recipe
|
||||
failed.to.save.recipe=Failed to save recipe
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
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:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<svg width="8px" height="7px" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="#808080" fill-rule="evenodd">
|
||||
<path d="M8,6.41414141 C8,6.3510101 7.97474747,6.28787879 7.92929293,6.24242424 L7.18686869,5.5 L7.92929293,4.75757576 C7.97474747,4.71212121 8,4.6489899 8,4.58585859 C8,4.52272727 7.97474747,4.45959596 7.92929293,4.41414141 L7.58585859,4.07070707 C7.54040404,4.02525253 7.47727273,4 7.41414141,4 C7.3510101,4 7.28787879,4.02525253 7.24242424,4.07070707 L6.5,4.81313131 L5.75757576,4.07070707 C5.71212121,4.02525253 5.6489899,4 5.58585859,4 C5.52272727,4 5.45959596,4.02525253 5.41414141,4.07070707 L5.07070707,4.41414141 C5.02525253,4.45959596 5,4.52272727 5,4.58585859 C5,4.6489899 5.02525253,4.71212121 5.07070707,4.75757576 L5.81313131,5.5 L5.07070707,6.24242424 C5.02525253,6.28787879 5,6.3510101 5,6.41414141 C5,6.47727273 5.02525253,6.54040404 5.07070707,6.58585859 L5.41414141,6.92929293 C5.45959596,6.97474747 5.52272727,7 5.58585859,7 C5.6489899,7 5.71212121,6.97474747 5.75757576,6.92929293 L6.5,6.18686869 L7.24242424,6.92929293 C7.28787879,6.97474747 7.3510101,7 7.41414141,7 C7.47727273,7 7.54040404,6.97474747 7.58585859,6.92929293 L7.92929293,6.58585859 C7.97474747,6.54040404 8,6.47727273 8,6.41414141 L8,6.41414141 Z"></path>
|
||||
<path d="M0.4995,3 L7.5,3 C7.775,3 8,2.75454545 8,2.45454545 L8,2.45454545 C8,2.15454545 7.775,1.90909091 7.5,1.90909091 L0.4995,1.90909091 C0.2245,1.90909091 1.02140518e-13,2.15454545 1.02140518e-13,2.45454545 L1.02140518e-13,2.45454545 C1.02140518e-13,2.75454545 0.2245,3 0.4995,3 L0.4995,3 L0.4995,3 Z M0.4995,1.09090909 L7.5,1.09090909 C7.775,1.09090909 8,0.846 8,0.545454545 L8,0.545454545 C8,0.245454545 7.775,3.06421555e-14 7.5,3.06421555e-14 L0.4995,3.06421555e-14 C0.2245,3.06421555e-14 1.02140518e-13,0.245454545 1.02140518e-13,0.545454545 L1.02140518e-13,0.545454545 C1.02140518e-13,0.846 0.2245,1.09090909 0.4995,1.09090909 L0.4995,1.09090909 Z"></path>
|
||||
<path d="M4.88903809,7.00000003 L3.78344727,5.90909091 L0.4995,5.90909091 C0.2245,5.90909091 1.02140518e-13,6.15454545 1.02140518e-13,6.45454545 C1.02140518e-13,6.75454545 0.2245,7 0.4995,7 L4.88903809,7.00000003 Z M3.74920654,5.09090912 L4.89141846,4 L0.4995,4 C0.2245,4 1.02140518e-13,4.24545455 1.02140518e-13,4.54545455 C1.02140518e-13,4.846 0.2245,5.09090909 0.4995,5.09090909 L3.74920654,5.09090912 Z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
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:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<svg width="8px" height="8px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M8.34379299,1.85454525 C8.64970663,1.85454525 8.89999962,1.54316084 8.89999962,1.16103878 C8.89999962,0.779610228 8.64970663,0.467532319 8.34379299,0.467532319 L0.556343932,0.467532319 C0.250430284,0.467532319 0.000693506467,0.779610228 0.000693506467,1.16103878 C0.000693506467,1.54316084 0.250430284,1.85454525 0.556343932,1.85454525 L8.34379299,1.85454525 Z M2.22569341,6.70909049 C2.22569341,6.70909049 3.67194335,5.32207757 3.49712193,5.32207757 L0.318232779,5.32207757 C0.143411357,5.32207757 0.000693506467,5.63415547 0.000693506467,6.01558403 C0.000693506467,6.39770609 0.143411357,6.70909049 0.318232779,6.70909049 L2.22569341,6.70909049 Z" fill="#808080"></path>
|
||||
<path d="M0,3.40194916 C0,3.12442485 0.220001211,2.89944694 0.504002871,2.89944694 L8.6038807,2.89944694 C8.76742266,2.89944694 8.89999962,3.03429881 8.89999962,3.20216863 L8.89999962,6.14731976 C8.89999962,6.31450833 8.7716189,6.45004145 8.6080227,6.45004145 L4.44999981,6.45004145 L4.44999981,5.33164376 L7.64874758,5.33164376 L7.64874758,4.17087546 L0.501855691,4.17087546 C0.224688446,4.17087546 0,3.94940951 0,3.66837324 L0,3.40194916 Z" fill="#4EABFF"></path>
|
||||
<path d="M4.17400651,7.87810946 C3.97533811,8.07684811 3.81428555,8.00429454 3.81428555,7.74108592 L3.81428555,4.81166324 C3.81428555,4.53724859 3.96818047,4.46868647 4.17400651,4.67451251 L5.41580087,5.91630687 C5.61446927,6.11497527 5.62162691,6.42997717 5.41580087,6.63587599 L4.17400651,7.87810946 Z" fill="#CF405F" transform="translate(4.660509, 6.278794) scale(-1, 1) translate(-4.660509, -6.278794) "></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
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:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<svg width="8px" height="8px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="#808080" fill-rule="evenodd">
|
||||
<path d="M5,1.29462433 C5,1.13190781 5.12890625,1 5.29861927,1 L7.70138073,1 C7.8663036,1 8,1.1368058 8,1.29845962 L8,7.25152817 C8,7.41636287 7.86114502,7.54998779 7.69615936,7.54998779 L0.500435829,7.54998779 C0.224052752,7.54998779 8.58627134e-16,7.33205797 8.21420683e-16,7.05767414 L6.67577371e-17,1.49231365 C2.9888457e-17,1.22041633 0.228953736,1 0.496199727,0.999999999 L2.1394043,0.999999996 L2.1394043,2 L1,2 L1,6.55297852 L7.01586914,6.55297852 L7.01586914,2 L5.29744843,2 C5.1331722,2 5,1.86095428 5,1.70537567 L5,1.29462433 Z"></path>
|
||||
<path d="M2.35776811,2.72774174 C2.16017824,2.92540148 2,2.86372501 2,2.57610628 L2,0.509530088 C2,0.228124391 2.16507938,0.165079385 2.35776811,0.357768111 L3.18477734,1.18477734 C3.38236722,1.38236722 3.37746607,1.70768321 3.18477734,1.90044007 L2.35776811,2.72774174 Z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
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:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<svg width="10px" height="8px" viewBox="0 0 10 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<polygon id="Shape" fill="#CF405F" points="0.364181818 7.61593939 0.364181818 4.53030303 1.90672727 6.07284848"></polygon>
|
||||
<path d="M1.99181818,7.53030303 L8.546,7.53030303 C8.846,7.53030303 9.09145455,7.28484848 9.09145455,6.98484848 L9.09145455,6.98484848 C9.09145455,6.68484848 8.846,6.43939394 8.546,6.43939394 L3.08272727,6.43939394 L1.99181818,7.53030303 L1.99181818,7.53030303 Z M2.99763636,5.62121212 L8.546,5.62121212 C8.846,5.62121212 9.09145455,5.37575758 9.09145455,5.07575758 L9.09145455,5.07575758 C9.09145455,4.77575758 8.846,4.53030303 8.546,4.53030303 L1.90672727,4.53030303 L2.99763636,5.62121212 L2.99763636,5.62121212 Z" fill="#4EABFF"></path>
|
||||
<path d="M0.909090909,3.25757576 L8.546,3.25757576 C8.846,3.25757576 9.09145455,3.01212121 9.09145455,2.71212121 L9.09145455,2.71212121 C9.09145455,2.41212121 8.846,2.16666667 8.546,2.16666667 L0.909090909,2.16666667 C0.609090909,2.16666667 0.364181818,2.41212121 0.364181818,2.71212121 L0.364181818,2.71212121 C0.364181818,3.01212121 0.609090909,3.25757576 0.909090909,3.25757576 L0.909090909,3.25757576 L0.909090909,3.25757576 Z M0.909090909,1.34848485 L8.546,1.34848485 C8.846,1.34848485 9.09145455,1.10357576 9.09145455,0.803030303 L9.09145455,0.803030303 C9.09145455,0.503030303 8.846,0.257575758 8.546,0.257575758 L0.909090909,0.257575758 C0.609090909,0.257575758 0.364181818,0.503030303 0.364181818,0.803030303 L0.364181818,0.803030303 C0.364181818,1.10357576 0.609090909,1.34848485 0.909090909,1.34848485 L0.909090909,1.34848485 Z" fill="#808080"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2012-2016 Codenvy, S.A.
|
||||
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:
|
||||
Codenvy, S.A. - initial API and implementation
|
||||
|
||||
-->
|
||||
<svg width="8px" height="8px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect width="8" height="8" rx="0.5" fill="#808080"></rect>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 708 B |
|
|
@ -45,7 +45,6 @@ import org.eclipse.che.ide.extension.machine.client.machine.Machine;
|
|||
import org.eclipse.che.ide.extension.machine.client.outputspanel.console.CommandConsoleFactory;
|
||||
import org.eclipse.che.ide.extension.machine.client.outputspanel.console.CommandOutputConsole;
|
||||
import org.eclipse.che.ide.extension.machine.client.perspective.terminal.TerminalPresenter;
|
||||
import org.eclipse.che.ide.extension.machine.client.processes.event.ProcessFinishedEvent;
|
||||
import org.eclipse.che.ide.api.dialogs.DialogFactory;
|
||||
import org.eclipse.che.ide.api.dialogs.ConfirmDialog;
|
||||
import org.junit.Before;
|
||||
|
|
|
|||
Loading…
Reference in New Issue