use of org.talend.designer.esb.runcontainer.ui.actions.StartRuntimeAction in project tesb-studio-se by Talend.
the class ESBRuntimeConsoleFactory method openConsole.
@Override
public void openConsole() {
if (RuntimeServerController.getInstance().isRunning()) {
RuntimeConsoleUtil.loadConsole();
} else {
Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
if (MessageDialog.openConfirm(shell, "ESB Runtime Console", "ESB Runtime Server is not running, do you want to start it?")) {
new StartRuntimeAction(true, shell).run();
RuntimeConsoleUtil.loadConsole();
} else {
RuntimeConsoleUtil.findConsole();
}
}
}
use of org.talend.designer.esb.runcontainer.ui.actions.StartRuntimeAction in project tesb-studio-se by Talend.
the class ESBRuntimeConsolePageParticipant method init.
@Override
public void init(IPageBookViewPage page, IConsole console) {
if (page.getControl() instanceof StyledText) {
StyledText viewer = (StyledText) page.getControl();
AnsiConsoleStyleListener myListener = new AnsiConsoleStyleListener();
viewer.addLineStyleListener(myListener);
ESBRunContainerPlugin.getDefault().addViewer(viewer, this);
}
startRuntimeAction = new StartRuntimeAction(true, page.getControl().getShell());
haltRuntimeAction = new StopRuntimeAction(page.getControl().getShell());
openRuntimeInfoAction = new OpenRuntimeInfoAction();
openRuntimePrefsAction = new OpenRuntimePrefsAction();
serverListener = new RuntimeStatusChangeListener() {
@Override
public void stopRunning() {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
startRuntimeAction.setEnabled(true);
haltRuntimeAction.setEnabled(false);
openRuntimeInfoAction.setEnabled(false);
}
});
}
@Override
public void startRunning() {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
startRuntimeAction.setEnabled(false);
haltRuntimeAction.setEnabled(true);
openRuntimeInfoAction.setEnabled(true);
}
});
}
@Override
public void featureUninstalled(int id) {
}
@Override
public void featureInstalled(int id) {
}
};
RuntimeServerController.getInstance().addStatusChangeListener(serverListener);
IActionBars actionBars = page.getSite().getActionBars();
configureToolBar(actionBars.getToolBarManager());
}
Aggregations