Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2011-02-22 18:33:09 +0000
committerRyan D. Brooks2011-02-22 18:33:09 +0000
commitd0e617f8a969cb1c26b52f3b361cdf07ad050c4d (patch)
treef4e30adf1b805feee28017eff561147404ecc27c /plugins
parent20cd8b7cee6ee90f8530207d0b8fa1e732297a61 (diff)
downloadorg.eclipse.osee-d0e617f8a969cb1c26b52f3b361cdf07ad050c4d.tar.gz
org.eclipse.osee-d0e617f8a969cb1c26b52f3b361cdf07ad050c4d.tar.xz
org.eclipse.osee-d0e617f8a969cb1c26b52f3b361cdf07ad050c4d.zip
refactor: Allow a BLAM to create and use its own custom operation
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java20
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java2
3 files changed, 16 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
index 9cd71a5223a..3d5a693d12e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
@@ -273,7 +273,7 @@ public class CoverageEditorImportTab extends FormPage {
}
coverageImport = null;
- getBlam().execute(getBlam().getName(), blamOutputSection.getOutput(), blamInputSection.getData(),
+ getBlam().execute(blamOutputSection.getOutput(), blamInputSection.getData(),
new BlamEditorExecutionAdapter(getBlam().getName()));
} catch (Exception ex) {
OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
index 6b9b6ffa492..63cd111b514 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
@@ -20,10 +20,11 @@ import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -53,7 +54,14 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
public static final String emptyXWidgetsXml = "<xWidgets/>";
protected IOseeDatabaseService databaseService;
- public abstract void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception;
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ throw new OseeStateException(
+ "either runOperation or createOperation but be overriden by subclesses of AbstractBlam");
+ }
+
+ public IOperation createOperation(VariableMap variableMap, Appendable appendable) throws Exception {
+ return new ExecuteBlamOperation(getName(), appendable, variableMap, this);
+ }
/**
* Return collection of categories that blam belongs to eg: ATS, ATS.Admin, ATS.Report. These will be used to create
@@ -67,7 +75,7 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
/**
* Expects the {@code <className>} of blam. Gets {@code /bundleName/ui/<className>Ui.xml } and returns its contents.
- *
+ *
* @param className class name of blam
* @param nameOfBundle name of bundle i.e. org.eclipse.rcp.xyz
* @return contents of the {@code /bundleName/ui/<className>Ui.xml }
@@ -126,10 +134,10 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
}
}
- public void execute(String jobName, Appendable appendable, VariableMap variableMap, JobChangeAdapter jobChangeAdapter) {
+ public void execute(Appendable appendable, VariableMap variableMap, IJobChangeListener jobChangeListener) {
try {
- IOperation blamOperation = new ExecuteBlamOperation(jobName, appendable, variableMap, this);
- Operations.executeAsJob(blamOperation, true, Job.LONG, jobChangeAdapter);
+ IOperation blamOperation = createOperation(variableMap, appendable);
+ Operations.executeAsJob(blamOperation, true, Job.LONG, jobChangeListener);
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java
index e030527d34c..2731e3fe3fd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/BlamEditor.java
@@ -91,7 +91,7 @@ public class BlamEditor extends FormEditor implements IDirtiableEditor {
}
public void executeBlam() throws OseeArgumentException {
- getEditorInput().getBlamOperation().execute(getPartName(), overviewPage.getOutput(), getBlamVariableMap(),
+ getEditorInput().getBlamOperation().execute(overviewPage.getOutput(), getBlamVariableMap(),
new BlamEditorExecutionAdapter());
}

Back to the top