Search in sources :

Example 6 with WidgetToShow

use of org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow in project che by eclipse.

the class SubPanelViewImpl method onTabDoubleClicked.

@Override
public void onTabDoubleClicked(Tab tab) {
    final WidgetToShow widget = tabs2Widgets.get(tab);
    if (widget != null) {
        activateWidget(widget);
        delegate.onWidgetDoubleClicked(widget.getWidget());
    }
}
Also used : WidgetToShow(org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow)

Example 7 with WidgetToShow

use of org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow in project che by eclipse.

the class ProcessesPanelViewImpl method addWidget.

@Override
public void addWidget(final String processId, final String title, final SVGResource icon, final IsWidget widget, final boolean machineConsole) {
    final WidgetToShow widgetToShow = new WidgetToShow() {

        @Override
        public IsWidget getWidget() {
            return widget;
        }

        @Override
        public String getTitle() {
            return title;
        }

        @Override
        public SVGResource getIcon() {
            return icon;
        }
    };
    widget2Panels.put(widgetToShow, focusedSubPanel);
    focusedSubPanel.addWidget(widgetToShow, !machineConsole, new SubPanel.WidgetRemovingListener() {

        @Override
        public void onWidgetRemoving(SubPanel.RemoveCallback removeCallback) {
            final ProcessTreeNode treeNode = widget2TreeNodes.get(widgetToShow.getWidget());
            if (treeNode == null) {
                return;
            }
            switch(treeNode.getType()) {
                case COMMAND_NODE:
                    delegate.onCommandTabClosing(treeNode, removeCallback);
                    break;
                case TERMINAL_NODE:
                    delegate.onTerminalTabClosing(treeNode);
                    removeCallback.remove();
                    break;
                case MACHINE_NODE:
                    removeCallback.remove();
                    break;
            }
        }
    });
    processWidgets.put(processId, widgetToShow);
    widget2TreeNodes.put(widgetToShow.getWidget(), processTreeNodes.get(processId));
    showProcessOutput(processId);
}
Also used : WidgetToShow(org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow) ProcessTreeNode(org.eclipse.che.ide.extension.machine.client.processes.ProcessTreeNode) SubPanel(org.eclipse.che.ide.ui.multisplitpanel.SubPanel)

Example 8 with WidgetToShow

use of org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow in project che by eclipse.

the class ProcessesPanelViewImpl method hideProcessOutput.

@Override
public void hideProcessOutput(String processId) {
    final WidgetToShow widgetToShow = processWidgets.get(processId);
    final SubPanel subPanel = widget2Panels.get(widgetToShow);
    if (subPanel != null) {
        subPanel.removeWidget(widgetToShow);
    }
    processWidgets.remove(processId);
}
Also used : WidgetToShow(org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow) SubPanel(org.eclipse.che.ide.ui.multisplitpanel.SubPanel)

Aggregations

WidgetToShow (org.eclipse.che.ide.ui.multisplitpanel.WidgetToShow)8 SubPanel (org.eclipse.che.ide.ui.multisplitpanel.SubPanel)4 ProcessTreeNode (org.eclipse.che.ide.extension.machine.client.processes.ProcessTreeNode)2 Tab (org.eclipse.che.ide.ui.multisplitpanel.tab.Tab)2 Action (org.eclipse.che.ide.api.action.Action)1 ClosePaneAction (org.eclipse.che.ide.ui.multisplitpanel.actions.ClosePaneAction)1 RemoveAllWidgetsInPaneAction (org.eclipse.che.ide.ui.multisplitpanel.actions.RemoveAllWidgetsInPaneAction)1 SplitHorizontallyAction (org.eclipse.che.ide.ui.multisplitpanel.actions.SplitHorizontallyAction)1 SplitVerticallyAction (org.eclipse.che.ide.ui.multisplitpanel.actions.SplitVerticallyAction)1