diff options
author | jmisinco | 2012-10-04 18:38:05 +0000 |
---|---|---|
committer | jmisinco | 2012-10-08 17:22:44 +0000 |
commit | 02d6cda1b525da3a9e0b506d12f1e9162e84f931 (patch) | |
tree | e99b6f5b709f43581953536d8b9ef6ca00ab9f8f /plugins | |
parent | c6be67e2a391b69c0470c2e6f7b147cf54f5ac05 (diff) | |
download | org.eclipse.osee-02d6cda1b525da3a9e0b506d12f1e9162e84f931.tar.gz org.eclipse.osee-02d6cda1b525da3a9e0b506d12f1e9162e84f931.tar.xz org.eclipse.osee-02d6cda1b525da3a9e0b506d12f1e9162e84f931.zip |
bug[ats_GTB5H]: Command handlers causing NPE in empty perspectives
Diffstat (limited to 'plugins')
62 files changed, 340 insertions, 361 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWEHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWEHandler.java index cb93055080c..c737240485d 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWEHandler.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/renderer/AtsWEHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ats.editor.renderer; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class AtsWEHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { if (!artifacts.isEmpty()) { AtsWERenderer renderer = new AtsWERenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/export/AtsExportHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/export/AtsExportHandler.java index 456f285a8af..d3aee3b8b3f 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/export/AtsExportHandler.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/export/AtsExportHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ats.export; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class AtsExportHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { AtsExportRenderer renderer = new AtsExportRenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorHandler.java index c66f1f722dd..99b7b60c780 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorHandler.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ats.task; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class AtsTaskEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { AtsTaskEditorRenderer renderer = new AtsTaskEditorRenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslHandler.java index b23412bef30..473fe50adf2 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslHandler.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/editor/AtsWorkDefinitionDslHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ats.workdef.editor; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class AtsWorkDefinitionDslHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { AtsWorkDefinitionDslRenderer renderer = new AtsWorkDefinitionDslRenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefViewerHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefViewerHandler.java index cff40222e7b..898fdb018bf 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefViewerHandler.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/AtsWorkDefViewerHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ats.workdef.viewer; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class AtsWorkDefViewerHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { if (!artifacts.isEmpty()) { AtsWorkDefConfigRenderer renderer = new AtsWorkDefConfigRenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/EditAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/EditAction.java index 3fdba4fb8d5..f9a49ccfc9d 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/EditAction.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/viewer/EditAction.java @@ -12,7 +12,7 @@ package org.eclipse.osee.ats.workdef.viewer; import java.util.Iterator; import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.ats.api.data.AtsArtifactTypes; import org.eclipse.osee.ats.internal.Activator; @@ -29,6 +29,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; +import org.eclipse.ui.PlatformUI; /** * @author Donald G. Dunne @@ -48,11 +49,9 @@ public class EditAction extends Action { @Override public void run() { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); - - if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider.getSelection(); + ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); + if (selection instanceof IStructuredSelection) { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; try { Iterator<?> i = structuredSelection.iterator(); diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorHandler.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorHandler.java index cce3556f722..174619d7db1 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorHandler.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsWorldEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.ats.world; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class AtsWorldEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { if (!artifacts.isEmpty()) { AtsWorldEditorRenderer renderer = new AtsWorldEditorRenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorHandler.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorHandler.java index fa4df54935e..6c399bc2bd7 100644 --- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorHandler.java +++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.coverage.editor; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class CoverageEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { CoverageRenderer renderer = new CoverageRenderer(); renderer.open(artifacts, PresentationType.SPECIALIZED_EDIT); diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java index dac472db28b..097cea75c02 100644 --- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.core.dsl.ui.integration.internal; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -22,7 +23,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class OseeDslEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java index 616b9bb097d..849c8c19ef9 100644 --- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java +++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/OpenBranchGraph.java @@ -12,45 +12,41 @@ package org.eclipse.osee.framework.ui.branch.graph; import java.util.List; import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.ui.branch.graph.core.BranchGraphEditor; import org.eclipse.osee.framework.ui.branch.graph.core.BranchGraphEditorInput; -import org.eclipse.osee.framework.ui.skynet.commandHandlers.AbstractSelectionChangedHandler; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.ui.PlatformUI; /** * @author Roberto E. Escobar */ -public class OpenBranchGraph extends AbstractSelectionChangedHandler { +public class OpenBranchGraph extends CommandHandler { public OpenBranchGraph() { super(); } @Override - public Object execute(ExecutionEvent event) throws ExecutionException { + public boolean isEnabledWithException(IStructuredSelection structuredSelection) { + return true; + } + + @Override + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { try { - ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection(); - if (selection instanceof IStructuredSelection) { - List<? extends IOseeBranch> branches = - Handlers.getBranchesFromStructuredSelection((IStructuredSelection) selection); - if (!branches.isEmpty()) { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor( - new BranchGraphEditorInput(branches.iterator().next()), BranchGraphEditor.EDITOR_ID); - } + List<? extends IOseeBranch> branches = Handlers.getBranchesFromStructuredSelection(selection); + if (!branches.isEmpty()) { + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor( + new BranchGraphEditorInput(branches.iterator().next()), BranchGraphEditor.EDITOR_ID); } } catch (Exception ex) { - throw new ExecutionException("Error opening Branch Graph Editor", ex); + OseeExceptions.wrapAndThrow(ex); } return null; } - - @Override - public boolean isEnabled() { - return true; - } } diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/OpenODMEditor.java b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/OpenODMEditor.java index baf36655432..9d06ab675b6 100644 --- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/OpenODMEditor.java +++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/OpenODMEditor.java @@ -11,37 +11,39 @@ package org.eclipse.osee.framework.ui.data.model.editor; import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.ui.data.model.editor.core.ODMEditor; import org.eclipse.osee.framework.ui.data.model.editor.core.ODMEditorInput; -import org.eclipse.osee.framework.ui.skynet.commandHandlers.AbstractSelectionChangedHandler; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.PlatformUI; /** * @author Roberto E. Escobar */ -public class OpenODMEditor extends AbstractSelectionChangedHandler { +public class OpenODMEditor extends CommandHandler { public OpenODMEditor() { super(); } @Override - public Object execute(ExecutionEvent event) throws ExecutionException { + public boolean isEnabledWithException(IStructuredSelection structuredSelection) { + return true; + } + + @Override + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { IEditorPart editorPart = null; try { editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new ODMEditorInput(), ODMEditor.EDITOR_ID); } catch (Exception ex) { - throw new ExecutionException("Error opening Branch Editor", ex); + OseeExceptions.wrapAndThrow(ex); } return editorPart; } - - @Override - public boolean isEnabled() { - return true; - } } diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CommandHandler.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CommandHandler.java index 1fce601497a..429a0d2bdc8 100644 --- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CommandHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CommandHandler.java @@ -48,21 +48,26 @@ public abstract class CommandHandler extends AbstractHandler { return result; } - public abstract boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException; + protected abstract boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException; @Override public final Object execute(ExecutionEvent event) throws ExecutionException { try { - return executeWithException(event); - } catch (OseeCoreException ex) { + IStructuredSelection selection = getCurrentSelection(); + Object result = null; + if (selection != null) { + result = executeWithException(event, selection); + } + return result; + } catch (Exception ex) { throw new ExecutionException("Error executing command handler: ", ex); } } - public abstract Object executeWithException(ExecutionEvent event) throws OseeCoreException; + protected abstract Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException; - public static IStructuredSelection getCurrentSelection() throws Exception { - IStructuredSelection structuredSelection = null; + protected ISelectionProvider getSelectionProvider() { + ISelectionProvider selectionProvider = null; IWorkbench workbench = PlatformUI.getWorkbench(); if (!workbench.isStarting() && !workbench.isClosing()) { IWorkbenchPage page = AWorkbench.getActivePage(); @@ -71,17 +76,24 @@ public abstract class CommandHandler extends AbstractHandler { if (part != null) { IWorkbenchSite site = part.getSite(); if (site != null) { - ISelectionProvider selectionProvider = site.getSelectionProvider(); - if (selectionProvider != null) { - ISelection selection = selectionProvider.getSelection(); - if (selection instanceof IStructuredSelection) { - structuredSelection = (IStructuredSelection) selection; - } - } + selectionProvider = site.getSelectionProvider(); } } } } + return selectionProvider; + } + + private IStructuredSelection getCurrentSelection() throws Exception { + IStructuredSelection structuredSelection = null; + ISelectionProvider selectionProvider = getSelectionProvider(); + if (selectionProvider != null) { + ISelection selection = selectionProvider.getSelection(); + if (selection instanceof IStructuredSelection) { + structuredSelection = (IStructuredSelection) selection; + } + } + return structuredSelection; } } diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CompoundContributionProvider.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CompoundContributionProvider.java new file mode 100644 index 00000000000..390909089c0 --- /dev/null +++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/CompoundContributionProvider.java @@ -0,0 +1,43 @@ +/* + * Created on Oct 4, 2012 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.ui.plugin.util; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.CompoundContributionItem; + +public abstract class CompoundContributionProvider extends CompoundContributionItem { + + public CompoundContributionProvider(String id) { + super(id); + } + + public CompoundContributionProvider() { + //do nothing + } + + protected ISelectionProvider getSelectionProvider() { + ISelectionProvider selectionProvider = null; + IWorkbench workbench = PlatformUI.getWorkbench(); + if (!workbench.isStarting() && !workbench.isClosing()) { + IWorkbenchPage page = AWorkbench.getActivePage(); + if (page != null) { + IWorkbenchPart part = page.getActivePart(); + if (part != null) { + IWorkbenchSite site = part.getSite(); + if (site != null) { + selectionProvider = site.getSelectionProvider(); + } + } + } + } + return selectionProvider; + } +} diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java index 8b723327c9b..e5cd7fa78c7 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/WasIsCompareEditorAction.java @@ -13,6 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.action; import java.util.List; import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -24,8 +25,11 @@ import org.eclipse.osee.framework.ui.skynet.FrameworkImage; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.compare.CompareHandler; import org.eclipse.osee.framework.ui.skynet.compare.CompareItem; -import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.osee.framework.ui.swt.ImageManager; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchSite; import org.eclipse.ui.PlatformUI; /** @@ -45,11 +49,10 @@ public class WasIsCompareEditorAction extends Action { @Override public void run() { try { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); - - if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider.getSelection(); + ISelection selection = + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); + if (selection instanceof IStructuredSelection) { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; List<Change> localChanges = Handlers.getArtifactChangesFromStructuredSelection(structuredSelection); if (localChanges.isEmpty() || localChanges.size() > 1) { @@ -68,8 +71,8 @@ public class WasIsCompareEditorAction extends Action { return; } CompareHandler compareHandler = - new CompareHandler(null, new CompareItem("Was", was, System.currentTimeMillis()), new CompareItem("Is", is, - System.currentTimeMillis()), null); + new CompareHandler(null, new CompareItem("Was", was, System.currentTimeMillis()), new CompareItem("Is", + is, System.currentTimeMillis()), null); compareHandler.compare(); } } catch (Exception ex) { @@ -77,22 +80,37 @@ public class WasIsCompareEditorAction extends Action { } } + private static ISelectionProvider getSelectionProvider() { + ISelectionProvider selectionProvider = null; + IWorkbench workbench = PlatformUI.getWorkbench(); + if (!workbench.isStarting() && !workbench.isClosing()) { + IWorkbenchPage page = AWorkbench.getActivePage(); + if (page != null) { + IWorkbenchPart part = page.getActivePart(); + if (part != null) { + IWorkbenchSite site = part.getSite(); + if (site != null) { + selectionProvider = site.getSelectionProvider(); + } + } + } + } + return selectionProvider; + } + public static boolean isEnabledStatic() { if (PlatformUI.getWorkbench().isClosing()) { return false; } boolean isEnabled = false; - try { - if (AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider() != null && AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection() instanceof IStructuredSelection) { - IStructuredSelection selectionProvider = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); - isEnabled = selectionProvider.size() == 1; + ISelectionProvider selectionProvider = getSelectionProvider(); + if (selectionProvider != null) { + ISelection selection = selectionProvider.getSelection(); + if (selection instanceof IStructuredSelection) { + isEnabled = ((IStructuredSelection) selection).size() == 1; } - } catch (Exception ex) { - OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } return isEnabled; } - } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AbstractSelectionChangedHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AbstractSelectionChangedHandler.java index 4716b5a9eed..21c6d1151fd 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AbstractSelectionChangedHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AbstractSelectionChangedHandler.java @@ -10,10 +10,10 @@ *******************************************************************************/ package org.eclipse.osee.framework.ui.skynet.commandHandlers; -import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.HandlerEvent; import org.eclipse.jface.viewers.Viewer; import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.swt.events.MenuDetectEvent; import org.eclipse.swt.events.MenuDetectListener; import org.eclipse.ui.IWorkbench; @@ -24,7 +24,7 @@ import org.eclipse.ui.PlatformUI; * @author Paul K. Waldfogel * @author Jeff C. Phillips */ -public abstract class AbstractSelectionChangedHandler extends AbstractHandler { +public abstract class AbstractSelectionChangedHandler extends CommandHandler { private final HandlerEvent enabledChangedEvent = new HandlerEvent(this, true, false); private ViewerMenuDetectListener viewerMenuDetectListener; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java index d9d087caae4..44fbbde18a7 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/AccessControlHandler.java @@ -29,7 +29,7 @@ public class AccessControlHandler extends CommandHandler { private Object object; @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { PolicyDialog pd = new PolicyDialog(Displays.getActiveShell(), object); pd.open(); return null; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java index 2f95cb8a9af..b25130beda9 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ChangeReportHandler.java @@ -11,7 +11,6 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; -import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.data.IOseeBranch; @@ -19,20 +18,34 @@ import org.eclipse.osee.framework.core.enums.TransactionDetailsType; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.change.ChangeUiUtil; import org.eclipse.osee.framework.ui.skynet.internal.Activator; -import org.eclipse.ui.PlatformUI; /** * @author Jeff C. Phillips */ -public class ChangeReportHandler extends AbstractHandler { +public class ChangeReportHandler extends CommandHandler { @Override - public Object execute(ExecutionEvent arg0) { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public boolean isEnabledWithException(IStructuredSelection structuredSelection) { + boolean enabled = false; + + if (!structuredSelection.isEmpty()) { + Object selectedObject = structuredSelection.getFirstElement(); + + if (selectedObject instanceof TransactionRecord) { + enabled = ((TransactionRecord) selectedObject).getTxType() != TransactionDetailsType.Baselined; + } else if (selectedObject instanceof IOseeBranch) { + enabled = true; + } + } + + return enabled; + } + + @Override + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { if (!selection.isEmpty()) { Object selectedObject = selection.getFirstElement(); try { @@ -47,26 +60,4 @@ public class ChangeReportHandler extends AbstractHandler { } return null; } - - @Override - public boolean isEnabled() { - if (PlatformUI.getWorkbench().isClosing()) { - return false; - } - boolean enabled = false; - - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); - if (!selection.isEmpty()) { - Object selectedObject = selection.getFirstElement(); - - if (selectedObject instanceof TransactionRecord) { - enabled = ((TransactionRecord) selectedObject).getTxType() != TransactionDetailsType.Baselined; - } else if (selectedObject instanceof IOseeBranch) { - enabled = true; - } - } - - return enabled; - } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CollapseTreeHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CollapseTreeHandler.java index e9e248e4301..f16955678e8 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CollapseTreeHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CollapseTreeHandler.java @@ -11,34 +11,29 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; -import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; -import org.eclipse.ui.PlatformUI; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; /** * @author Theron Virgin */ -public class CollapseTreeHandler extends AbstractHandler { +public class CollapseTreeHandler extends CommandHandler { private TreeViewer treeViewer; @Override - public Object execute(ExecutionEvent arg0) { - treeViewer.collapseAll(); - return null; - } - - @Override - public boolean isEnabled() { - if (PlatformUI.getWorkbench().isClosing()) { - return false; - } - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); + protected boolean isEnabledWithException(IStructuredSelection structuredSelection) { + ISelectionProvider selectionProvider = getSelectionProvider(); treeViewer = selectionProvider instanceof TreeViewer ? (TreeViewer) selectionProvider : null; return treeViewer != null; } + + @Override + protected Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { + treeViewer.collapseAll(); + return null; + } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java index 0b4b14db21f..77e02dc11d8 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/CompressWordAttributesHandler.java @@ -11,23 +11,20 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import java.util.List; -import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.access.AccessControlManager; import org.eclipse.osee.framework.core.enums.PermissionEnum; -import org.eclipse.osee.framework.logging.OseeLevel; -import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.plugin.core.util.Jobs; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.word.WordUtil; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.osee.framework.ui.swt.Displays; import org.eclipse.ui.PlatformUI; @@ -35,11 +32,23 @@ import org.eclipse.ui.PlatformUI; /** * @author Paul K. Waldfogel */ -public class CompressWordAttributesHandler extends AbstractHandler { +public class CompressWordAttributesHandler extends CommandHandler { private List<Artifact> artifacts; @Override - public Object execute(ExecutionEvent event) { + public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { + boolean enabled = false; + artifacts = Handlers.getArtifactsFromStructuredSelection(structuredSelection); + + if (!artifacts.isEmpty()) { + boolean writePermission = AccessControlManager.hasPermission(artifacts.get(0), PermissionEnum.WRITE); + enabled = writePermission && AccessControlManager.isOseeAdmin(); + } + return enabled; + } + + @Override + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { Jobs.startJob(new Job("Compress Word Attributes") { @Override @@ -81,30 +90,4 @@ public class CompressWordAttributesHandler extends AbstractHandler { }); return null; } - - @Override - public boolean isEnabled() { - boolean enabled = false; - if (PlatformUI.getWorkbench().isClosing()) { - return false; - } - try { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); - - if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider.getSelection(); - artifacts = Handlers.getArtifactsFromStructuredSelection(structuredSelection); - - if (!artifacts.isEmpty()) { - boolean writePermission = AccessControlManager.hasPermission(artifacts.get(0), PermissionEnum.WRITE); - enabled = writePermission && AccessControlManager.isOseeAdmin(); - } - } - } catch (Exception ex) { - OseeLog.log(getClass(), OseeLevel.SEVERE_POPUP, ex); - enabled = false; - } - return enabled; - } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/DeleteArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/DeleteArtifactHandler.java index d36f8d9d4d8..7b6fcc3ebb8 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/DeleteArtifactHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/DeleteArtifactHandler.java @@ -32,7 +32,7 @@ public class DeleteArtifactHandler extends CommandHandler { private List<Artifact> artifacts; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { MessageDialog dialog = new MessageDialog(Displays.getActiveShell(), "Confirm Artifact Deletion", null, diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ExpandTreeHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ExpandTreeHandler.java index a919b39b77c..bf8b57fae31 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ExpandTreeHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ExpandTreeHandler.java @@ -12,44 +12,33 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import java.util.Iterator; -import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; -import org.eclipse.ui.PlatformUI; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; /** * @author Theron Virgin */ -public class ExpandTreeHandler extends AbstractHandler { +public class ExpandTreeHandler extends CommandHandler { private TreeViewer treeViewer; - private IStructuredSelection structuredSelection; @Override - public Object execute(ExecutionEvent arg0) { - Iterator<?> iter = structuredSelection.iterator(); - while (iter.hasNext()) { - treeViewer.expandToLevel(iter.next(), AbstractTreeViewer.ALL_LEVELS); - } - return null; + protected boolean isEnabledWithException(IStructuredSelection structuredSelection) { + ISelectionProvider selectionProvider = getSelectionProvider(); + treeViewer = selectionProvider instanceof TreeViewer ? (TreeViewer) selectionProvider : null; + + return treeViewer != null && structuredSelection != null; } @Override - public boolean isEnabled() { - if (PlatformUI.getWorkbench().isClosing()) { - return false; - } - structuredSelection = null; - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); - treeViewer = selectionProvider instanceof TreeViewer ? (TreeViewer) selectionProvider : null; - - if (treeViewer != null && treeViewer.getSelection() instanceof IStructuredSelection) { - structuredSelection = (IStructuredSelection) selectionProvider.getSelection(); + protected Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { + Iterator<?> iter = selection.iterator(); + while (iter.hasNext()) { + treeViewer.expandToLevel(iter.next(), AbstractTreeViewer.ALL_LEVELS); } - return treeViewer != null && structuredSelection != null; + return null; } } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java index 1ec162d6883..3d235d0aaad 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java @@ -10,43 +10,33 @@ *******************************************************************************/ package org.eclipse.osee.framework.ui.skynet.commandHandlers; -import java.util.Collections; import java.util.List; -import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.data.IOseeBranch; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer; /** * @author Roberto E. Escobar */ -public class OpenArtifactExplorerHandler extends AbstractHandler { +public class OpenArtifactExplorerHandler extends CommandHandler { - private List<? extends IOseeBranch> getSelectedBranches() { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); + private List<? extends IOseeBranch> getSelectedBranches(IStructuredSelection selection) { + return Handlers.getBranchesFromStructuredSelection(selection); + } - if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selectionProvider.getSelection(); - return Handlers.getBranchesFromStructuredSelection(structuredSelection); - } - return Collections.emptyList(); + @Override + public boolean isEnabledWithException(IStructuredSelection structuredSelection) { + return !getSelectedBranches(structuredSelection).isEmpty(); } @Override - public Object execute(ExecutionEvent arg0) { - List<? extends IOseeBranch> branches = getSelectedBranches(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { + List<? extends IOseeBranch> branches = getSelectedBranches(selection); if (!branches.isEmpty()) { ArtifactExplorer.exploreBranch(branches.iterator().next()); } return null; } - - @Override - public boolean isEnabled() { - return !getSelectedBranches().isEmpty(); - } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenMassArtifactEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenMassArtifactEditorHandler.java index f982931d66e..431aec137a9 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenMassArtifactEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenMassArtifactEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.IRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -22,7 +23,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class OpenMassArtifactEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent arg0) { + public Object executeWithException(ExecutionEvent arg0, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.GENERALIZED_EDIT, IRenderer.OPEN_IN_TABLE_EDITOR, Boolean.TRUE); return null; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenSkywalkerEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenSkywalkerEditorHandler.java index 00fb2e26bd7..9878052b388 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenSkywalkerEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenSkywalkerEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.IRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -22,7 +23,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class OpenSkywalkerEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.GENERALIZED_EDIT, IRenderer.OPEN_IN_GRAPH, Boolean.TRUE); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java index f7e4440be0d..347707c9555 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/PurgeArtifactHandler.java @@ -38,7 +38,7 @@ public class PurgeArtifactHandler extends CommandHandler { private List<Artifact> artifacts; @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { if (MessageDialog.openConfirm( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Confirm Artifact Purge ", diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevealInArtifactExplorer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevealInArtifactExplorer.java index 7ce8fe2652b..2913621a4c3 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevealInArtifactExplorer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/RevealInArtifactExplorer.java @@ -12,6 +12,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.IRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -23,7 +24,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class RevealInArtifactExplorer extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.GENERALIZED_EDIT, IRenderer.OPEN_IN_EXPLORER, Boolean.TRUE); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowArtifactInResourceHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowArtifactInResourceHandler.java index 03eae12c3fc..bca9966c9cb 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowArtifactInResourceHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/ShowArtifactInResourceHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers.AbstractEditorHandler; import org.eclipse.osee.framework.ui.skynet.render.IRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -22,7 +23,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class ShowArtifactInResourceHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.GENERALIZED_EDIT, IRenderer.OPEN_IN_HISTORY, Boolean.TRUE); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchCompoundContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchCompoundContributionItem.java index 8f1dfd0f752..7142a66de4a 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchCompoundContributionItem.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchCompoundContributionItem.java @@ -20,13 +20,12 @@ import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.model.Branch; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CompoundContributionProvider; import org.eclipse.osee.framework.ui.skynet.FrameworkImage; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.swt.ImageManager; import org.eclipse.swt.SWT; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.CompoundContributionItem; import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.menus.CommandContributionItem; import org.eclipse.ui.menus.CommandContributionItemParameter; @@ -34,7 +33,7 @@ import org.eclipse.ui.menus.CommandContributionItemParameter; /** * @author Jeff C. Phillips */ -public class ArchiveBranchCompoundContributionItem extends CompoundContributionItem { +public class ArchiveBranchCompoundContributionItem extends CompoundContributionProvider { private ICommandService commandService; public ArchiveBranchCompoundContributionItem() { @@ -47,8 +46,7 @@ public class ArchiveBranchCompoundContributionItem extends CompoundContributionI @Override protected IContributionItem[] getContributionItems() { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); + ISelectionProvider selectionProvider = getSelectionProvider(); ArrayList<IContributionItem> contributionItems = new ArrayList<IContributionItem>(40); if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java index 219b3db2993..386ad0fc25b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ArchiveBranchHandler.java @@ -24,7 +24,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.event.OseeEventManager; import org.eclipse.osee.framework.skynet.core.event.model.BranchEvent; import org.eclipse.osee.framework.skynet.core.event.model.BranchEventType; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; @@ -40,9 +39,7 @@ public class ArchiveBranchHandler extends CommandHandler { } @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Collection<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection); for (Branch branch : branches) { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java index 0456c77f924..40accb6930d 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/BranchCreationHandler.java @@ -28,7 +28,6 @@ import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable; import org.eclipse.osee.framework.plugin.core.util.Jobs; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryCheckDialog; @@ -42,9 +41,7 @@ import org.eclipse.osee.framework.ui.swt.Displays; public class BranchCreationHandler extends CommandHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Object backingData = selection.getFirstElement(); final TransactionRecord parentTransactionId; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java index fed76959b2e..7532afde8e9 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/GeneralBranchHandler.java @@ -23,7 +23,6 @@ import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.util.Strings; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.swt.Displays; @@ -53,11 +52,8 @@ public abstract class GeneralBranchHandler extends CommandHandler { public abstract void performOperation(final List<Branch> branches); @Override - public Object executeWithException(ExecutionEvent arg0) throws OseeCoreException { - IStructuredSelection selections = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); - - List<Branch> selectedBranches = Handlers.getBranchesFromStructuredSelection(selections); + public Object executeWithException(ExecutionEvent arg0, IStructuredSelection selection) throws OseeCoreException { + List<Branch> selectedBranches = Handlers.getBranchesFromStructuredSelection(selection); Iterator<Branch> iterator = selectedBranches.iterator(); List<Branch> hasChildren = new LinkedList<Branch>(); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java index ff72b6dc3ba..f84a56513c0 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/OpenAssociatedArtifactHandler.java @@ -39,9 +39,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class OpenAssociatedArtifactHandler extends CommandHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Branch selectedBranch = Handlers.getBranchesFromStructuredSelection(selection).iterator().next(); Artifact associatedArtifact = BranchManager.getAssociatedArtifact(selectedBranch); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java index 640ddb5bc80..5aecd6488f1 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/PurgeTransactionHandler.java @@ -29,7 +29,6 @@ import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.utility.PurgeTransactionOperationWithListener; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.internal.Activator; @@ -41,10 +40,7 @@ import org.eclipse.osee.framework.ui.swt.Displays; public class PurgeTransactionHandler extends CommandHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); - + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { List<TransactionRecord> transactions = Handlers.getTransactionsFromStructuredSelection(selection); if (MessageDialog.openConfirm(Displays.getActiveShell(), "Purge Transaction", diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java index 0dca4d36262..23e7e4b719f 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java @@ -22,7 +22,6 @@ import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.UserManager; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.internal.Activator; @@ -60,14 +59,11 @@ public class RenameBranchHandler extends CommandHandler { } @Override - public Object executeWithException(ExecutionEvent event) { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); - + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { + ISelectionProvider selectionProvider = getSelectionProvider(); if (selectionProvider instanceof TreeViewer) { final TreeViewer treeViewer = (TreeViewer) selectionProvider; Tree tree = treeViewer.getTree(); - IStructuredSelection selection = (IStructuredSelection) selectionProvider.getSelection(); final Branch selectedBranch = Handlers.getBranchesFromStructuredSelection(selection).iterator().next(); TreeItem[] myTreeItemsSelected = tree.getSelection(); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java index f16731eee9c..81a2a82360a 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/SetAssociatedBranchArtifactHandler.java @@ -21,7 +21,6 @@ import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog; @@ -33,9 +32,7 @@ import org.eclipse.osee.framework.ui.swt.Displays; public class SetAssociatedBranchArtifactHandler extends CommandHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Branch selectedBranch = Handlers.getBranchesFromStructuredSelection(selection).iterator().next(); EntryDialog ed = diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java index 0c274b05524..0b1ec53626c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchContributionItem.java @@ -22,12 +22,11 @@ import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.UserManager; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CompoundContributionProvider; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.swt.SWT; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.CompoundContributionItem; import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.menus.CommandContributionItem; import org.eclipse.ui.menus.CommandContributionItemParameter; @@ -35,7 +34,7 @@ import org.eclipse.ui.menus.CommandContributionItemParameter; /** * @author Jeff C. Phillips */ -public class ToggleFavoriteBranchContributionItem extends CompoundContributionItem { +public class ToggleFavoriteBranchContributionItem extends CompoundContributionProvider { private final ICommandService commandService; public ToggleFavoriteBranchContributionItem() { @@ -44,8 +43,7 @@ public class ToggleFavoriteBranchContributionItem extends CompoundContributionIt @Override protected IContributionItem[] getContributionItems() { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); + ISelectionProvider selectionProvider = getSelectionProvider(); ArrayList<IContributionItem> contributionItems = new ArrayList<IContributionItem>(40); if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java index 24d702c50fe..7cbce544bee 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/ToggleFavoriteBranchHandler.java @@ -20,7 +20,6 @@ import org.eclipse.osee.framework.skynet.core.UserManager; import org.eclipse.osee.framework.skynet.core.event.OseeEventManager; import org.eclipse.osee.framework.skynet.core.event.model.BranchEvent; import org.eclipse.osee.framework.skynet.core.event.model.BranchEventType; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; @@ -32,9 +31,7 @@ public class ToggleFavoriteBranchHandler extends CommandHandler { "org.eclipse.osee.framework.ui.skynet.commandHandlers.branch.ToggleFavoriteBranchHandler"; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Branch selectedBranch = Handlers.getBranchesFromStructuredSelection(selection).iterator().next(); UserManager.getUser().toggleFavoriteBranch(selectedBranch); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java index 881ac3c4e71..524b9099f32 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitHandler.java @@ -131,25 +131,22 @@ public abstract class CommitHandler extends CommandHandler { } @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { try { - IStructuredSelection selection = getCurrentSelection(); - if (selection != null) { - List<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection); - Iterator<Branch> iterator = branches.iterator(); - if (iterator.hasNext()) { - Branch sourceBranch = iterator.next(); - - Branch destinationBranch = null; - if (useParentBranch) { - destinationBranch = sourceBranch.getParentBranch(); - } else { - destinationBranch = - BranchManager.getBranch(Integer.parseInt(event.getParameter(BranchOptionsEnum.BRANCH_ID.origKeyName))); - } - Jobs.startJob(new CommitJob(sourceBranch, destinationBranch, - Boolean.parseBoolean(event.getParameter(CommitBranchParameter.ARCHIVE_PARENT_BRANCH)))); + List<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection); + Iterator<Branch> iterator = branches.iterator(); + if (iterator.hasNext()) { + Branch sourceBranch = iterator.next(); + + Branch destinationBranch = null; + if (useParentBranch) { + destinationBranch = sourceBranch.getParentBranch(); + } else { + destinationBranch = + BranchManager.getBranch(Integer.parseInt(event.getParameter(BranchOptionsEnum.BRANCH_ID.origKeyName))); } + Jobs.startJob(new CommitJob(sourceBranch, destinationBranch, + Boolean.parseBoolean(event.getParameter(CommitBranchParameter.ARCHIVE_PARENT_BRANCH)))); } } catch (Exception ex) { OseeExceptions.wrapAndThrow(ex); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java index 993e0a04540..6058916a27c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoHandler.java @@ -24,7 +24,6 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.plugin.core.util.Jobs; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.skynet.branch.BranchSelectionDialog; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.widgets.dialog.CheckBoxDialog; @@ -42,9 +41,7 @@ public class CommitIntoHandler extends CommitHandler { } @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Branch sourceBranch = Handlers.getBranchesFromStructuredSelection(selection).iterator().next(); BranchType[] allowedTypes; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java index 82c7adce4b3..a46276a1729 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/CommitIntoParentCompoundContributionItem.java @@ -24,14 +24,13 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CompoundContributionProvider; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.commandHandlers.merge.BranchIdParameter; import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchView; import org.eclipse.swt.SWT; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.CompoundContributionItem; import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.menus.CommandContributionItem; import org.eclipse.ui.menus.CommandContributionItemParameter; @@ -39,7 +38,7 @@ import org.eclipse.ui.menus.CommandContributionItemParameter; /** * @author Jeff C. Phillips */ -public class CommitIntoParentCompoundContributionItem extends CompoundContributionItem { +public class CommitIntoParentCompoundContributionItem extends CompoundContributionProvider { private static final IParameter[] BRANCH_COMMIT_PARAMETER_DEF = new IParameter[] { new BranchIdParameter(), new CommitBranchParameter()}; @@ -56,8 +55,7 @@ public class CommitIntoParentCompoundContributionItem extends CompoundContributi @Override protected IContributionItem[] getContributionItems() { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); + ISelectionProvider selectionProvider = getSelectionProvider(); ArrayList<IContributionItem> contributionItems = new ArrayList<IContributionItem>(40); if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/UpdateBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/UpdateBranchHandler.java index 573d19b9402..cfd0b10a8e3 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/UpdateBranchHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/commit/UpdateBranchHandler.java @@ -52,13 +52,8 @@ public class UpdateBranchHandler extends CommandHandler { return result; } - private Branch getSelectedBranch() { + private Branch getSelectedBranch(IStructuredSelection selection) { Branch branch = null; - if (AWorkbench.getActivePage() == null) { - return null; - } - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); List<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection); if (branches.size() == 1) { @@ -70,7 +65,7 @@ public class UpdateBranchHandler extends CommandHandler { @Override public boolean isEnabledWithException(IStructuredSelection structuredSelection) throws OseeCoreException { boolean enabled = false; - Branch branch = getSelectedBranch(); + Branch branch = getSelectedBranch(structuredSelection); if (branch != null) { enabled = isValid(branch); } @@ -78,8 +73,8 @@ public class UpdateBranchHandler extends CommandHandler { } @Override - public Object executeWithException(ExecutionEvent event) { - Branch branchToUpdate = getSelectedBranch(); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { + Branch branchToUpdate = getSelectedBranch(selection); if (branchToUpdate != null) { boolean isUpdateAllowed = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/PlainTextDiffHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/PlainTextDiffHandler.java index 3af8ae96d86..880a111001c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/PlainTextDiffHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/PlainTextDiffHandler.java @@ -18,7 +18,6 @@ import java.util.Set; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta; import org.eclipse.osee.framework.skynet.core.change.Change; @@ -41,29 +40,22 @@ public class PlainTextDiffHandler extends CommandHandler { } @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - try { - IStructuredSelection selection = getCurrentSelection(); - if (selection != null) { - List<Change> localChanges = Handlers.getArtifactChangesFromStructuredSelection(selection); - if (!localChanges.isEmpty()) { - Collection<Change> changes = new ArrayList<Change>(localChanges.size()); - Set<Artifact> artifacts = new HashSet<Artifact>(); - for (Change change : localChanges) { - Artifact artifact = change.getChangeArtifact(); - if (!artifacts.contains(artifact)) { - artifacts.add(artifact); - changes.add(change); - } - } - Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes); - - String pathPrefix = RenderingUtil.getAssociatedArtifactName(localChanges); - RendererManager.diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, new PlainTextRenderer()); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { + List<Change> localChanges = Handlers.getArtifactChangesFromStructuredSelection(selection); + if (!localChanges.isEmpty()) { + Collection<Change> changes = new ArrayList<Change>(localChanges.size()); + Set<Artifact> artifacts = new HashSet<Artifact>(); + for (Change change : localChanges) { + Artifact artifact = change.getChangeArtifact(); + if (!artifacts.contains(artifact)) { + artifacts.add(artifact); + changes.add(change); } } - } catch (Exception ex) { - OseeExceptions.wrapAndThrow(ex); + Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes); + + String pathPrefix = RenderingUtil.getAssociatedArtifactName(localChanges); + RendererManager.diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, new PlainTextRenderer()); } return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java index e0e3e74e27e..a4d83768660 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/SingleNativeDiffHandler.java @@ -43,7 +43,7 @@ public class SingleNativeDiffHandler extends CommandHandler { } @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes); String pathPrefix = RenderingUtil.getAssociatedArtifactName(changes); RendererManager.diffInJob(artifactDeltas, pathPrefix); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java index 904dc63e9b1..960862589fb 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/change/ViewWordChangeReportHandler.java @@ -18,7 +18,6 @@ import java.util.Set; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta; import org.eclipse.osee.framework.skynet.core.change.Change; @@ -35,29 +34,22 @@ import org.eclipse.osee.framework.ui.skynet.render.RenderingUtil; public class ViewWordChangeReportHandler extends CommandHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - try { - IStructuredSelection selection = getCurrentSelection(); - if (selection != null) { - List<Change> localChanges = Handlers.getArtifactChangesFromStructuredSelection(selection); - if (!localChanges.isEmpty()) { - Collection<Change> changes = new ArrayList<Change>(localChanges.size()); - Set<Artifact> artifacts = new HashSet<Artifact>(); - for (Change change : localChanges) { - Artifact artifact = change.getChangeArtifact(); - if (!artifacts.contains(artifact)) { - artifacts.add(artifact); - changes.add(change); - } - } - Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes); - - String pathPrefix = RenderingUtil.getAssociatedArtifactName(localChanges); - RendererManager.diffInJob(artifactDeltas, pathPrefix); + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { + List<Change> localChanges = Handlers.getArtifactChangesFromStructuredSelection(selection); + if (!localChanges.isEmpty()) { + Collection<Change> changes = new ArrayList<Change>(localChanges.size()); + Set<Artifact> artifacts = new HashSet<Artifact>(); + for (Change change : localChanges) { + Artifact artifact = change.getChangeArtifact(); + if (!artifacts.contains(artifact)) { + artifacts.add(artifact); + changes.add(change); } } - } catch (Exception ex) { - OseeExceptions.wrapAndThrow(ex); + Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes); + + String pathPrefix = RenderingUtil.getAssociatedArtifactName(localChanges); + RendererManager.diffInJob(artifactDeltas, pathPrefix); } return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeCompoundContributionItem.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeCompoundContributionItem.java index ea8b7b15133..8686d332983 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeCompoundContributionItem.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeCompoundContributionItem.java @@ -27,13 +27,12 @@ import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.revision.ConflictManagerInternal; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.ui.plugin.util.CompoundContributionProvider; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchView; import org.eclipse.swt.SWT; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.CompoundContributionItem; import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.menus.CommandContributionItem; import org.eclipse.ui.menus.CommandContributionItemParameter; @@ -44,7 +43,7 @@ import org.eclipse.ui.menus.CommandContributionItemParameter; * @author Jeff C. Phillips * @author Theron Virgin */ -public class MergeCompoundContributionItem extends CompoundContributionItem { +public class MergeCompoundContributionItem extends CompoundContributionProvider { private static final IParameter[] BRANCH_PARAMETER_DEF = new IParameter[] {new BranchIdParameter()}; private ICommandService commandService; @@ -58,8 +57,7 @@ public class MergeCompoundContributionItem extends CompoundContributionItem { @Override protected IContributionItem[] getContributionItems() { - ISelectionProvider selectionProvider = - AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider(); + ISelectionProvider selectionProvider = getSelectionProvider(); ArrayList<IContributionItem> contributionItems = new ArrayList<IContributionItem>(40); if (selectionProvider != null && selectionProvider.getSelection() instanceof IStructuredSelection) { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeManagerHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeManagerHandler.java index a5ab63720d9..a55ce43e25b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeManagerHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/merge/MergeManagerHandler.java @@ -20,7 +20,6 @@ import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.revision.ConflictManagerInternal; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; import org.eclipse.osee.framework.ui.plugin.util.CommandHandler; import org.eclipse.osee.framework.ui.skynet.commandHandlers.Handlers; import org.eclipse.osee.framework.ui.skynet.internal.Activator; @@ -35,10 +34,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.xmerge.MergeView; public class MergeManagerHandler extends CommandHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { - IStructuredSelection selection = - (IStructuredSelection) AWorkbench.getActivePage().getActivePart().getSite().getSelectionProvider().getSelection(); - + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!selection.isEmpty()) { List<Branch> branches = Handlers.getBranchesFromStructuredSelection(selection); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/ArtifactEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/ArtifactEditorHandler.java index da2841a74b1..098b4d8deda 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/ArtifactEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/ArtifactEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; */ public class ArtifactEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.GENERALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/JavaEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/JavaEditorHandler.java index fd0ea321118..a69a6445201 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/JavaEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/JavaEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class JavaEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativeEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativeEditorHandler.java index 40165cba415..3de97520d8e 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativeEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativeEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class NativeEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativePreviewEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativePreviewEditorHandler.java index edd77231418..da506480ed1 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativePreviewEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/NativePreviewEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.render.NativeRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class NativePreviewEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { NativeRenderer renderer = new NativeRenderer(); renderer.open(artifacts, PresentationType.PREVIEW); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OpenHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OpenHandler.java index 1a75ed802dd..85844c0dedd 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OpenHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OpenHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -19,7 +20,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; */ public class OpenHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.DEFAULT_OPEN); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java index 02479682562..5112ff06521 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/OtherEditorHandler.java @@ -12,6 +12,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.resources.IFile; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.window.Window; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; @@ -35,7 +36,7 @@ import org.eclipse.ui.part.FileEditorInput; public class OtherEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { EditorSelectionDialog dialog = new EditorSelectionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextEditorHandler.java index 08233cb6a9f..132782e634b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class PlainTextEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextPreviewEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextPreviewEditorHandler.java index ea15e63c3ec..e74d8055bf1 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextPreviewEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PlainTextPreviewEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.render.PlainTextRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.PresentationType; public class PlainTextPreviewEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { PlainTextRenderer renderer = new PlainTextRenderer(); renderer.open(artifacts, PresentationType.PREVIEW); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewTisHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewTisHandler.java index 33d061e97ae..a48dfc79d92 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewTisHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewTisHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.TisRenderer; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.TisRenderer; public class PreviewTisHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (!artifacts.isEmpty()) { TisRenderer renderer = new TisRenderer(); renderer.open(artifacts, PresentationType.PREVIEW); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWholeWordHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWholeWordHandler.java index 38de3559322..db02bda05f9 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWholeWordHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWholeWordHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.WholeWordRenderer; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.WholeWordRenderer; public class PreviewWholeWordHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { WholeWordRenderer renderer = new WholeWordRenderer(); renderer.open(artifacts, PresentationType.PREVIEW); return null; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWithChildWordHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWithChildWordHandler.java index 5a011d369e4..92f1bc534b1 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWithChildWordHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWithChildWordHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.render.ITemplateRenderer; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -21,7 +22,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class PreviewWithChildWordHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.PREVIEW, ITemplateRenderer.PREVIEW_WITH_RECURSE_OPTION_PAIR); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWordHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWordHandler.java index 1391d89b21b..7adbf6f65ee 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWordHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/PreviewWordHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; public class PreviewWordHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.PREVIEW); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WholeDocumentEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WholeDocumentEditorHandler.java index 6e217d66509..b2d657eae6b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WholeDocumentEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WholeDocumentEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; */ public class WholeDocumentEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WordEditorHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WordEditorHandler.java index a826dcb29ba..e1752341f10 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WordEditorHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/renderer/handlers/WordEditorHandler.java @@ -11,6 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.commandHandlers.renderer.handlers; import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; @@ -20,7 +21,7 @@ import org.eclipse.osee.framework.ui.skynet.render.RendererManager; */ public class WordEditorHandler extends AbstractEditorHandler { @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.SPECIALIZED_EDIT); return null; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java index f0e3483bf5a..42f974ce7d2 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java @@ -42,7 +42,7 @@ class DiffHandler extends AbstractSelectionEnabledHandler { } @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (attributeConflict != null) { switch (diffToShow) { case 1: diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeCustomMenu.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeCustomMenu.java index 867296bb1d7..009500454ef 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeCustomMenu.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeCustomMenu.java @@ -316,7 +316,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { private AttributeConflict attributeConflict; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (attributeConflict != null) { if (MergeUtility.okToOverwriteEditedValue(attributeConflict, Displays.getActiveShell().getShell(), false)) { RendererManager.openInJob(attributeConflict.getArtifact(), PresentationType.SPECIALIZED_EDIT); @@ -352,7 +352,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { private AttributeConflict attributeConflict; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (attributeConflict != null) { HistoryView.open(attributeConflict.getSourceArtifact()); } @@ -380,7 +380,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { private AttributeConflict attributeConflict; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (attributeConflict != null) { HistoryView.open(attributeConflict.getDestArtifact()); } @@ -409,7 +409,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { private AttributeConflict attributeConflict; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (attributeConflict != null) { ArtifactExplorer.revealArtifact(attributeConflict.getSourceArtifact()); } @@ -437,7 +437,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { private AttributeConflict attributeConflict; @Override - public Object executeWithException(ExecutionEvent event) throws OseeCoreException { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) throws OseeCoreException { if (attributeConflict != null) { ArtifactExplorer.revealArtifact(attributeConflict.getDestArtifact()); } @@ -509,7 +509,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { private AttributeConflict attributeConflict; @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { if (attributeConflict != null) { MergeUtility.launchMerge(attributeConflict, Displays.getActiveShell().getShell()); } @@ -545,7 +545,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { } @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { boolean confirm = MessageDialog.openConfirm(Displays.getActiveShell().getShell(), "Confirm", String.format(dialogString, conflicts.size())); @@ -583,7 +583,7 @@ public class MergeCustomMenu extends XViewerCustomMenu { } @Override - public Object executeWithException(ExecutionEvent event) { + public Object executeWithException(ExecutionEvent event, IStructuredSelection selection) { RendererManager.openInJob(artifacts, PresentationType.PREVIEW); return null; } |