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/editor/BugzillaTaskEditorPage.java106
1 files changed, 67 insertions, 39 deletions
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 256693d11..d73f018cb 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
@@ -20,6 +20,8 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
@@ -37,6 +39,9 @@ import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorActionPart;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.RepositoryResponse;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -512,46 +517,69 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
});
return false;
}
-// if (!getModel().getTaskData().isNew()) {
-// TaskAttribute exporter = getModel().getTaskData()
-// .getRoot()
-// .getAttribute(BugzillaAttribute.EXPORTER_NAME.getKey());
-// if (exporter == null) {
-// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_submit_disabled_please_refresh,
-// type, new HyperlinkAdapter() {
-// @Override
-// public void linkActivated(HyperlinkEvent e) {
-// ITask task = getModel().getTask();
-// AbstractRepositoryConnector connector = TasksUi.getRepositoryManager()
-// .getRepositoryConnector(task.getConnectorKind());
-// if (connector == null) {
-// return;
-// }
-// TasksUiInternal.synchronizeTask(connector, task, true, new JobChangeAdapter() {
-// @Override
-// public void done(IJobChangeEvent event) {
-// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// try {
-// getTaskEditor().refreshPages();
-// } finally {
-// if (getTaskEditor() != null) {
-// getTaskEditor().showBusy(false);
-// }
-// }
-// }
-// });
-// }
-// });
-// }
-// });
-// }
-// });
-// return false;
+ if (!getModel().getTaskData().isNew()) {
+ TaskAttribute urlbase = getModel().getTaskData().getRoot().getAttribute(BugzillaAttribute.URLBASE.getKey());
+ if (urlbase == null) {
+ // refresh the TaskData so we know the value of the new exporter attribute
+ // TODO e3.7: we can remove this see bug 345056
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ ITask task = getModel().getTask();
+ AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
+ task.getConnectorKind());
+ if (connector == null) {
+ return;
+ }
+ TasksUiInternal.synchronizeTask(connector, task, true, null);
+ }
+ });
+ } else {
+ TaskAttribute exporter = getModel().getTaskData()
+ .getRoot()
+ .getAttribute(BugzillaAttribute.EXPORTER_NAME.getKey());
+ if (exporter == null) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_submit_disabled_please_refresh,
+ type, new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ ITask task = getModel().getTask();
+ AbstractRepositoryConnector connector = TasksUi.getRepositoryManager()
+ .getRepositoryConnector(task.getConnectorKind());
+ if (connector == null) {
+ return;
+ }
+ TasksUiInternal.synchronizeTask(connector, task, true,
+ new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ PlatformUI.getWorkbench()
+ .getDisplay()
+ .asyncExec(new Runnable() {
+ public void run() {
+ try {
+ getTaskEditor().refreshPages();
+ } finally {
+ if (getTaskEditor() != null) {
+ getTaskEditor().showBusy(false);
+ }
+ }
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+ });
+ return false;
+ }
// }
-// }
+
+ }
+ }
return true;
}
}

Back to the top