Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-09-04 11:44:58 -0400
committerjmisinco2013-09-04 15:03:02 -0400
commit9dd618c7f653f53a5eb4254fd88cc87b56b74905 (patch)
treecbf3a2db95a5cc812fb0c4d27ad9b33434a43507
parentd7102d37ae30575121901fd0ba6339a3b52dfc50 (diff)
downloadorg.eclipse.osee-9dd618c7f653f53a5eb4254fd88cc87b56b74905.tar.gz
org.eclipse.osee-9dd618c7f653f53a5eb4254fd88cc87b56b74905.tar.xz
org.eclipse.osee-9dd618c7f653f53a5eb4254fd88cc87b56b74905.zip
feature[ats_6CNBM]: Improve replace with baseline version usability
Added a dialog operation to let the user know when replace with baseline completed and to refresh their change report since that does not happen automatically. Change-Id: I8a669e034bba696b1318826f248179ce242abc19
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ReplaceWithBaselineHandler.java32
1 files changed, 31 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ReplaceWithBaselineHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ReplaceWithBaselineHandler.java
index 66607ee0b8..c2659fd0d5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ReplaceWithBaselineHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ReplaceWithBaselineHandler.java
@@ -14,10 +14,12 @@ import java.util.Collection;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -25,7 +27,9 @@ import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.OperationBuilder;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -37,6 +41,7 @@ import org.eclipse.osee.framework.ui.skynet.blam.operation.ReplaceAttributeWithB
import org.eclipse.osee.framework.ui.skynet.change.view.ChangeReportEditor;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
import org.eclipse.osee.framework.ui.skynet.replace.ReplaceWithBaselineVersionDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
@@ -142,12 +147,17 @@ public class ReplaceWithBaselineHandler extends AbstractHandler {
ReplaceWithBaselineVersionDialog dialog = new ReplaceWithBaselineVersionDialog(artEnabled, attrEnabled);
if (dialog.open() == Window.OK) {
+ OperationBuilder builder = Operations.createBuilder("Replace with Baseline Version");
IOperation op =
dialog.isAttributeSelected() ? new ReplaceAttributeWithBaselineOperation(
Handlers.getArtifactChangesFromStructuredSelection(structuredSelection)) : new ReplaceArtifactWithBaselineOperation(
changes, Handlers.getArtifactsFromStructuredSelection(structuredSelection));
+ builder.addOp(op);
- Operations.executeAsJob(op, true, Job.LONG, adapter);
+ IOperation finishDialog = new ReplaceBaselineFinishDialog();
+ builder.addOp(finishDialog);
+
+ Operations.executeAsJob(builder.build(), true, Job.LONG, adapter);
}
} catch (Exception ex) {
@@ -155,4 +165,24 @@ public class ReplaceWithBaselineHandler extends AbstractHandler {
}
return null;
}
+
+ private static final class ReplaceBaselineFinishDialog extends AbstractOperation {
+
+ public ReplaceBaselineFinishDialog() {
+ super("Replace with Baseline Dialog", Activator.PLUGIN_ID);
+ }
+
+ @Override
+ protected void doWork(IProgressMonitor monitor) throws Exception {
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openInformation(Displays.getActiveShell(), "Replace with Baseline Version...",
+ "The operation successfully completed, please refresh any associated change reports.");
+ }
+ });
+ }
+
+ }
}

Back to the top