Search in sources :

Example 1 with MachineItem

use of org.eclipse.che.ide.extension.machine.client.machine.MachineItem in project che by eclipse.

the class ProcessesPanelPresenter method printMachineOutput.

/**
     * Prints text to the machine console.
     *
     * @param machineName
     *         machine name
     * @param text
     *          text to be printed
     */
public void printMachineOutput(final String machineName, final String text) {
    // Create a temporary machine node to display outputs.
    if (!consoles.containsKey(machineName)) {
        MachineDto machineDto = dtoFactory.createDto(MachineDto.class).withId(machineName).withStatus(CREATING).withConfig(dtoFactory.createDto(MachineConfigDto.class).withDev("dev-machine".equals(machineName)).withName(machineName).withType("docker"));
        provideMachineNode(new MachineItem(machineDto), true);
    }
    OutputConsole console = consoles.get(machineName);
    if (console != null && console instanceof DefaultOutputConsole) {
        ((DefaultOutputConsole) console).printText(text);
    }
}
Also used : MachineDto(org.eclipse.che.api.machine.shared.dto.MachineDto) CommandOutputConsole(org.eclipse.che.ide.extension.machine.client.outputspanel.console.CommandOutputConsole) OutputConsole(org.eclipse.che.ide.api.outputconsole.OutputConsole) DefaultOutputConsole(org.eclipse.che.ide.extension.machine.client.outputspanel.console.DefaultOutputConsole) DefaultOutputConsole(org.eclipse.che.ide.extension.machine.client.outputspanel.console.DefaultOutputConsole) MachineItem(org.eclipse.che.ide.extension.machine.client.machine.MachineItem)

Aggregations

MachineDto (org.eclipse.che.api.machine.shared.dto.MachineDto)1 OutputConsole (org.eclipse.che.ide.api.outputconsole.OutputConsole)1 MachineItem (org.eclipse.che.ide.extension.machine.client.machine.MachineItem)1 CommandOutputConsole (org.eclipse.che.ide.extension.machine.client.outputspanel.console.CommandOutputConsole)1 DefaultOutputConsole (org.eclipse.che.ide.extension.machine.client.outputspanel.console.DefaultOutputConsole)1