use of org.talend.designer.esb.runcontainer.server.RuntimeStatusChangeListener 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