Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-06-22 20:02:15 +0000
committerfbecker2010-06-22 20:02:15 +0000
commit3df786b446d2b966443b390bea00876f5024e567 (patch)
tree142e03b0f7f2ffd91fc7f9adc135e7e093885e2b /org.eclipse.mylyn.bugzilla.ui
parentcd6bcd288df821d02df64e1f3e392e496f48739b (diff)
downloadorg.eclipse.mylyn.tasks-3df786b446d2b966443b390bea00876f5024e567.tar.gz
org.eclipse.mylyn.tasks-3df786b446d2b966443b390bea00876f5024e567.tar.xz
org.eclipse.mylyn.tasks-3df786b446d2b966443b390bea00876f5024e567.zip
NEW - bug 259291: [patch] add support for custom status workflow
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259291
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java92
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties7
3 files changed, 108 insertions, 1 deletions
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 a769a8917..a9c890f35 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
@@ -11,6 +11,7 @@
package org.eclipse.mylyn.internal.bugzilla.ui.tasklist;
+import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
@@ -23,6 +24,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory;
@@ -39,13 +41,20 @@ 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.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
/**
@@ -74,6 +83,10 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
protected Combo defaultOSCombo;
+ protected Text descriptorFile;
+
+ private String oldDescriptorFile;
+
private Button cleanQAContact;
private RepositoryConfiguration repositoryConfiguration = null;
@@ -206,14 +219,70 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
new Label(parent, SWT.NONE).setText(Messages.BugzillaRepositorySettingsPage_Language_);
languageSettingCombo = new Combo(parent, SWT.DROP_DOWN);
+ Label descriptorLabel = new Label(parent, SWT.NONE);
+ descriptorLabel.setText(Messages.BugzillaRepositorySettingsPage_descriptor_file);
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(descriptorLabel);
+
+ Composite descriptorComposite = new Composite(parent, SWT.NONE);
+ gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ descriptorComposite.setLayout(gridLayout);
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).hint(200, SWT.DEFAULT).applyTo(
+ descriptorComposite);
+
+ descriptorFile = new Text(descriptorComposite, SWT.BORDER);
+ GridData gd = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
+ gd.widthHint = 200;
+ gd.horizontalAlignment = SWT.FILL;
+ gd.verticalAlignment = SWT.CENTER;
+ descriptorFile.setLayoutData(gd);
+
+ Button browseDescriptor = new Button(descriptorComposite, SWT.PUSH);
+ browseDescriptor.setText(Messages.BugzillaRepositorySettingsPage_Browse_descriptor);
+ browseDescriptor.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog fd = new FileDialog(new Shell());
+ fd.setText(Messages.BugzillaRepositorySettingsPage_SelectDescriptorFile);
+ String dFile = fd.open();
+ if (dFile != null && dFile.length() > 0) {
+ descriptorFile.setText(dFile);
+ isPageComplete();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(browseDescriptor);
+ descriptorFile.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ if (getWizard() != null) {
+ getWizard().getContainer().updateButtons();
+ }
+ }
+ });
+
for (BugzillaLanguageSettings bugzillaLanguageSettings : BugzillaRepositoryConnector.getLanguageSettings()) {
languageSettingCombo.add(bugzillaLanguageSettings.getLanguageName());
}
if (repository != null) {
+ //Set language selection
String language = repository.getProperty(IBugzillaConstants.BUGZILLA_LANGUAGE_SETTING);
if (language != null && !language.equals("") && languageSettingCombo.indexOf(language) >= 0) { //$NON-NLS-1$
languageSettingCombo.select(languageSettingCombo.indexOf(language));
}
+
+ //Set descriptor file
+ if (descriptorFile != null) {
+ String file = repository.getProperty((IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE));
+ if (file != null) {
+ descriptorFile.setText(file);
+ oldDescriptorFile = file;
+ }
+ }
}
if (languageSettingCombo.getSelectionIndex() == -1) {
if (languageSettingCombo.indexOf(IBugzillaConstants.DEFAULT_LANG) >= 0) {
@@ -274,6 +343,14 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
repository.setProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN,
String.valueOf(cleanQAContact.getSelection()));
repository.setProperty(IBugzillaConstants.BUGZILLA_LANGUAGE_SETTING, languageSettingCombo.getText());
+ if (descriptorFile != null) {
+ repository.setProperty(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE, descriptorFile.getText());
+ if (oldDescriptorFile != null && !descriptorFile.getText().equals(oldDescriptorFile)) {
+ if (repositoryConfiguration != null) {
+ repositoryConfiguration.setValidTransitions(descriptorFile.getText());
+ }
+ }
+ }
if (!autodetectPlatformOS.getSelection()) {
repository.setProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM,
@@ -363,4 +440,19 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
return isPageComplete() && (getMessage() == null || getMessageType() != IMessageProvider.ERROR);
}
+ @Override
+ public boolean isPageComplete() {
+ if (descriptorFile != null) {
+ String descriptorFilePath = descriptorFile.getText();
+ if (descriptorFilePath != null && !descriptorFilePath.equals("")) { //$NON-NLS-1$
+ File testFile = new File(descriptorFilePath);
+ if (!testFile.exists()) {
+ setMessage(Messages.BugzillaRepositorySettingsPage_DescriptorFileNotExists, IMessageProvider.ERROR);
+ return false;
+ }
+ }
+ }
+ return super.isPageComplete();
+ }
+
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java
index 772afc12d..e6a891a5b 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java
@@ -61,18 +61,28 @@ public class Messages extends NLS {
public static String BugzillaRepositorySettingsPage_available_once_repository_created;
+ public static String BugzillaRepositorySettingsPage_Browse_descriptor;
+
public static String BugzillaRepositorySettingsPage_bugzilla_repository_settings;
public static String BugzillaRepositorySettingsPage_example_do_not_include;
public static String BugzillaRepositorySettingsPage_Language_;
+ public static String BugzillaRepositorySettingsPage_descriptor_file;
+
+ public static String BugzillaRepositorySettingsPage_DescriptorCannotBeApplied;
+
+ public static String BugzillaRepositorySettingsPage_DescriptorFileNotExists;
+
public static String BugzillaRepositorySettingsPage_local_users_enabled;
public static String BugzillaRepositorySettingsPage_override_auto_detection_of_platform;
public static String BugzillaRepositorySettingsPage_Retrieving_repository_configuration;
+ public static String BugzillaRepositorySettingsPage_SelectDescriptorFile;
+
public static String BugzillaRepositorySettingsPage_Server_URL_is_invalid;
public static String BugzillaRepositorySettingsPage_supports_bugzilla_X;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties
index d8b7aeff0..26960404a 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties
@@ -29,12 +29,17 @@ BugzillaQueryTypeWizardPage_Select_from_the_available_query_types=Select from th
BugzillaRepositorySettingsPage_All=All
BugzillaRepositorySettingsPage_AUTOTETECT_PLATFORM_AND_OS=Autodetect platform and os
BugzillaRepositorySettingsPage_available_once_repository_created=Available once repository has been created.
+BugzillaRepositorySettingsPage_Browse_descriptor=Browse
BugzillaRepositorySettingsPage_bugzilla_repository_settings=Bugzilla Repository Settings
BugzillaRepositorySettingsPage_example_do_not_include=\nExample: https://bugs.eclipse.org/bugs (do not include index.cgi)
-BugzillaRepositorySettingsPage_Language_=Language:
+BugzillaRepositorySettingsPage_Language_=Language:
+BugzillaRepositorySettingsPage_descriptor_file=Description file:
+BugzillaRepositorySettingsPage_DescriptorCannotBeApplied=<Not available -- please initialize repository.>
+BugzillaRepositorySettingsPage_DescriptorFileNotExists=Descriptor File does not exist
BugzillaRepositorySettingsPage_local_users_enabled=Local users enabled:
BugzillaRepositorySettingsPage_override_auto_detection_of_platform=Override auto detection of Platform and OS for new bug reports.
BugzillaRepositorySettingsPage_Retrieving_repository_configuration=Retrieving repository configuration
+BugzillaRepositorySettingsPage_SelectDescriptorFile=Select descriptor file
BugzillaRepositorySettingsPage_Server_URL_is_invalid=Server URL is invalid.
BugzillaRepositorySettingsPage_supports_bugzilla_X=Supports Bugzilla {0}
BugzillaRepositorySettingsPage_Validating_server_settings=Validating server settings

Back to the top