Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2009-09-23 23:40:56 +0000
committerrescobar2009-09-23 23:40:56 +0000
commitc5948a4051853e0f561b06b524fbd0942fb5224a (patch)
treed4820d9680970daba8f72bb5b886d4fc9696abfb /org.eclipse.osee.ote.ui.define
parent9726f3a35a9840c6b1bd0be5eb1efe6e9ed085b9 (diff)
downloadorg.eclipse.osee-c5948a4051853e0f561b06b524fbd0942fb5224a.tar.gz
org.eclipse.osee-c5948a4051853e0f561b06b524fbd0942fb5224a.tar.xz
org.eclipse.osee-c5948a4051853e0f561b06b524fbd0942fb5224a.zip
Prepare Branch logic for server move.
Diffstat (limited to 'org.eclipse.osee.ote.ui.define')
-rw-r--r--org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/dialogs/BranchComboDialog.java42
-rw-r--r--org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java39
2 files changed, 48 insertions, 33 deletions
diff --git a/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/dialogs/BranchComboDialog.java b/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/dialogs/BranchComboDialog.java
index fff975406f7..cf0ca2fe8fd 100644
--- a/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/dialogs/BranchComboDialog.java
+++ b/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/dialogs/BranchComboDialog.java
@@ -122,26 +122,30 @@ public class BranchComboDialog extends TitleAreaDialog implements Listener {
branchIds = new String[0];
}
- Branch branch = getSelection();
- if (branch != null && branch.hasParentBranch()) {
- String lastBranchSelected = Integer.toString(branch.getBranchId());
-
- List<String> history = new ArrayList<String>(Arrays.asList(branchIds));
- history.remove(lastBranchSelected);
- history.add(0, lastBranchSelected);
- if (history.size() > COMBO_HISTORY_LENGTH) {
- history.remove(COMBO_HISTORY_LENGTH);
- }
- branchIds = new String[history.size()];
- history.toArray(branchIds);
-
- settings.put(TestRunStorageKey.BRANCH_IDS, branchIds);
- settings.put(TestRunStorageKey.SELECTED_BRANCH_ID, lastBranchSelected);
- try {
- settings.save(this.getClass().getName());
- } catch (IOException ex) {
- OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
+ try {
+ Branch branch = getSelection();
+ if (branch != null && branch.hasParentBranch()) {
+ String lastBranchSelected = Integer.toString(branch.getBranchId());
+
+ List<String> history = new ArrayList<String>(Arrays.asList(branchIds));
+ history.remove(lastBranchSelected);
+ history.add(0, lastBranchSelected);
+ if (history.size() > COMBO_HISTORY_LENGTH) {
+ history.remove(COMBO_HISTORY_LENGTH);
+ }
+ branchIds = new String[history.size()];
+ history.toArray(branchIds);
+
+ settings.put(TestRunStorageKey.BRANCH_IDS, branchIds);
+ settings.put(TestRunStorageKey.SELECTED_BRANCH_ID, lastBranchSelected);
+ try {
+ settings.save(this.getClass().getName());
+ } catch (IOException ex) {
+ OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
+ }
}
+ } catch (OseeCoreException ex) {
+ OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
}
}
}
diff --git a/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java b/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java
index 371ac843691..b6b8b759301 100644
--- a/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java
+++ b/org.eclipse.osee.ote.ui.define/src/org/eclipse/osee/ote/ui/define/importer/OutfileImportPage.java
@@ -32,6 +32,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Branch;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -272,10 +273,16 @@ public class OutfileImportPage extends WizardDataTransferPage {
setMessage(null);
setErrorMessage("Please select a working branch. Cannot import into a null branch.");
toReturn &= false;
- } else if (!branch.hasParentBranch()) {
- setMessage(null);
- setErrorMessage("Please select a working branch. Cannot import into a top-level branch.");
- toReturn &= false;
+ } else {
+ try {
+ if (!branch.hasParentBranch()) {
+ setMessage(null);
+ setErrorMessage("Please select a working branch. Cannot import into a top-level branch.");
+ toReturn &= false;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
+ }
}
return toReturn;
}
@@ -301,17 +308,21 @@ public class OutfileImportPage extends WizardDataTransferPage {
}
Branch branch = branchSelect.getData();
- if (branch != null && branch.hasParentBranch()) {
- String lastBranchSelected = Integer.toString(branch.getBranchId());
- branchIds = addToHistory(branchIds, lastBranchSelected);
-
- settings.put(TestRunStorageKey.BRANCH_IDS, branchIds);
- settings.put(TestRunStorageKey.SELECTED_BRANCH_ID, lastBranchSelected);
- try {
- settings.save(this.getClass().getName());
- } catch (IOException ex) {
- OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
+ try {
+ if (branch != null && branch.hasParentBranch()) {
+ String lastBranchSelected = Integer.toString(branch.getBranchId());
+ branchIds = addToHistory(branchIds, lastBranchSelected);
+
+ settings.put(TestRunStorageKey.BRANCH_IDS, branchIds);
+ settings.put(TestRunStorageKey.SELECTED_BRANCH_ID, lastBranchSelected);
+ try {
+ settings.save(this.getClass().getName());
+ } catch (IOException ex) {
+ OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
+ }
}
+ } catch (OseeCoreException ex) {
+ OseeLog.log(OteUiDefinePlugin.class, Level.SEVERE, ex);
}
}
}

Back to the top