Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-05-30 22:47:21 +0000
committerspingel2011-05-30 22:47:21 +0000
commit35fa85a46c0db5fa9e4dc33eebf9fcd5dd3a1c44 (patch)
treedfb994001bdbdf14ffe625eff0301614e0ace8b7 /org.eclipse.mylyn.tasks.ui
parentc83035d233456ed3d8592b5650695f17e66609b0 (diff)
downloadorg.eclipse.mylyn.tasks-35fa85a46c0db5fa9e4dc33eebf9fcd5dd3a1c44.tar.gz
org.eclipse.mylyn.tasks-35fa85a46c0db5fa9e4dc33eebf9fcd5dd3a1c44.tar.xz
org.eclipse.mylyn.tasks-35fa85a46c0db5fa9e4dc33eebf9fcd5dd3a1c44.zip
NEW - bug 315184: [api] provide hook in AbstractRepositorySettingsPage on finish and cancel
https://bugs.eclipse.org/bugs/show_bug.cgi?id=315184
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java11
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPage.java23
4 files changed, 36 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java
index 4a8099136..5f6855369 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java
@@ -74,7 +74,7 @@ public class EditRepositoryWizard extends Wizard implements INewWizard {
if (!repository.getConnectorKind().equals(LocalRepositoryConnector.CONNECTOR_KIND)) {
repository.setRepositoryUrl(newUrl);
}
- settingsPage.applyTo(repository);
+ settingsPage.performFinish(repository);
if (oldUrl != null && newUrl != null && !oldUrl.equals(newUrl)) {
TasksUiPlugin.getRepositoryManager().notifyRepositoryUrlChanged(repository, oldUrl);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java
index dc7de9c90..48145b38c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java
@@ -100,7 +100,7 @@ public class NewRepositoryWizard extends Wizard implements INewWizard {
public boolean performFinish() {
if (canFinish()) {
taskRepository = new TaskRepository(connector.getConnectorKind(), settingsPage.getRepositoryUrl());
- settingsPage.applyTo(taskRepository);
+ settingsPage.performFinish(taskRepository);
TasksUi.getRepositoryManager().addRepository(taskRepository);
return true;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java
index 446ca6040..8546beaad 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java
@@ -277,6 +277,17 @@ public abstract class AbstractTaskRepositoryPage extends WizardPage implements I
}
/**
+ * {@inheritDoc}
+ * <p>
+ * Invokes {@link #applyTo(TaskRepository)} by default. Client may override.
+ *
+ * @since 3.6
+ */
+ public void performFinish(TaskRepository repository) {
+ applyTo(repository);
+ }
+
+ /**
* Returns a status if there is a message to display, otherwise null.
*/
private IStatus computeValidation() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPage.java
index d99304506..343af0c71 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPage.java
@@ -22,8 +22,31 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
*/
public interface ITaskRepositoryPage extends IWizardPage {
+ /**
+ * Invoked to commit changes from the wizard page to the <code>repository</code> object.
+ *
+ * @since 3.0
+ * @param repository
+ * the task repository to persists settings to
+ */
public abstract void applyTo(TaskRepository repository);
+ /**
+ * Returns the URL currently entered on the page. This is used by the framework to detect if the URL of the
+ * repository has changed which requires a migration job to run.
+ *
+ * @since 3.0
+ * @return the repository URL that is currently entered
+ */
public abstract String getRepositoryUrl();
+ /**
+ * Invoked when the wizard that contains page finishes. This method should commit all entered data to the
+ * <code>repository</code> object.
+ *
+ * @since 3.6
+ * @see #applyTo(TaskRepository)
+ */
+ public abstract void performFinish(TaskRepository repository);
+
} \ No newline at end of file

Back to the top