diff options
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
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 |