Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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.java7
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java15
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java9
5 files changed, 27 insertions, 30 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 4c5248a69..a4c8d376b 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
@@ -14,8 +14,6 @@ package org.eclipse.mylyn.internal.bugzilla.ui;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -88,11 +86,6 @@ public class BugzillaUiPlugin extends AbstractUIPlugin {
super.start(context);
getPreferenceStore().setDefault(IBugzillaConstants.MAX_RESULTS, 100);
- IPath repConfigCacheFile = getProductConfigurationCachePath();
- if (repConfigCacheFile != null) {
- BugzillaCorePlugin.setConfigurationCacheFile(repConfigCacheFile.toFile());
- }
-
BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUi.getRepositoryManager()
.getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND);
@@ -103,15 +96,6 @@ public class BugzillaUiPlugin extends AbstractUIPlugin {
BugzillaUiExtensionReader.initStartupExtensions();
}
- /**
- * Returns the path to the file cacheing the product configuration.
- */
- private static IPath getProductConfigurationCachePath() {
- IPath stateLocation = Platform.getStateLocation(BugzillaCorePlugin.getDefault().getBundle());
- IPath configFile = stateLocation.append("repositoryConfigurations"); //$NON-NLS-1$
- return configFile;
- }
-
public int getMaxResults() {
return getPreferenceStore().getInt(IBugzillaConstants.MAX_RESULTS);
}
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 8432f00e5..61368eb8d 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
@@ -27,6 +27,7 @@ import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryResponse;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
@@ -290,8 +291,10 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
if (taskAttribute.getId().equals(BugzillaAttribute.PRODUCT.getKey())) {
RepositoryConfiguration repositoryConfiguration = null;
try {
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(
- getModel().getTaskRepository(), false, new NullProgressMonitor());
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(getModel().getTaskRepository()
+ .getConnectorKind());
+ repositoryConfiguration = connector.getRepositoryConfiguration(getModel().getTaskRepository(),
+ false, new NullProgressMonitor());
} catch (CoreException e) {
StatusHandler.log(new RepositoryStatus(getTaskRepository(), IStatus.ERROR,
BugzillaUiPlugin.ID_PLUGIN, 0, "Failed to obtain repository configuration", e)); //$NON-NLS-1$
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 70811c5cb..897d27b5d 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
@@ -40,7 +40,7 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.mylyn.commons.core.CoreUtil;
import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
@@ -1061,7 +1061,8 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L
// TODO: update status, resolution, severity etc if possible...
if (getTaskRepository() != null) {
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(getTaskRepository().getUrl());
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(getTaskRepository().getConnectorKind());
+ repositoryConfiguration = connector.getRepositoryConfiguration(getTaskRepository().getUrl());
updateAttributesFromConfiguration(null);
if (product.getItemCount() == 0) {
Display.getDefault().asyncExec(new Runnable() {
@@ -1873,8 +1874,9 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L
try {
monitor.beginTask(Messages.BugzillaSearchPage_Updating_search_options_,
IProgressMonitor.UNKNOWN);
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(getTaskRepository(),
- force, monitor);
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(getTaskRepository().getConnectorKind());
+ repositoryConfiguration = connector.getRepositoryConfiguration(getTaskRepository(), force,
+ monitor);
} catch (final Exception e) {
throw new InvocationTargetException(e);
} finally {
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 5a266029e..248556d0a 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
@@ -27,12 +27,14 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaLanguageSettings;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaStatus;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -113,7 +115,8 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
}
if (null != repository) {
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(repository.getRepositoryUrl());
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(repository.getConnectorKind());
+ repositoryConfiguration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
platform = repository.getProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM);
os = repository.getProperty(IBugzillaConstants.BUGZILLA_DEF_OS);
}
@@ -148,8 +151,9 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
monitor.beginTask(
Messages.BugzillaRepositorySettingsPage_Retrieving_repository_configuration,
IProgressMonitor.UNKNOWN);
- repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(repository,
- false, monitor);
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(repository.getConnectorKind());
+ repositoryConfiguration = connector.getRepositoryConfiguration(repository, false,
+ monitor);
if (repositoryConfiguration != null) {
platform = repository.getProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM);
os = repository.getProperty(IBugzillaConstants.BUGZILLA_DEF_OS);
@@ -200,7 +204,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
new Label(parent, SWT.NONE).setText(Messages.BugzillaRepositorySettingsPage_Language_);
languageSettingCombo = new Combo(parent, SWT.DROP_DOWN);
- for (BugzillaLanguageSettings bugzillaLanguageSettings : BugzillaCorePlugin.getDefault().getLanguageSettings()) {
+ for (BugzillaLanguageSettings bugzillaLanguageSettings : BugzillaRepositoryConnector.getLanguageSettings()) {
languageSettingCombo.add(bugzillaLanguageSettings.getLanguageName());
}
if (repository != null) {
@@ -334,7 +338,8 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
IProgressMonitor.UNKNOWN);
BugzillaClient client = null;
- client = BugzillaClientFactory.createClient(repository);
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(repository.getConnectorKind());
+ client = BugzillaClientFactory.createClient(repository, connector);
client.validate(monitor);
} finally {
monitor.done();
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
index dab720840..755394231 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
@@ -15,12 +15,13 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaFlag;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaFlagMapper;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.tasks.core.data.TaskAttachmentModel;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.wizards.TaskAttachmentPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -61,7 +62,9 @@ public class BugzillaTaskAttachmentPage extends TaskAttachmentPage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- RepositoryConfiguration configuration = BugzillaCorePlugin.getRepositoryConfiguration(getModel().getTaskRepository()
+ BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(getModel().getTaskRepository()
+ .getConnectorKind());
+ RepositoryConfiguration configuration = connector.getRepositoryConfiguration(getModel().getTaskRepository()
.getRepositoryUrl());
if (configuration != null) {
List<BugzillaFlag> flags = configuration.getFlags();
@@ -83,7 +86,7 @@ public class BugzillaTaskAttachmentPage extends TaskAttachmentPage {
if (flagComposite == null) {
flagComposite = createFlagSection(pageComposite);
}
- BugzillaFlagMapper mapper = new BugzillaFlagMapper();
+ BugzillaFlagMapper mapper = new BugzillaFlagMapper(connector);
mapper.setRequestee(""); //$NON-NLS-1$
mapper.setSetter(""); //$NON-NLS-1$
mapper.setState(" "); //$NON-NLS-1$

Back to the top