Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-11-18 11:54:39 -0500
committerFrank Becker2012-11-18 11:54:39 -0500
commitb0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd (patch)
tree1648ce5d6deef27ec715313496f95b99e3b15bc1 /org.eclipse.mylyn.bugzilla.ui
parent96e7caac5729da734aaddb017f04a0b2ffad0508 (diff)
downloadorg.eclipse.mylyn.tasks-b0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd.tar.gz
org.eclipse.mylyn.tasks-b0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd.tar.xz
org.eclipse.mylyn.tasks-b0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd.zip
372600: redesign of RepositoryConfiguration
create new usage api Change-Id: Ieb5f1514ac88b9d32b529fdbe27b8f215d0873f6 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=372600
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java16
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java9
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java17
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java5
4 files changed, 28 insertions, 19 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java
index a3bbecdb1..9a07858dd 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java
@@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientManager;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -143,21 +144,24 @@ public class BugzillaUiPlugin extends AbstractUIPlugin {
&& selectedProducts != null) {
for (String product : selectedProducts) {
if (prefId.equals(IBugzillaConstants.VALUES_COMPONENT)) {
- for (String option : repositoryConfiguration.getComponents(product)) {
+ for (String option : repositoryConfiguration.getProductOptionValues(BugzillaAttribute.COMPONENT,
+ product)) {
if (!options.contains(option)) {
options.add(option);
}
}
}
if (prefId.equals(IBugzillaConstants.VALUES_VERSION)) {
- for (String option : repositoryConfiguration.getVersions(product)) {
+ for (String option : repositoryConfiguration.getProductOptionValues(BugzillaAttribute.VERSION,
+ product)) {
if (!options.contains(option)) {
options.add(option);
}
}
}
if (prefId.equals(IBugzillaConstants.VALUES_TARGET)) {
- for (String option : repositoryConfiguration.getTargetMilestones(product)) {
+ for (String option : repositoryConfiguration.getProductOptionValues(
+ BugzillaAttribute.TARGET_MILESTONE, product)) {
if (!options.contains(option)) {
options.add(option);
}
@@ -166,13 +170,13 @@ public class BugzillaUiPlugin extends AbstractUIPlugin {
}
} else {
if (prefId.equals(IBugzillaConstants.VALUES_COMPONENT)) {
- options = repositoryConfiguration.getComponents();
+ options = repositoryConfiguration.getOptionValues(BugzillaAttribute.COMPONENT);
}
if (prefId.equals(IBugzillaConstants.VALUES_VERSION)) {
- options = repositoryConfiguration.getVersions();
+ options = repositoryConfiguration.getOptionValues(BugzillaAttribute.VERSION);
}
if (prefId.equals(IBugzillaConstants.VALUES_TARGET)) {
- options = repositoryConfiguration.getTargetMilestones();
+ options = repositoryConfiguration.getOptionValues(BugzillaAttribute.TARGET_MILESTONE);
}
}
return options.toArray(new String[options.size()]);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
index ce7353c76..0ed443d9f 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
@@ -451,7 +451,8 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
.getRoot()
.getMappedAttribute(BugzillaAttribute.COMPONENT.getKey());
if (attributeComponent != null) {
- List<String> optionValues = repositoryConfiguration.getComponents(taskAttribute.getValue());
+ List<String> optionValues = repositoryConfiguration.getProductOptionValues(
+ BugzillaAttribute.COMPONENT, taskAttribute.getValue());
Collections.sort(optionValues);
attributeComponent.clearOptions();
for (String option : optionValues) {
@@ -467,7 +468,8 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
.getRoot()
.getMappedAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey());
if (attributeTargetMilestone != null) {
- List<String> optionValues = repositoryConfiguration.getTargetMilestones(taskAttribute.getValue());
+ List<String> optionValues = repositoryConfiguration.getProductOptionValues(
+ BugzillaAttribute.TARGET_MILESTONE, taskAttribute.getValue());
Collections.sort(optionValues);
attributeTargetMilestone.clearOptions();
for (String option : optionValues) {
@@ -485,7 +487,8 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
.getRoot()
.getMappedAttribute(BugzillaAttribute.VERSION.getKey());
if (attributeVersion != null) {
- List<String> optionValues = repositoryConfiguration.getVersions(taskAttribute.getValue());
+ List<String> optionValues = repositoryConfiguration.getProductOptionValues(
+ BugzillaAttribute.VERSION, taskAttribute.getValue());
Collections.sort(optionValues);
attributeVersion.clearOptions();
for (String option : optionValues) {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
index 13b958ff5..da5df3e26 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
@@ -43,6 +43,7 @@ import org.eclipse.mylyn.commons.ui.dialogs.InPlaceDialogEvent;
import org.eclipse.mylyn.commons.workbench.InPlaceCheckBoxTreeDialog;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.commons.workbench.forms.SectionComposite;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaSearch;
@@ -910,7 +911,7 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
Map<String, String> validValues = new HashMap<String, String>();
if (getRepositoryConfiguration() != null) {
- for (String string : getRepositoryConfiguration().getKeywords()) {
+ for (String string : getRepositoryConfiguration().getOptionValues(BugzillaAttribute.KEYWORDS)) {
validValues.put(string, string);
}
}
@@ -1550,19 +1551,19 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
String[] saved_hardware = hardware.getSelection();
String[] saved_os = os.getSelection();
- java.util.List<String> products = repositoryConfiguration.getProducts();
+ java.util.List<String> products = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT);
String[] productsList = products.toArray(new String[products.size()]);
Arrays.sort(productsList, String.CASE_INSENSITIVE_ORDER);
product.setItems(productsList);
updateAttributesBasedOnProductSelection(selectedProducts, repositoryConfiguration);
- status.setItems(convertStringListToArray(repositoryConfiguration.getStatusValues()));
- resolution.setItems(convertStringListToArray(repositoryConfiguration.getResolutions()));
- severity.setItems(convertStringListToArray(repositoryConfiguration.getSeverities()));
- priority.setItems(convertStringListToArray(repositoryConfiguration.getPriorities()));
- hardware.setItems(convertStringListToArray(repositoryConfiguration.getPlatforms()));
- os.setItems(convertStringListToArray(repositoryConfiguration.getOSs()));
+ status.setItems(convertStringListToArray(repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS)));
+ resolution.setItems(convertStringListToArray(repositoryConfiguration.getOptionValues(BugzillaAttribute.RESOLUTION)));
+ severity.setItems(convertStringListToArray(repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_SEVERITY)));
+ priority.setItems(convertStringListToArray(repositoryConfiguration.getOptionValues(BugzillaAttribute.PRIORITY)));
+ hardware.setItems(convertStringListToArray(repositoryConfiguration.getOptionValues(BugzillaAttribute.REP_PLATFORM)));
+ os.setItems(convertStringListToArray(repositoryConfiguration.getOptionValues(BugzillaAttribute.OP_SYS)));
setSelection(product, selectedProducts);
setSelection(status, saved_status);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
index 611426d43..228f20ce4 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
@@ -30,6 +30,7 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -486,7 +487,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
private void populateOsCombo() {
if (null != repositoryConfiguration && defaultOSCombo != null) {
defaultOSCombo.removeAll();
- List<String> optionValues = repositoryConfiguration.getOSs();
+ List<String> optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.OP_SYS);
for (String option : optionValues) {
defaultOSCombo.add(option.toString());
}
@@ -508,7 +509,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
private void populatePlatformCombo() {
if (null != repositoryConfiguration && defaultPlatformCombo != null) {
defaultPlatformCombo.removeAll();
- List<String> optionValues = repositoryConfiguration.getPlatforms();
+ List<String> optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.REP_PLATFORM);
for (String option : optionValues) {
defaultPlatformCombo.add(option.toString());
}

Back to the top