Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 115338 Details for
Bug 244653
[api] extension for repository properties wizard page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
reworked patch
244653.patch (text/plain), 45.08 KB, created by
David Green
on 2008-10-17 00:31:09 EDT
(
hide
)
Description:
reworked patch
Filename:
MIME Type:
Creator:
David Green
Created:
2008-10-17 00:31:09 EDT
Size:
45.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java,v >retrieving revision 1.1 >diff -u -r1.1 TaskEditorExtensions.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java 17 Oct 2008 03:22:28 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensions.java 17 Oct 2008 04:29:53 -0000 >@@ -86,8 +86,7 @@ > init(); > String id = taskRepository.getProperty(REPOSITORY_PROPERTY_EDITOR_EXTENSION); > if (id == null) { >- // TODO 3.1 disabled until bug 244653 is resolved >- //id = getDefaultTaskEditorExtensionId(taskRepository); >+ id = getDefaultTaskEditorExtensionId(taskRepository); > } > return id; > } >@@ -96,9 +95,27 @@ > repository.setProperty(REPOSITORY_PROPERTY_EDITOR_EXTENSION, editorExtensionId); > } > >+ /** >+ * Get the default task editor extension id for the given task repository >+ * >+ * @param taskRepository >+ * @return the default task editor extension id or null if there is no default >+ */ > public static String getDefaultTaskEditorExtensionId(TaskRepository taskRepository) { >+ return getDefaultTaskEditorExtensionId(taskRepository.getConnectorKind()); >+ } >+ >+ /** >+ * Get the default task editor extension id for the given kind of connector >+ * >+ * @param connectorKind >+ * the kind of connector >+ * >+ * @return the default task editor extension id or null if there is no default >+ */ >+ public static String getDefaultTaskEditorExtensionId(String connectorKind) { > init(); >- return associationByConnectorKind.get(taskRepository.getConnectorKind()); >+ return associationByConnectorKind.get(connectorKind); > } > > /** >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java,v >retrieving revision 1.34 >diff -u -r1.34 EditRepositoryWizard.java >--- src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java 7 Oct 2008 05:09:48 -0000 1.34 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java 17 Oct 2008 04:29:53 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.wizard.Wizard; > import org.eclipse.mylyn.commons.core.StatusHandler; >+import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector; > import org.eclipse.mylyn.internal.tasks.ui.RefactorRepositoryUrlOperation; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.tasks.core.TaskRepository; >@@ -72,7 +73,9 @@ > > repository.flushAuthenticationCredentials(); > >- repository.setRepositoryUrl(newUrl); >+ if (!repository.getConnectorKind().equals(LocalRepositoryConnector.CONNECTOR_KIND)) { >+ repository.setRepositoryUrl(newUrl); >+ } > settingsPage.applyTo(repository); > if (oldUrl != null && newUrl != null && !oldUrl.equals(newUrl)) { > TasksUiPlugin.getRepositoryManager().notifyRepositoryUrlChanged(repository, oldUrl); >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/plugin.xml,v >retrieving revision 1.341 >diff -u -r1.341 plugin.xml >--- plugin.xml 17 Oct 2008 03:22:28 -0000 1.341 >+++ plugin.xml 17 Oct 2008 04:29:53 -0000 >@@ -8,6 +8,7 @@ > <extension-point id="duplicateDetectors" name="duplicateDetectors" schema="schema/duplicateDetectors.exsd"/> > <extension-point id="presentations" name="presentations" schema="schema/presentations.exsd"/> > <extension-point id="taskEditorExtensions" name="Task Editor Extension" schema="schema/taskEditorExtensions.exsd"/> >+ <extension-point id="taskRepositoryPageContributor" name="Task Repository Page Contributor" schema="schema/taskRepositoryPageContributor.exsd"/> > > <extension > point="org.eclipse.mylyn.context.core.bridges"> >@@ -1780,4 +1781,10 @@ > type="org.eclipse.mylyn.tasks.core.TaskRepository"> > </propertyTester> > </extension> >+ <extension >+ point="org.eclipse.mylyn.tasks.ui.taskRepositoryPageContributor"> >+ <taskRepositoryPageContributor >+ class="org.eclipse.mylyn.internal.tasks.ui.wizards.TaskEditorExtensionSettingsContributor"> >+ </taskRepositoryPageContributor> >+ </extension> > </plugin> >Index: src/org/eclipse/mylyn/internal/tasks/ui/LocalRepositoryConnectorUi.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/LocalRepositoryConnectorUi.java,v >retrieving revision 1.2 >diff -u -r1.2 LocalRepositoryConnectorUi.java >--- src/org/eclipse/mylyn/internal/tasks/ui/LocalRepositoryConnectorUi.java 12 Sep 2008 04:19:24 -0000 1.2 >+++ src/org/eclipse/mylyn/internal/tasks/ui/LocalRepositoryConnectorUi.java 17 Oct 2008 04:29:53 -0000 >@@ -14,6 +14,7 @@ > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.wizard.IWizard; > import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector; >+import org.eclipse.mylyn.internal.tasks.ui.wizards.LocalRepositorySettingsPage; > import org.eclipse.mylyn.internal.tasks.ui.wizards.NewLocalTaskWizard; > import org.eclipse.mylyn.tasks.core.IRepositoryQuery; > import org.eclipse.mylyn.tasks.core.ITask; >@@ -50,7 +51,7 @@ > > @Override > public ITaskRepositoryPage getSettingsPage(TaskRepository taskRepository) { >- return null; >+ return new LocalRepositorySettingsPage(taskRepository); > } > > @Override >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java,v >retrieving revision 1.59 >diff -u -r1.59 AbstractRepositorySettingsPage.java >--- src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java 12 Sep 2008 04:19:26 -0000 1.59 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java 17 Oct 2008 04:29:54 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >-* Copyright (c) 2004, 2008 Tasktop Technologies and others. >+ * Copyright (c) 2004, 2008 Tasktop Technologies and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -28,7 +28,6 @@ > import org.eclipse.jface.operation.IRunnableWithProgress; > import org.eclipse.jface.preference.PreferenceDialog; > import org.eclipse.jface.preference.StringFieldEditor; >-import org.eclipse.jface.wizard.WizardPage; > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.commons.net.AuthenticationCredentials; > import org.eclipse.mylyn.commons.net.AuthenticationType; >@@ -67,7 +66,6 @@ > import org.eclipse.ui.forms.events.HyperlinkEvent; > import org.eclipse.ui.forms.events.IHyperlinkListener; > import org.eclipse.ui.forms.widgets.ExpandableComposite; >-import org.eclipse.ui.forms.widgets.FormToolkit; > import org.eclipse.ui.forms.widgets.Hyperlink; > > /** >@@ -78,8 +76,10 @@ > * @author Rob Elves > * @author Steffen Pingel > * @author Frank Becker >+ * @author David Green > */ >-public abstract class AbstractRepositorySettingsPage extends WizardPage implements ITaskRepositoryPage { >+public abstract class AbstractRepositorySettingsPage extends AbstractExtensibleRepositorySettingsPage implements >+ ITaskRepositoryPage { > > protected static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences"; > >@@ -205,18 +205,12 @@ > > private Button disconnectedButton; > >- // TODO 3.1 make accessible to subclasses >- private FormToolkit toolkit; >- > /** > * @since 3.0 > */ > public AbstractRepositorySettingsPage(String title, String description, TaskRepository taskRepository) { >- super(title); >- this.repository = taskRepository; >+ super(title, description, taskRepository); > this.connector = TasksUi.getRepositoryManager().getRepositoryConnector(getConnectorKind()); >- setTitle(title); >- setDescription(description); > setNeedsAnonymousLogin(false); > setNeedsEncoding(true); > setNeedsTimeZone(true); >@@ -228,20 +222,21 @@ > /** > * @since 3.0 > */ >+ @Override > public abstract String getConnectorKind(); > > @Override > public void dispose() { > super.dispose(); >- if (toolkit != null) { >- toolkit.dispose(); >- toolkit = null; >- } > } > >- public void createControl(Composite parent) { >- toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay())); >+ @Override >+ protected void createContents(Composite parent) { >+ createSettingControls(parent); >+ } > >+ @Override >+ protected void createSettingControls(Composite parent) { > if (repository != null) { > originalUrl = repository.getRepositoryUrl(); > AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY); >@@ -628,6 +623,8 @@ > > addStatusSection(); > >+ addContributionSection(); >+ > Composite managementComposite = new Composite(compositeContainer, SWT.NULL); > GridLayout managementLayout = new GridLayout(4, false); > managementLayout.marginHeight = 0; >@@ -701,7 +698,6 @@ > > updateHyperlinks(); > >- setControl(compositeContainer); > } > > private void addProxySection() { >@@ -855,6 +851,20 @@ > proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); > } > >+ private void addContributionSection() { >+ Composite composite = toolkit.createComposite(compositeContainer); >+ GridDataFactory.fillDefaults().grab(true, false).span(2, SWT.DEFAULT).applyTo(composite); >+ >+ GridLayout layout = new GridLayout(1, false); >+ layout.marginWidth = 0; >+ layout.marginTop = -5; >+ composite.setLayout(layout); >+ >+ composite.setBackground(compositeContainer.getBackground()); >+ >+ addContributions(composite); >+ } >+ > private void addStatusSection() { > ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer, > ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >@@ -1269,6 +1279,7 @@ > /** > * @since 2.2 > */ >+ @Override > public void applyTo(TaskRepository repository) { > repository.setVersion(getVersion()); > if (needsEncoding()) { >@@ -1307,6 +1318,8 @@ > } > > repository.setOffline(disconnectedButton.getSelection()); >+ >+ super.applyTo(repository); > } > > public AbstractRepositoryConnector getConnector() { >@@ -1413,6 +1426,9 @@ > } > } > >+ /** >+ * validate settings provided by the {@link #getValidator(TaskRepository) validator}, typically the server settings. >+ */ > protected void validateSettings() { > final Validator validator = getValidator(createTaskRepository()); > if (validator == null) { >@@ -1453,6 +1469,14 @@ > getWizard().getContainer().updateButtons(); > } > >+ /** >+ * @since 3.1 >+ */ >+ @Override >+ protected IStatus validate(IProgressMonitor monitor) { >+ return null; >+ } >+ > protected void applyValidatorResult(Validator validator) { > IStatus status = validator.getStatus(); > String message = status.getMessage(); >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractExtensibleRepositorySettingsPage.java >=================================================================== >RCS file: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractExtensibleRepositorySettingsPage.java >diff -N src/org/eclipse/mylyn/tasks/ui/wizards/AbstractExtensibleRepositorySettingsPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractExtensibleRepositorySettingsPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,377 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.tasks.ui.wizards; >+ >+import java.lang.reflect.InvocationTargetException; >+import java.util.ArrayList; >+import java.util.Collections; >+import java.util.Comparator; >+import java.util.List; >+ >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtension; >+import org.eclipse.core.runtime.IExtensionPoint; >+import org.eclipse.core.runtime.IExtensionRegistry; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.MultiStatus; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.SubProgressMonitor; >+import org.eclipse.jface.dialogs.IMessageProvider; >+import org.eclipse.jface.layout.GridDataFactory; >+import org.eclipse.jface.operation.IRunnableWithProgress; >+import org.eclipse.jface.wizard.WizardPage; >+import org.eclipse.mylyn.commons.core.StatusHandler; >+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.forms.events.ExpansionAdapter; >+import org.eclipse.ui.forms.events.ExpansionEvent; >+import org.eclipse.ui.forms.widgets.ExpandableComposite; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+ >+/** >+ * An abstract base class for repository settings page that supports the <code>taskRepositoryPageContributor</code> >+ * extension point. >+ * >+ * {@link ITaskRepositoryPage} implementations are encouraged to extend {@link AbstractRepositorySettingsPage} if >+ * possible as it provides a standard UI for managing server settings. >+ * >+ * @see AbstractRepositorySettingsPage >+ * >+ * @since 3.1 >+ * >+ * @author David Green >+ */ >+public abstract class AbstractExtensibleRepositorySettingsPage extends WizardPage implements ITaskRepositoryPage { >+ >+ private static final String KIND = "connectorKind"; >+ >+ private static final String TASK_REPOSITORY_PAGE_CONTRIBUTOR = "taskRepositoryPageContributor"; >+ >+ private static final String TASK_REPOSITORY_PAGE_CONTRIBUTOR_EXTENSION = "org.eclipse.mylyn.tasks.ui.taskRepositoryPageContributor"; >+ >+ private static final Comparator<AbstractTaskRepositoryPageContribution> CONTRIBUTION_COMPARATOR = new ContributionComparator(); >+ >+ protected final TaskRepository repository; >+ >+ private final List<AbstractTaskRepositoryPageContribution> contributions = new ArrayList<AbstractTaskRepositoryPageContribution>(); >+ >+ protected FormToolkit toolkit; >+ >+ protected Composite compositeContainer; >+ >+ private final AbstractTaskRepositoryPageContribution.Listener contributionListener = new AbstractTaskRepositoryPageContribution.Listener() { >+ public void validationRequired(AbstractTaskRepositoryPageContribution contribution) { >+ validatePageSettings(); >+ } >+ }; >+ >+ public AbstractExtensibleRepositorySettingsPage(String title, String description, TaskRepository repository) { >+ super(title); >+ if (repository != null && !repository.getConnectorKind().equals(getConnectorKind())) { >+ throw new IllegalArgumentException(); >+ } >+ this.repository = repository; >+ setTitle(title); >+ setDescription(description); >+ } >+ >+ /** >+ * Get the kind of connector supported by this page. >+ * >+ * @return the kind of connector, never null >+ */ >+ public abstract String getConnectorKind(); >+ >+ @Override >+ public void dispose() { >+ if (toolkit != null) { >+ toolkit.dispose(); >+ toolkit = null; >+ } >+ super.dispose(); >+ } >+ >+ public void createControl(Composite parent) { >+ toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay())); >+ >+ compositeContainer = new Composite(parent, SWT.NULL); >+ GridLayout layout = new GridLayout(1, true); >+ compositeContainer.setLayout(layout); >+ >+ createContents(compositeContainer); >+ >+ setControl(compositeContainer); >+ } >+ >+ /** >+ * Create the contents of the page. Subclasses may override this method to change where the contributions are added. >+ */ >+ protected void createContents(Composite parent) { >+ createSettingControls(parent); >+ >+ addContributions(parent); >+ } >+ >+ /** >+ * create the controls of this page >+ */ >+ protected abstract void createSettingControls(Composite parent); >+ >+ @Override >+ public boolean isPageComplete() { >+ return super.isPageComplete() && conributionsIsPageComplete(); >+ } >+ >+ @Override >+ public boolean canFlipToNextPage() { >+ return super.canFlipToNextPage() && contributionsCanFlipToNextPage(); >+ } >+ >+ private boolean contributionsCanFlipToNextPage() { >+ for (AbstractTaskRepositoryPageContribution contribution : contributions) { >+ if (!contribution.canFlipToNextPage()) { >+ return false; >+ } >+ } >+ return true; >+ } >+ >+ private boolean conributionsIsPageComplete() { >+ for (AbstractTaskRepositoryPageContribution contribution : contributions) { >+ if (!contribution.isPageComplete()) { >+ return false; >+ } >+ } >+ return true; >+ } >+ >+ /** >+ * subclasses should only call this method if they override {@link #createContents(Composite)} >+ * >+ * @param parentControl >+ * the container into which the contributions will create their UI >+ */ >+ protected void addContributions(Composite parentControl) { >+ List<ITaskRepositoryPageContributor> contributors = findApplicableContributors(); >+ for (ITaskRepositoryPageContributor contributor : contributors) { >+ AbstractTaskRepositoryPageContribution contribution = contributor.createContribution(getConnectorKind(), >+ repository); >+ if (contribution != null) { >+ contributions.add(contribution); >+ contribution.addListener(contributionListener); >+ } >+ } >+ if (!contributions.isEmpty()) { >+ Collections.sort(contributions, CONTRIBUTION_COMPARATOR); >+ >+ for (AbstractTaskRepositoryPageContribution contribution : contributions) { >+ >+ ExpandableComposite section = toolkit.createExpandableComposite(parentControl, >+ ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >+ section.clientVerticalSpacing = 0; >+ section.setBackground(parentControl.getBackground()); >+ section.setFont(parentControl.getFont()); >+ section.addExpansionListener(new ExpansionAdapter() { >+ @Override >+ public void expansionStateChanged(ExpansionEvent e) { >+ getControl().getShell().pack(); >+ } >+ }); >+ section.setText(contribution.getTitle()); >+ section.setToolTipText(contribution.getDescription()); >+ >+ GridDataFactory.fillDefaults().grab(true, false).applyTo(section); >+ >+ Composite sectionContentsContainer = toolkit.createComposite(section); >+ sectionContentsContainer.setBackground(parentControl.getBackground()); >+ contribution.createControl(sectionContentsContainer, toolkit); >+ >+ section.setClient(sectionContentsContainer); >+ } >+ } >+ } >+ >+ /** >+ * Validate the settings of this page, not including contributions. This method should not be called directly by >+ * page implementations. Implementations of this method must be capable of running in a non-UI thread. >+ * >+ * @return the status, or null if there are no messages. >+ * >+ * @see #validatePageSettings() >+ */ >+ protected abstract IStatus validate(IProgressMonitor monitor); >+ >+ /** >+ * Overriding methods should call <code>super.applyTo(repository)</code> >+ */ >+ public void applyTo(TaskRepository repository) { >+ applyContributionSettingsTo(repository); >+ } >+ >+ private void applyContributionSettingsTo(TaskRepository repository) { >+ for (AbstractTaskRepositoryPageContribution contribution : contributions) { >+ contribution.applyTo(repository); >+ } >+ } >+ >+ /** >+ * compute the validation >+ * >+ * @return a status if there is a message to display, otherwise null >+ */ >+ private IStatus computeValidation(IProgressMonitor monitor) { >+ int factor = 100; >+ monitor.beginTask("Validating settings", (contributions.size() + 1) * factor); >+ >+ IStatus cumulativeResult = null; >+ >+ // validate the page >+ { >+ SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, factor); >+ cumulativeResult = validate(subMonitor); >+ subMonitor.done(); >+ } >+ >+ // validate contributions >+ for (AbstractTaskRepositoryPageContribution contribution : contributions) { >+ SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, factor); >+ IStatus result = contribution.validate(subMonitor); >+ if (result != null) { >+ if (cumulativeResult == null) { >+ cumulativeResult = result; >+ } else if (cumulativeResult instanceof MultiStatus) { >+ ((MultiStatus) cumulativeResult).add(result); >+ } else { >+ cumulativeResult = new MultiStatus(cumulativeResult.getPlugin(), cumulativeResult.getCode(), >+ new IStatus[] { cumulativeResult, result }, null, null); >+ } >+ } >+ subMonitor.done(); >+ } >+ monitor.done(); >+ return cumulativeResult; >+ } >+ >+ /** >+ * Validate all settings in the page including contributions. This method should be called whenever a setting is >+ * changed on the page. >+ * >+ * The results of validation are applied and the buttons of the page are updated. >+ * >+ * @see #validate(IProgressMonitor) >+ * @see #applyValidationResult(IStatus[]) >+ */ >+ protected void validatePageSettings() { >+ final Object[] result = new Object[1]; >+ try { >+ getWizard().getContainer().run(true, true, new IRunnableWithProgress() { >+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { >+ result[0] = computeValidation(monitor); >+ } >+ }); >+ } catch (InvocationTargetException e) { >+ StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, >+ "Internal error validating repository", e.getCause())); >+ return; >+ } catch (InterruptedException e) { >+ // canceled >+ return; >+ } >+ applyValidationResult((IStatus[]) result[0]); >+ getWizard().getContainer().updateButtons(); >+ } >+ >+ /** >+ * Apply the results of validation to the page. The implementation finds the most {@link IStatus#getSeverity() >+ * severe} status and {@link #setMessage(String, int) applies the message} to the page. >+ * >+ * @param statuses >+ * an array of statuses that indicate the result of validation, or null >+ */ >+ protected void applyValidationResult(IStatus[] statuses) { >+ if (statuses == null || statuses.length == 0) { >+ setMessage(null, IMessageProvider.INFORMATION); >+ setErrorMessage(null); >+ } else { >+ // find the most severe status >+ IStatus status = statuses[0]; >+ for (IStatus s : statuses) { >+ if (status == null || s.getSeverity() > status.getSeverity()) { >+ status = s; >+ } >+ } >+ int messageType; >+ switch (status.getSeverity()) { >+ case IStatus.OK: >+ case IStatus.INFO: >+ messageType = IMessageProvider.INFORMATION; >+ break; >+ case IStatus.WARNING: >+ messageType = IMessageProvider.WARNING; >+ break; >+ case IStatus.ERROR: >+ default: >+ messageType = IMessageProvider.ERROR; >+ break; >+ } >+ setErrorMessage(null); >+ setMessage(status.getMessage(), messageType); >+ } >+ } >+ >+ private List<ITaskRepositoryPageContributor> findApplicableContributors() { >+ List<ITaskRepositoryPageContributor> contributors = new ArrayList<ITaskRepositoryPageContributor>(); >+ >+ IExtensionRegistry registry = Platform.getExtensionRegistry(); >+ >+ IExtensionPoint editorExtensionPoint = registry.getExtensionPoint(TASK_REPOSITORY_PAGE_CONTRIBUTOR_EXTENSION); >+ IExtension[] editorExtensions = editorExtensionPoint.getExtensions(); >+ for (IExtension extension : editorExtensions) { >+ IConfigurationElement[] elements = extension.getConfigurationElements(); >+ for (IConfigurationElement element : elements) { >+ if (element.getName().equals(TASK_REPOSITORY_PAGE_CONTRIBUTOR)) { >+ String kind = element.getAttribute(KIND); >+ if (kind == null || "".equals(kind) || getConnectorKind().equals(kind)) { >+ try { >+ Object contributor = element.createExecutableExtension("class"); >+ contributors.add((ITaskRepositoryPageContributor) contributor); >+ } catch (Exception e) { >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load " >+ + TASK_REPOSITORY_PAGE_CONTRIBUTOR, e)); >+ } >+ } >+ } >+ } >+ } >+ >+ return contributors; >+ } >+ >+ private static class ContributionComparator implements Comparator<AbstractTaskRepositoryPageContribution> { >+ >+ public int compare(AbstractTaskRepositoryPageContribution o1, AbstractTaskRepositoryPageContribution o2) { >+ if (o1 == o2) { >+ return 0; >+ } >+ String s1 = o1.getTitle(); >+ String s2 = o2.getTitle(); >+ int i = s1.compareTo(s2); >+ if (i == 0) { >+ i = new Integer(System.identityHashCode(o1)).compareTo(System.identityHashCode(o2)); >+ } >+ return i; >+ } >+ >+ } >+} >Index: src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPageContributor.java >=================================================================== >RCS file: src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPageContributor.java >diff -N src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPageContributor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPageContributor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,33 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.tasks.ui.wizards; >+ >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+ >+/** >+ * Implementors are capable of contributing to the settings page for a task repository. >+ * >+ * @since 3.1 >+ * >+ * @author David Green >+ */ >+public interface ITaskRepositoryPageContributor { >+ /** >+ * create a contribution to a task repository >+ * >+ * @param connectorKind >+ * the kind of connector for which a contribution should be created >+ * @param repository >+ * the repository for which contributions are desired, which may be null if the wizard is creating a new >+ * repository >+ * >+ * @return the contribution, or null if the contributor should not contribute to the given repository >+ */ >+ AbstractTaskRepositoryPageContribution createContribution(String connectorKind, TaskRepository repository); >+} >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPageContribution.java >=================================================================== >RCS file: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPageContribution.java >diff -N src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPageContribution.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPageContribution.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,148 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.tasks.ui.wizards; >+ >+import java.util.List; >+import java.util.concurrent.CopyOnWriteArrayList; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.jface.dialogs.IDialogPage; >+import org.eclipse.jface.wizard.IWizardPage; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+ >+/** >+ * A contribution to a {@link ITaskRepositoryPage}. >+ * >+ * @see ITaskRepositoryPageContributor >+ * >+ * @since 3.1 >+ * >+ * @author David Green >+ */ >+public abstract class AbstractTaskRepositoryPageContribution { >+ >+ /** >+ * a listener interface that should be implemented by classes wishing to be notified of changes that occur within >+ * the contribution. >+ */ >+ public interface Listener { >+ /** >+ * Called when the state of the contribution changes such that validation should be performed >+ * >+ * @param contribution >+ * the contribution that changed >+ * >+ * @see ITaskRepositoryPageContribution#validate(IProgressMonitor) >+ */ >+ public void validationRequired(AbstractTaskRepositoryPageContribution contribution); >+ } >+ >+ private final List<Listener> listeners = new CopyOnWriteArrayList<Listener>(); >+ >+ private final String title; >+ >+ private final String description; >+ >+ /** >+ * the repository for which this contribution was created, or null if it was created for a new repository >+ */ >+ protected final TaskRepository repository; >+ >+ /** >+ * the kind of connector for which this contribution was created >+ */ >+ protected final String connectorKind; >+ >+ protected AbstractTaskRepositoryPageContribution(String title, String description, String connectorKind, >+ TaskRepository repository) { >+ this.title = title; >+ this.description = description; >+ this.connectorKind = connectorKind; >+ this.repository = repository; >+ } >+ >+ /** >+ * Add a listener to this contribution. The contribution must notify the listener at the appropriate times, for >+ * example when a setting has changed in the UI. >+ * >+ * @see #removeListener(Listener) >+ */ >+ public void addListener(Listener listener) { >+ listeners.add(listener); >+ } >+ >+ /** >+ * Remove a listener from this contribution. >+ * >+ * @see #addListener(Listener) >+ */ >+ public void removeListener(Listener listener) { >+ listeners.remove(listener); >+ } >+ >+ /** >+ * @see IDialogPage#createControl(Composite) >+ */ >+ public abstract void createControl(Composite parent, FormToolkit toolkit); >+ >+ /** >+ * @see IDialogPage#getTitle() >+ */ >+ public String getTitle() { >+ return title; >+ } >+ >+ /** >+ * @see IDialogPage#getDescription() >+ */ >+ public String getDescription() { >+ return description; >+ } >+ >+ /** >+ * @see IWizardPage#isPageComplete() >+ */ >+ public abstract boolean isPageComplete(); >+ >+ /** >+ * @see IWizardPage#canFlipToNextPage() >+ */ >+ public abstract boolean canFlipToNextPage(); >+ >+ /** >+ * Validate the settings of the contribution. Contributions should expect this method to be called often and should >+ * thus return quickly. Implementations of this method must be capable of running in a non-UI thread. >+ * >+ * @return the status (errors) on the contribution, or null if there are none. A MultiStatus should be used to >+ * return multiple error messages or warnings. >+ */ >+ public abstract IStatus validate(IProgressMonitor monitor); >+ >+ /** >+ * Apply the settings in the contribution to the given repository. >+ * >+ * @param repository >+ * the repository to which settings should be applied >+ * >+ * @see ITaskRepositoryPage#applyTo(TaskRepository) >+ */ >+ public abstract void applyTo(TaskRepository repository); >+ >+ /** >+ * fire the validation required event. >+ */ >+ protected void fireValidationRequired() { >+ for (Listener l : listeners) { >+ l.validationRequired(this); >+ } >+ } >+} >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContribution.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContribution.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContribution.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContribution.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,161 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.tasks.ui.wizards; >+ >+import java.util.SortedSet; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.jface.resource.FontRegistry; >+import org.eclipse.jface.resource.JFaceResources; >+import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensions; >+import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensions.RegisteredTaskEditorExtension; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPageContribution; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.graphics.FontData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Widget; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+ >+/** >+ * A contribution that adds a section for 'Task Editor Extension'. >+ * >+ * @author David Green >+ */ >+public class TaskEditorExtensionSettingsContribution extends AbstractTaskRepositoryPageContribution { >+ >+ private static final String LABEL_NONE = "Plain Text"; >+ >+ private static final String LABEL_DEFAULT_SUFFIX = " (default)"; >+ >+ private static final String DATA_EDITOR_EXTENSION = "editorExtension"; >+ >+ private final SelectionListener listener = new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ selectedExtensionId = (String) ((Widget) e.getSource()).getData(DATA_EDITOR_EXTENSION); >+ fireValidationRequired(); >+ } >+ }; >+ >+ private String selectedExtensionId = null; >+ >+ public TaskEditorExtensionSettingsContribution(String connectorKind, TaskRepository repository) { >+ super("Editor", "Select the capabilities of the the task editor", connectorKind, repository); >+ } >+ >+ @Override >+ public void applyTo(TaskRepository repository) { >+ TaskEditorExtensions.setTaskEditorExtensionId(repository, selectedExtensionId == null ? "none" >+ : selectedExtensionId); >+ } >+ >+ @Override >+ public boolean canFlipToNextPage() { >+ return true; >+ } >+ >+ @Override >+ public boolean isPageComplete() { >+ return true; >+ } >+ >+ @Override >+ public void createControl(Composite parent, FormToolkit toolkit) { >+ parent.setLayout(new GridLayout(1, true)); >+ >+ String defaultExtensionId = TaskEditorExtensions.getDefaultTaskEditorExtensionId(connectorKind); >+ selectedExtensionId = repository == null ? defaultExtensionId >+ : TaskEditorExtensions.getTaskEditorExtensionId(repository); >+ >+ Button noneButton; >+ { // configure a 'none' button >+ String noneTitle = LABEL_NONE; >+ >+ boolean isDefault = defaultExtensionId == null || defaultExtensionId.length() == 0; >+ if (isDefault) { >+ noneTitle += LABEL_DEFAULT_SUFFIX; >+ } >+ noneButton = toolkit.createButton(parent, noneTitle, SWT.RADIO); >+ if (isDefault) { >+ adjustForDefault(noneButton); >+ } >+ >+ noneButton.addSelectionListener(listener); >+ } >+ >+ boolean foundSelection = false; >+ >+ // now add selection buttons for all registered extensions >+ SortedSet<RegisteredTaskEditorExtension> allEditorExtensions = TaskEditorExtensions.getTaskEditorExtensions(); >+ for (RegisteredTaskEditorExtension editorExtension : allEditorExtensions) { >+ String name = editorExtension.getName(); >+ >+ boolean isDefault = editorExtension.getId().equals(defaultExtensionId); >+ if (isDefault) { >+ name += LABEL_DEFAULT_SUFFIX; >+ } >+ Button button = toolkit.createButton(parent, name, SWT.RADIO); >+ if (isDefault) { >+ adjustForDefault(button); >+ } >+ >+ if (editorExtension.getId().equals(selectedExtensionId)) { >+ foundSelection = true; >+ button.setSelection(true); >+ } >+ button.setText(name); >+ button.setData(DATA_EDITOR_EXTENSION, editorExtension.getId()); >+ button.addSelectionListener(listener); >+ } >+ if (!foundSelection) { >+ noneButton.setSelection(true); >+ } >+ } >+ >+ private void adjustForDefault(Button button) { >+ Font font = button.getFont(); >+ button.setFont(getBold(font)); >+ } >+ >+ private Font getBold(Font font) { >+ FontData[] originalFontData = font.getFontData(); >+ FontData fontData = originalFontData[0]; >+ if ((fontData.getStyle() & SWT.BOLD) != 0) { >+ return font; >+ } >+ >+ FontRegistry fontRegistry = JFaceResources.getFontRegistry(); >+ String key = fontData.getName() + '-' + fontData.getHeight() + "-" + fontData.getLocale() + "-" >+ + fontData.getStyle() + "-bold"; >+ >+ if (!fontRegistry.hasValueFor(key)) { >+ FontData[] boldFontDatas = new FontData[originalFontData.length]; >+ int index = -1; >+ for (FontData fd : originalFontData) { >+ boldFontDatas[++index] = new FontData(fd.getName(), fd.getHeight(), fd.getStyle() | SWT.BOLD); >+ } >+ fontRegistry.put(key, boldFontDatas); >+ } >+ return fontRegistry.get(key); >+ } >+ >+ @Override >+ public IStatus validate(IProgressMonitor monitor) { >+ // nothing to validate >+ return null; >+ } >+} >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/LocalRepositorySettingsPage.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/wizards/LocalRepositorySettingsPage.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/wizards/LocalRepositorySettingsPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/LocalRepositorySettingsPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,44 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.tasks.ui.wizards; >+ >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.wizards.AbstractExtensibleRepositorySettingsPage; >+import org.eclipse.swt.widgets.Composite; >+ >+public class LocalRepositorySettingsPage extends AbstractExtensibleRepositorySettingsPage { >+ >+ public LocalRepositorySettingsPage(TaskRepository taskRepository) { >+ super("Local Repository Settings", "Configure the local repository", taskRepository); >+ } >+ >+ @Override >+ public String getConnectorKind() { >+ return LocalRepositoryConnector.CONNECTOR_KIND; >+ } >+ >+ public String getRepositoryUrl() { >+ return null; >+ } >+ >+ @Override >+ protected void createSettingControls(Composite parent) { >+ // nothing to do, since the local repository has no settings >+ } >+ >+ @Override >+ protected IStatus validate(IProgressMonitor monitor) { >+ // nothing to do >+ return null; >+ } >+ >+} >Index: schema/taskRepositoryPageContributor.exsd >=================================================================== >RCS file: schema/taskRepositoryPageContributor.exsd >diff -N schema/taskRepositoryPageContributor.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/taskRepositoryPageContributor.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.mylyn.tasks.ui" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appinfo> >+ <meta.schema plugin="org.eclipse.mylyn.tasks.ui" id="taskRepositoryPageContributor" name="Task Repository Page Contributor"/> >+ </appinfo> >+ <documentation> >+ [Enter description of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appinfo> >+ <meta.element /> >+ </appinfo> >+ </annotation> >+ <complexType> >+ <sequence> >+ <element ref="taskRepositoryPageContributor" minOccurs="1" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute translatable="true"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="taskRepositoryPageContributor"> >+ <complexType> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute kind="java" basedOn=":org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPageContributor"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ <attribute name="connectorKind" type="string"> >+ <annotation> >+ <documentation> >+ the kind of repository connector for which this contributor should be used, or "" (the empty string) if it applies to all connectors >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="since"/> >+ </appinfo> >+ <documentation> >+ [Enter the first release in which this extension point appears.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="examples"/> >+ </appinfo> >+ <documentation> >+ [Enter extension point usage example here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="apiinfo"/> >+ </appinfo> >+ <documentation> >+ [Enter API information here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="implementation"/> >+ </appinfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ >+</schema> >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContributor.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContributor.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContributor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskEditorExtensionSettingsContributor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.tasks.ui.wizards; >+ >+import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensions; >+import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPageContribution; >+import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPageContributor; >+ >+/** >+ * A contributor that adds {@link TaskEditorExtensionSettingsContribution} to all repositories >+ * >+ * @see TaskEditorExtensionSettingsContribution >+ * >+ * @author David Green >+ */ >+public class TaskEditorExtensionSettingsContributor implements ITaskRepositoryPageContributor { >+ >+ public TaskEditorExtensionSettingsContributor() { >+ } >+ >+ public AbstractTaskRepositoryPageContribution createContribution(String connectorKind, TaskRepository repository) { >+ // don't return a contribution if there are no extensions >+ if (TaskEditorExtensions.getTaskEditorExtensions().isEmpty()) { >+ return null; >+ } >+ return new TaskEditorExtensionSettingsContribution(connectorKind, repository); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244653
:
110475
|
110476
|
110514
|
110515
|
110516
|
110517
|
110730
|
110731
|
112848
|
112849
|
112850
| 115338 |
115339
|
116062
|
116063
|
116387
|
116778
|
116865
|
116890
|
117734