Current imports were set too early in SCLConsoleView which before the
SCLConsoleListener that enables the buttons is registered.
refs #7727
Change-Id: I7cb0645bea5dc48a4ad54f2147c83cb8dfb2f35f
(cherry picked from commit
dbe0a77f0869111219b69d412d0bb90d17c391c1)
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
- this.context = context;
+ Activator.context = context;
Bundle bundle = context.getBundle();
Bundle bundle = context.getBundle();
public void startedExecution() {
Simantics.getSession().markUndoPoint();
}
public void startedExecution() {
Simantics.getSession().markUndoPoint();
}
-
- @Override
- public void finishedExecution() {
- }
-
- @Override
- public void consoleIsNotEmptyAnymore() {
- }
}, properties);
context.registerService(ImportModulesAction.class, OntologyImportModulesAction.INSTANCE,
}, properties);
context.registerService(ImportModulesAction.class, OntologyImportModulesAction.INSTANCE,
package org.simantics.scl.compiler.commands;
public interface SCLConsoleListener {
package org.simantics.scl.compiler.commands;
public interface SCLConsoleListener {
- void startedExecution();
- void finishedExecution();
- void consoleIsNotEmptyAnymore();
+ default void startedExecution() {}
+ default void finishedExecution() {}
+ default void consoleIsNotEmptyAnymore() {}
store.setDefault(REFRESH_AUTOMATICALLY, true);
this.console = new SCLConsole(parent, SWT.NONE);
store.setDefault(REFRESH_AUTOMATICALLY, true);
this.console = new SCLConsole(parent, SWT.NONE);
-
- setRefreshAutomatically(store.getBoolean(REFRESH_AUTOMATICALLY), false);
- setCurrentImports(readImportPreferences());
-
- addScriptDropSupport(console);
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
// Show action for running SCL tests if in development mode
if (Platform.inDevelopmentMode()) {
toolBarManager.add(new Action("Run tests",
// Show action for running SCL tests if in development mode
if (Platform.inDevelopmentMode()) {
toolBarManager.add(new Action("Run tests",
}
toolBarManager.update(true);
}
toolBarManager.update(true);
+
+ setRefreshAutomatically(store.getBoolean(REFRESH_AUTOMATICALLY), false);
+ // Do this after the actions and SCLConsoleListener are
+ // registered because it can cause output to the console.
+ setCurrentImports(readImportPreferences());
+ addScriptDropSupport(console);
}
private class ScriptRunningDropTarget extends DropTargetAdapter {
}
private class ScriptRunningDropTarget extends DropTargetAdapter {
toolBarManager.add(clearAction);
console.addListener(new SCLConsoleListener() {
toolBarManager.add(clearAction);
console.addListener(new SCLConsoleListener() {
- @Override
- public void startedExecution() {
- }
- @Override
- public void finishedExecution() {
- }
@Override
public void consoleIsNotEmptyAnymore() {
clearAction.setEnabled(true);
@Override
public void consoleIsNotEmptyAnymore() {
clearAction.setEnabled(true);