Commit 005c7216 authored by Romain Bioteau's avatar Romain Bioteau

fix job dialog

parent 670cf09c
...@@ -34,12 +34,7 @@ import org.eclipse.core.runtime.IStatus; ...@@ -34,12 +34,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.IPreferenceConstants;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.progress.ProgressMonitorFocusJobDialog;
public abstract class AbstractOpenConsoleCommand extends AbstractHandler { public abstract class AbstractOpenConsoleCommand extends AbstractHandler {
...@@ -81,16 +76,7 @@ public abstract class AbstractOpenConsoleCommand extends AbstractHandler { ...@@ -81,16 +76,7 @@ public abstract class AbstractOpenConsoleCommand extends AbstractHandler {
} }
}; };
job.setUser(true); job.setUser(true);
boolean runInBackground = WorkbenchPlugin.getDefault().getPreferenceStore() job.schedule();
.getBoolean(IPreferenceConstants.RUN_IN_BACKGROUND);
if (!runInBackground) {
Shell activeShell = Display.getDefault().getActiveShell();
ProgressMonitorFocusJobDialog dialog = new ProgressMonitorFocusJobDialog(activeShell);
dialog.show(job, activeShell);
job.schedule();
} else {
job.schedule();
}
} }
} }
......
...@@ -44,9 +44,6 @@ import org.eclipse.jface.dialogs.MessageDialog; ...@@ -44,9 +44,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.IPreferenceConstants;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.progress.ProgressMonitorFocusJobDialog;
public class DeployDiagramHandler extends AbstractHandler { public class DeployDiagramHandler extends AbstractHandler {
...@@ -83,16 +80,7 @@ public class DeployDiagramHandler extends AbstractHandler { ...@@ -83,16 +80,7 @@ public class DeployDiagramHandler extends AbstractHandler {
} }
}); });
deployJob.setUser(true); deployJob.setUser(true);
boolean runInBackground = WorkbenchPlugin.getDefault().getPreferenceStore() deployJob.schedule();
.getBoolean(IPreferenceConstants.RUN_IN_BACKGROUND);
if (!runInBackground) {
Shell activeShell = Display.getDefault().getActiveShell();
ProgressMonitorFocusJobDialog dialog = new ProgressMonitorFocusJobDialog(activeShell);
dialog.show(deployJob, activeShell);
deployJob.schedule();
} else {
deployJob.schedule();
}
} }
return null; return null;
} }
......
...@@ -51,11 +51,9 @@ import org.eclipse.core.runtime.Status; ...@@ -51,11 +51,9 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.IPreferenceConstants; import org.eclipse.ui.internal.IPreferenceConstants;
import org.eclipse.ui.internal.WorkbenchPlugin; import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.progress.ProgressMonitorFocusJobDialog;
import org.eclipse.ui.progress.IProgressService; import org.eclipse.ui.progress.IProgressService;
public class RunProcessCommand extends AbstractHandler { public class RunProcessCommand extends AbstractHandler {
...@@ -135,16 +133,7 @@ public class RunProcessCommand extends AbstractHandler { ...@@ -135,16 +133,7 @@ public class RunProcessCommand extends AbstractHandler {
} }
}; };
job.setUser(true); job.setUser(true);
boolean runInBackground = WorkbenchPlugin.getDefault().getPreferenceStore() job.schedule();
.getBoolean(IPreferenceConstants.RUN_IN_BACKGROUND);
if (!runInBackground) {
Shell activeShell = Display.getDefault().getActiveShell();
ProgressMonitorFocusJobDialog dialog = new ProgressMonitorFocusJobDialog(activeShell);
dialog.show(job, activeShell);
job.schedule();
} else {
job.schedule();
}
} }
} catch (final Exception e) { } catch (final Exception e) {
BonitaStudioLog.error(e); BonitaStudioLog.error(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment