Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-07-30 12:33:30 -0400
committerRoberto E. Escobar2013-08-19 18:20:39 -0400
commit61c2f8ca577661dcbc75874186970f064002b5f4 (patch)
treec643968bb824d498b43555ecb76e9517be14e244
parent83ec734415464bef9d9e568fb9d230158bf7cc75 (diff)
downloadorg.eclipse.osee-61c2f8ca577661dcbc75874186970f064002b5f4.tar.gz
org.eclipse.osee-61c2f8ca577661dcbc75874186970f064002b5f4.tar.xz
org.eclipse.osee-61c2f8ca577661dcbc75874186970f064002b5f4.zip
bug[ats_94GNX]: Explore option in branch manager always enabled0.12.0.v201307312007_RC
Changed the isEnabled logic to only be enabled for branches that are not merge branches and are either in the created or modified state. Change-Id: Ie55b0e7f80bcb4dfa01a71ee2ae1307bc76e41c5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/OpenArtifactExplorerHandler.java16
1 files changed, 14 insertions, 2 deletions
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 3d235d0aaa..faee9ec7d4 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
@@ -14,6 +14,9 @@ import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.ui.plugin.util.CommandHandler;
import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer;
@@ -22,13 +25,22 @@ import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer;
*/
public class OpenArtifactExplorerHandler extends CommandHandler {
- private List<? extends IOseeBranch> getSelectedBranches(IStructuredSelection selection) {
+ private List<Branch> getSelectedBranches(IStructuredSelection selection) {
return Handlers.getBranchesFromStructuredSelection(selection);
}
@Override
public boolean isEnabledWithException(IStructuredSelection structuredSelection) {
- return !getSelectedBranches(structuredSelection).isEmpty();
+ List<Branch> selectedBranches = getSelectedBranches(structuredSelection);
+ boolean isEnabled = !selectedBranches.isEmpty();
+ for (Branch branch : selectedBranches) {
+ if (branch.getBranchType() == BranchType.MERGE || !branch.getBranchState().matches(BranchState.CREATED,
+ BranchState.MODIFIED)) {
+ isEnabled = false;
+ break;
+ }
+ }
+ return isEnabled;
}
@Override

Back to the top