Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 244653 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+7 lines)
Lines 450-455 Link Here
450
                 name="View Source">
450
                 name="View Source">
451
           </command>
451
           </command>
452
        </extension>
452
        </extension>
453
        <extension
454
              point="org.eclipse.mylyn.tasks.ui.taskRepositoryPageContributor">
455
           <taskRepositoryPageContributor
456
                 class="org.eclipse.mylyn.internal.sandbox.ui.wizards.TaskEditorExtensionSettingsContributor"
457
                 connectorKind="*">
458
           </taskRepositoryPageContributor>
459
        </extension>
453
   <!--
460
   <!--
454
   <extension point="org.eclipse.mylyn.tasks.ui.presentations">
461
   <extension point="org.eclipse.mylyn.tasks.ui.presentations">
455
      <presentation 
462
      <presentation 
(-)src/org/eclipse/mylyn/internal/sandbox/ui/wizards/TaskEditorExtensionSettingsContributor.java (+36 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.sandbox.ui.wizards;
10
11
import org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorExtensions;
12
import org.eclipse.mylyn.tasks.core.TaskRepository;
13
import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPageContribution;
14
import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPageContributor;
15
16
/**
17
 * A contributor that adds {@link TaskEditorExtensionSettingsContribution} to all repositories
18
 * 
19
 * @see TaskEditorExtensionSettingsContribution
20
 * 
21
 * @author David Green
22
 */
23
public class TaskEditorExtensionSettingsContributor implements ITaskRepositoryPageContributor {
24
25
	public TaskEditorExtensionSettingsContributor() {
26
	}
27
28
	public ITaskRepositoryPageContribution createContribution(String connectorKind, TaskRepository repository) {
29
		// don't return a contribution if there are no extensions
30
		if (TaskEditorExtensions.getTaskEditorExtensions().isEmpty()) {
31
			return null;
32
		}
33
		return new TaskEditorExtensionSettingsContribution(connectorKind, repository);
34
	}
35
36
}
(-)src/org/eclipse/mylyn/internal/sandbox/ui/wizards/TaskEditorExtensionSettingsContribution.java (+156 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.sandbox.ui.wizards;
10
11
import java.util.SortedSet;
12
13
import org.eclipse.core.runtime.IProgressMonitor;
14
import org.eclipse.core.runtime.IStatus;
15
import org.eclipse.jface.resource.FontRegistry;
16
import org.eclipse.jface.resource.JFaceResources;
17
import org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorExtensions;
18
import org.eclipse.mylyn.internal.sandbox.ui.editors.TaskEditorExtensions.RegisteredTaskEditorExtension;
19
import org.eclipse.mylyn.tasks.core.TaskRepository;
20
import org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPageContribution;
21
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.events.SelectionAdapter;
23
import org.eclipse.swt.events.SelectionEvent;
24
import org.eclipse.swt.events.SelectionListener;
25
import org.eclipse.swt.graphics.Font;
26
import org.eclipse.swt.graphics.FontData;
27
import org.eclipse.swt.layout.GridLayout;
28
import org.eclipse.swt.widgets.Button;
29
import org.eclipse.swt.widgets.Composite;
30
import org.eclipse.swt.widgets.Widget;
31
import org.eclipse.ui.forms.widgets.FormToolkit;
32
33
/**
34
 * A contribution that adds a section for 'Task Editor Extension'.
35
 * 
36
 * @author David Green
37
 */
38
public class TaskEditorExtensionSettingsContribution extends AbstractTaskRepositoryPageContribution {
39
40
	private static final String LABEL_NONE = "None";
41
42
	private static final String LABEL_DEFAULT_SUFFIX = " (default)";
43
44
	private static final String DATA_EDITOR_EXTENSION = "editorExtension";
45
46
	private final SelectionListener listener = new SelectionAdapter() {
47
		@Override
48
		public void widgetSelected(SelectionEvent e) {
49
			selectedExtensionId = (String) ((Widget) e.getSource()).getData(DATA_EDITOR_EXTENSION);
50
			fireValidationRequired();
51
		}
52
	};
53
54
	private String selectedExtensionId = null;
55
56
	public TaskEditorExtensionSettingsContribution(String connectorKind, TaskRepository repository) {
57
		super("Task Editor Extension", "Select an extension to the task editor", connectorKind, repository);
58
	}
59
60
	public void applyTo(TaskRepository repository) {
61
		TaskEditorExtensions.setTaskEditorExtensionId(repository, selectedExtensionId == null ? "none"
62
				: selectedExtensionId);
63
	}
64
65
	public boolean canFlipToNextPage() {
66
		return true;
67
	}
68
69
	public boolean isPageComplete() {
70
		return true;
71
	}
72
73
	public void createControl(Composite parent, FormToolkit toolkit) {
74
		parent.setLayout(new GridLayout(1, true));
75
76
		String defaultExtensionId = TaskEditorExtensions.getDefaultTaskEditorExtensionId(connectorKind);
77
		selectedExtensionId = repository == null ? defaultExtensionId
78
				: TaskEditorExtensions.getTaskEditorExtensionId(repository);
79
80
		Button noneButton;
81
		{ // configure a 'none' button
82
			String noneTitle = LABEL_NONE;
83
84
			boolean isDefault = defaultExtensionId == null || defaultExtensionId.length() == 0;
85
			if (isDefault) {
86
				noneTitle += LABEL_DEFAULT_SUFFIX;
87
			}
88
			noneButton = toolkit.createButton(parent, noneTitle, SWT.RADIO);
89
			if (isDefault) {
90
				adjustForDefault(noneButton);
91
			}
92
93
			noneButton.addSelectionListener(listener);
94
		}
95
96
		boolean foundSelection = false;
97
98
		// now add selection buttons for all registered extensions
99
		SortedSet<RegisteredTaskEditorExtension> allEditorExtensions = TaskEditorExtensions.getTaskEditorExtensions();
100
		for (RegisteredTaskEditorExtension editorExtension : allEditorExtensions) {
101
			String name = editorExtension.getName();
102
103
			boolean isDefault = editorExtension.getId().equals(defaultExtensionId);
104
			if (isDefault) {
105
				name += LABEL_DEFAULT_SUFFIX;
106
			}
107
			Button button = toolkit.createButton(parent, name, SWT.RADIO);
108
			if (isDefault) {
109
				adjustForDefault(button);
110
			}
111
112
			if (editorExtension.getId().equals(selectedExtensionId)) {
113
				foundSelection = true;
114
				button.setSelection(true);
115
			}
116
			button.setText(name);
117
			button.setData(DATA_EDITOR_EXTENSION, editorExtension.getId());
118
			button.addSelectionListener(listener);
119
		}
120
		if (!foundSelection) {
121
			noneButton.setSelection(true);
122
		}
123
	}
124
125
	private void adjustForDefault(Button button) {
126
		Font font = button.getFont();
127
		button.setFont(getBold(font));
128
	}
129
130
	private Font getBold(Font font) {
131
		FontData[] originalFontData = font.getFontData();
132
		FontData fontData = originalFontData[0];
133
		if ((fontData.getStyle() & SWT.BOLD) != 0) {
134
			return font;
135
		}
136
137
		FontRegistry fontRegistry = JFaceResources.getFontRegistry();
138
		String key = fontData.getName() + '-' + fontData.getHeight() + "-" + fontData.getLocale() + "-"
139
				+ fontData.getStyle() + "-bold";
140
141
		if (!fontRegistry.hasValueFor(key)) {
142
			FontData[] boldFontDatas = new FontData[originalFontData.length];
143
			int index = -1;
144
			for (FontData fd : originalFontData) {
145
				boldFontDatas[++index] = new FontData(fd.getName(), fd.getHeight(), fd.getStyle() | SWT.BOLD);
146
			}
147
			fontRegistry.put(key, boldFontDatas);
148
		}
149
		return fontRegistry.get(key);
150
	}
151
152
	public IStatus[] validate(IProgressMonitor monitor) {
153
		return null;
154
	}
155
156
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java (-2 / +5 lines)
Lines 15-20 Link Here
15
import org.eclipse.jface.viewers.IStructuredSelection;
15
import org.eclipse.jface.viewers.IStructuredSelection;
16
import org.eclipse.jface.wizard.Wizard;
16
import org.eclipse.jface.wizard.Wizard;
17
import org.eclipse.mylyn.commons.core.StatusHandler;
17
import org.eclipse.mylyn.commons.core.StatusHandler;
18
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
18
import org.eclipse.mylyn.internal.tasks.ui.RefactorRepositoryUrlOperation;
19
import org.eclipse.mylyn.internal.tasks.ui.RefactorRepositoryUrlOperation;
19
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
20
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
20
import org.eclipse.mylyn.tasks.core.TaskRepository;
21
import org.eclipse.mylyn.tasks.core.TaskRepository;
Lines 68-74 Link Here
68
69
69
			repository.flushAuthenticationCredentials();
70
			repository.flushAuthenticationCredentials();
70
71
71
			repository.setRepositoryUrl(newUrl);
72
			if (!repository.getConnectorKind().equals(LocalRepositoryConnector.CONNECTOR_KIND)) {
73
				repository.setRepositoryUrl(newUrl);
74
			}
72
			settingsPage.applyTo(repository);
75
			settingsPage.applyTo(repository);
73
			if (oldUrl != null && newUrl != null && !oldUrl.equals(newUrl)) {
76
			if (oldUrl != null && newUrl != null && !oldUrl.equals(newUrl)) {
74
				TasksUiPlugin.getRepositoryManager().notifyRepositoryUrlChanged(repository, oldUrl);
77
				TasksUiPlugin.getRepositoryManager().notifyRepositoryUrlChanged(repository, oldUrl);
Lines 86-92 Link Here
86
	@Override
89
	@Override
87
	public void addPages() {
90
	public void addPages() {
88
		AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind());
91
		AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind());
89
		settingsPage = connectorUi.getSettingsPage(null);
92
		settingsPage = connectorUi.getSettingsPage(repository);
90
		if (settingsPage instanceof AbstractRepositorySettingsPage) {
93
		if (settingsPage instanceof AbstractRepositorySettingsPage) {
91
			((AbstractRepositorySettingsPage) settingsPage).setRepository(repository);
94
			((AbstractRepositorySettingsPage) settingsPage).setRepository(repository);
92
			((AbstractRepositorySettingsPage) settingsPage).setVersion(repository.getVersion());
95
			((AbstractRepositorySettingsPage) settingsPage).setVersion(repository.getVersion());
(-)plugin.xml (-19 / +1 lines)
Lines 7-12 Link Here
7
    <extension-point id="projectLinkProviders" name="Linking Provider from Project to the Task Repository" schema="schema/projectLinkProviders.exsd"/>
7
    <extension-point id="projectLinkProviders" name="Linking Provider from Project to the Task Repository" schema="schema/projectLinkProviders.exsd"/>
8
    <extension-point id="duplicateDetectors" name="duplicateDetectors" schema="schema/duplicateDetectors.exsd"/>
8
    <extension-point id="duplicateDetectors" name="duplicateDetectors" schema="schema/duplicateDetectors.exsd"/>
9
    <extension-point id="presentations" name="presentations" schema="schema/presentations.exsd"/>
9
    <extension-point id="presentations" name="presentations" schema="schema/presentations.exsd"/>
10
    <extension-point id="taskRepositoryPageContributor" name="Task Repository Page Contributor" schema="schema/taskRepositoryPageContributor.exsd"/>
10
11
11
    <extension
12
    <extension
12
          point="org.eclipse.mylyn.context.core.bridges">
13
          point="org.eclipse.mylyn.context.core.bridges">
Lines 1409-1426 Link Here
1409
                     value="1">
1410
                     value="1">
1410
               </count>
1411
               </count>
1411
               <iterate>
1412
               <iterate>
1412
                  <and>
1413
                     <instanceof
1413
                     <instanceof
1414
                           value="org.eclipse.mylyn.tasks.core.TaskRepository">
1414
                           value="org.eclipse.mylyn.tasks.core.TaskRepository">
1415
                     </instanceof>
1415
                     </instanceof>
1416
                     <not>
1417
                        <test
1418
                              forcePluginActivation="false"
1419
                              property="org.eclipse.mylyn.taskRepository.connectorKind"
1420
                              value="local">
1421
                        </test>
1422
                     </not>
1423
                  </and>
1424
               </iterate>
1416
               </iterate>
1425
            </and>
1417
            </and>
1426
         </enabledWhen>
1418
         </enabledWhen>
Lines 1763-1776 Link Here
1763
            parentId="org.eclipse.ui.textEditorScope">
1755
            parentId="org.eclipse.ui.textEditorScope">
1764
      </context>
1756
      </context>
1765
   </extension>
1757
   </extension>
1766
   <extension
1767
         point="org.eclipse.core.expressions.propertyTesters">
1768
      <propertyTester
1769
            class="org.eclipse.mylyn.internal.tasks.ui.util.TaskRepositoryPropertyTester"
1770
            id="org.eclipse.mylyn.tasks.ui.propertyTester.taskRepository"
1771
            namespace="org.eclipse.mylyn.taskRepository"
1772
            properties="connectorKind"
1773
            type="org.eclipse.mylyn.tasks.core.TaskRepository">
1774
      </propertyTester>
1775
   </extension>
1776
</plugin>
1758
</plugin>
(-)src/org/eclipse/mylyn/internal/tasks/ui/LocalRepositoryConnectorUi.java (-1 / +2 lines)
Lines 11-16 Link Here
11
import org.eclipse.jface.resource.ImageDescriptor;
11
import org.eclipse.jface.resource.ImageDescriptor;
12
import org.eclipse.jface.wizard.IWizard;
12
import org.eclipse.jface.wizard.IWizard;
13
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
13
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
14
import org.eclipse.mylyn.internal.tasks.ui.wizards.LocalRepositorySettingsPage;
14
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewLocalTaskWizard;
15
import org.eclipse.mylyn.internal.tasks.ui.wizards.NewLocalTaskWizard;
15
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
16
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
16
import org.eclipse.mylyn.tasks.core.ITask;
17
import org.eclipse.mylyn.tasks.core.ITask;
Lines 47-53 Link Here
47
48
48
	@Override
49
	@Override
49
	public ITaskRepositoryPage getSettingsPage(TaskRepository taskRepository) {
50
	public ITaskRepositoryPage getSettingsPage(TaskRepository taskRepository) {
50
		return null;
51
		return new LocalRepositorySettingsPage(taskRepository);
51
	}
52
	}
52
53
53
	@Override
54
	@Override
(-)src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java (-17 / +41 lines)
Lines 24-30 Link Here
24
import org.eclipse.jface.operation.IRunnableWithProgress;
24
import org.eclipse.jface.operation.IRunnableWithProgress;
25
import org.eclipse.jface.preference.PreferenceDialog;
25
import org.eclipse.jface.preference.PreferenceDialog;
26
import org.eclipse.jface.preference.StringFieldEditor;
26
import org.eclipse.jface.preference.StringFieldEditor;
27
import org.eclipse.jface.wizard.WizardPage;
28
import org.eclipse.mylyn.commons.core.StatusHandler;
27
import org.eclipse.mylyn.commons.core.StatusHandler;
29
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
28
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
30
import org.eclipse.mylyn.commons.net.AuthenticationType;
29
import org.eclipse.mylyn.commons.net.AuthenticationType;
Lines 63-69 Link Here
63
import org.eclipse.ui.forms.events.HyperlinkEvent;
62
import org.eclipse.ui.forms.events.HyperlinkEvent;
64
import org.eclipse.ui.forms.events.IHyperlinkListener;
63
import org.eclipse.ui.forms.events.IHyperlinkListener;
65
import org.eclipse.ui.forms.widgets.ExpandableComposite;
64
import org.eclipse.ui.forms.widgets.ExpandableComposite;
66
import org.eclipse.ui.forms.widgets.FormToolkit;
67
import org.eclipse.ui.forms.widgets.Hyperlink;
65
import org.eclipse.ui.forms.widgets.Hyperlink;
68
66
69
/**
67
/**
Lines 74-81 Link Here
74
 * @author Rob Elves
72
 * @author Rob Elves
75
 * @author Steffen Pingel
73
 * @author Steffen Pingel
76
 * @author Frank Becker
74
 * @author Frank Becker
75
 * @author David Green
77
 */
76
 */
78
public abstract class AbstractRepositorySettingsPage extends WizardPage implements ITaskRepositoryPage {
77
public abstract class AbstractRepositorySettingsPage extends AbstractExtensibleRepositorySettingsPage implements
78
		ITaskRepositoryPage {
79
79
80
	protected static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences";
80
	protected static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences";
81
81
Lines 201-218 Link Here
201
201
202
	private Button disconnectedButton;
202
	private Button disconnectedButton;
203
203
204
	// TODO 3.1 make accessible to subclasses 
205
	private FormToolkit toolkit;
206
207
	/**
204
	/**
208
	 * @since 3.0
205
	 * @since 3.0
209
	 */
206
	 */
210
	public AbstractRepositorySettingsPage(String title, String description, TaskRepository taskRepository) {
207
	public AbstractRepositorySettingsPage(String title, String description, TaskRepository taskRepository) {
211
		super(title);
208
		super(title, description, taskRepository);
212
		this.repository = taskRepository;
213
		this.connector = TasksUi.getRepositoryManager().getRepositoryConnector(getConnectorKind());
209
		this.connector = TasksUi.getRepositoryManager().getRepositoryConnector(getConnectorKind());
214
		setTitle(title);
215
		setDescription(description);
216
		setNeedsAnonymousLogin(false);
210
		setNeedsAnonymousLogin(false);
217
		setNeedsEncoding(true);
211
		setNeedsEncoding(true);
218
		setNeedsTimeZone(true);
212
		setNeedsTimeZone(true);
Lines 224-243 Link Here
224
	/**
218
	/**
225
	 * @since 3.0
219
	 * @since 3.0
226
	 */
220
	 */
221
	@Override
227
	public abstract String getConnectorKind();
222
	public abstract String getConnectorKind();
228
223
229
	@Override
224
	@Override
230
	public void dispose() {
225
	public void dispose() {
231
		super.dispose();
226
		super.dispose();
232
		if (toolkit != null) {
233
			toolkit.dispose();
234
			toolkit = null;
235
		}
236
	}
227
	}
237
228
238
	public void createControl(Composite parent) {
229
	@Override
239
		toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay()));
230
	protected void createContents(Composite parent) {
231
		createSettingControls(parent);
232
	}
240
233
234
	@Override
235
	protected void createSettingControls(Composite parent) {
241
		if (repository != null) {
236
		if (repository != null) {
242
			originalUrl = repository.getRepositoryUrl();
237
			originalUrl = repository.getRepositoryUrl();
243
			AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY);
238
			AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY);
Lines 624-629 Link Here
624
619
625
		addStatusSection();
620
		addStatusSection();
626
621
622
		addContributionSection();
623
627
		Composite managementComposite = new Composite(compositeContainer, SWT.NULL);
624
		Composite managementComposite = new Composite(compositeContainer, SWT.NULL);
628
		GridLayout managementLayout = new GridLayout(4, false);
625
		GridLayout managementLayout = new GridLayout(4, false);
629
		managementLayout.marginHeight = 0;
626
		managementLayout.marginHeight = 0;
Lines 697-703 Link Here
697
694
698
		updateHyperlinks();
695
		updateHyperlinks();
699
696
700
		setControl(compositeContainer);
701
	}
697
	}
702
698
703
	private void addProxySection() {
699
	private void addProxySection() {
Lines 851-856 Link Here
851
		proxyExpComposite.setExpanded(!systemProxyButton.getSelection());
847
		proxyExpComposite.setExpanded(!systemProxyButton.getSelection());
852
	}
848
	}
853
849
850
	private void addContributionSection() {
851
		Composite composite = toolkit.createComposite(compositeContainer);
852
		GridDataFactory.fillDefaults().grab(true, false).span(2, SWT.DEFAULT).applyTo(composite);
853
854
		GridLayout layout = new GridLayout(1, false);
855
		layout.marginWidth = 0;
856
		layout.marginTop = -5;
857
		composite.setLayout(layout);
858
859
		composite.setBackground(compositeContainer.getBackground());
860
861
		addContributions(composite);
862
	}
863
854
	private void addStatusSection() {
864
	private void addStatusSection() {
855
		ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer,
865
		ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer,
856
				ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
866
				ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
Lines 1265-1270 Link Here
1265
	/**
1275
	/**
1266
	 * @since 2.2
1276
	 * @since 2.2
1267
	 */
1277
	 */
1278
	@Override
1268
	public void applyTo(TaskRepository repository) {
1279
	public void applyTo(TaskRepository repository) {
1269
		repository.setVersion(getVersion());
1280
		repository.setVersion(getVersion());
1270
		if (needsEncoding()) {
1281
		if (needsEncoding()) {
Lines 1303-1308 Link Here
1303
		}
1314
		}
1304
1315
1305
		repository.setOffline(disconnectedButton.getSelection());
1316
		repository.setOffline(disconnectedButton.getSelection());
1317
1318
		super.applyTo(repository);
1306
	}
1319
	}
1307
1320
1308
	public AbstractRepositoryConnector getConnector() {
1321
	public AbstractRepositoryConnector getConnector() {
Lines 1409-1414 Link Here
1409
		}
1422
		}
1410
	}
1423
	}
1411
1424
1425
	/**
1426
	 * validate settings provided by the {@link #getValidator(TaskRepository) validator}, typically the server settings.
1427
	 */
1412
	protected void validateSettings() {
1428
	protected void validateSettings() {
1413
		final Validator validator = getValidator(createTaskRepository());
1429
		final Validator validator = getValidator(createTaskRepository());
1414
		if (validator == null) {
1430
		if (validator == null) {
Lines 1449-1454 Link Here
1449
		getWizard().getContainer().updateButtons();
1465
		getWizard().getContainer().updateButtons();
1450
	}
1466
	}
1451
1467
1468
	/**
1469
	 * @since 3.1
1470
	 */
1471
	@Override
1472
	protected IStatus[] validate(IProgressMonitor monitor) {
1473
		return null;
1474
	}
1475
1452
	protected void applyValidatorResult(Validator validator) {
1476
	protected void applyValidatorResult(Validator validator) {
1453
		IStatus status = validator.getStatus();
1477
		IStatus status = validator.getStatus();
1454
		String message = status.getMessage();
1478
		String message = status.getMessage();
(-)src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPageContributor.java (+33 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.tasks.ui.wizards;
10
11
import org.eclipse.mylyn.tasks.core.TaskRepository;
12
13
/**
14
 * Implementors are capable of contributing to the settings page for a task repository.
15
 * 
16
 * @since 3.1
17
 * 
18
 * @author David Green
19
 */
20
public interface ITaskRepositoryPageContributor {
21
	/**
22
	 * create a contribution to a task repository
23
	 * 
24
	 * @param connectorKind
25
	 *            the kind of connector for which a contribution should be created
26
	 * @param repository
27
	 *            the repository for which contributions are desired, which may be null if the wizard is creating a new
28
	 *            repository
29
	 * 
30
	 * @return the contribution, or null if the contributor should not contribute to the given repository
31
	 */
32
	ITaskRepositoryPageContribution createContribution(String connectorKind, TaskRepository repository);
33
}
(-)src/org/eclipse/mylyn/tasks/ui/wizards/AbstractExtensibleRepositorySettingsPage.java (+374 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.tasks.ui.wizards;
10
11
import java.lang.reflect.InvocationTargetException;
12
import java.util.ArrayList;
13
import java.util.Arrays;
14
import java.util.Collections;
15
import java.util.Comparator;
16
import java.util.List;
17
18
import org.eclipse.core.runtime.IConfigurationElement;
19
import org.eclipse.core.runtime.IExtension;
20
import org.eclipse.core.runtime.IExtensionPoint;
21
import org.eclipse.core.runtime.IExtensionRegistry;
22
import org.eclipse.core.runtime.IProgressMonitor;
23
import org.eclipse.core.runtime.IStatus;
24
import org.eclipse.core.runtime.Platform;
25
import org.eclipse.core.runtime.Status;
26
import org.eclipse.core.runtime.SubProgressMonitor;
27
import org.eclipse.jface.dialogs.IMessageProvider;
28
import org.eclipse.jface.layout.GridDataFactory;
29
import org.eclipse.jface.operation.IRunnableWithProgress;
30
import org.eclipse.jface.wizard.WizardPage;
31
import org.eclipse.mylyn.commons.core.StatusHandler;
32
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
33
import org.eclipse.mylyn.tasks.core.TaskRepository;
34
import org.eclipse.swt.SWT;
35
import org.eclipse.swt.layout.GridLayout;
36
import org.eclipse.swt.widgets.Composite;
37
import org.eclipse.ui.forms.events.ExpansionAdapter;
38
import org.eclipse.ui.forms.events.ExpansionEvent;
39
import org.eclipse.ui.forms.widgets.ExpandableComposite;
40
import org.eclipse.ui.forms.widgets.FormToolkit;
41
42
/**
43
 * An abstract base class for repository settings page that supports the <code>taskRepositoryPageContributor</code>
44
 * extension point.
45
 * 
46
 * {@link ITaskRepositoryPage} implementations are encouraged to extend {@link AbstractRepositorySettingsPage} if
47
 * possible as it provides a standard UI for managing server settings.
48
 * 
49
 * @see AbstractRepositorySettingsPage
50
 * 
51
 * @since 3.1
52
 * 
53
 * @author David Green
54
 */
55
public abstract class AbstractExtensibleRepositorySettingsPage extends WizardPage implements ITaskRepositoryPage {
56
57
	private static final String KIND = "connectorKind";
58
59
	private static final String TASK_REPOSITORY_PAGE_CONTRIBUTOR = "taskRepositoryPageContributor";
60
61
	private static final String TASK_REPOSITORY_PAGE_CONTRIBUTOR_EXTENSION = "org.eclipse.mylyn.tasks.ui.taskRepositoryPageContributor";
62
63
	private static final Comparator<ITaskRepositoryPageContribution> CONTRIBUTION_COMPARATOR = new ContributionComparator();
64
65
	protected final TaskRepository repository;
66
67
	private final List<ITaskRepositoryPageContribution> contributions = new ArrayList<ITaskRepositoryPageContribution>();
68
69
	protected FormToolkit toolkit;
70
71
	protected Composite compositeContainer;
72
73
	private final ITaskRepositoryPageContribution.Listener contributionListener = new ITaskRepositoryPageContribution.Listener() {
74
		public void validationRequired(ITaskRepositoryPageContribution contribution) {
75
			validatePageSettings();
76
		}
77
	};
78
79
	public AbstractExtensibleRepositorySettingsPage(String title, String description, TaskRepository repository) {
80
		super(title);
81
		if (repository != null && !repository.getConnectorKind().equals(getConnectorKind())) {
82
			throw new IllegalArgumentException();
83
		}
84
		this.repository = repository;
85
		setTitle(title);
86
		setDescription(description);
87
	}
88
89
	/**
90
	 * Get the kind of connector supported by this page.
91
	 * 
92
	 * @return the kind of connector, never null
93
	 */
94
	public abstract String getConnectorKind();
95
96
	@Override
97
	public void dispose() {
98
		if (toolkit != null) {
99
			toolkit.dispose();
100
			toolkit = null;
101
		}
102
		super.dispose();
103
	}
104
105
	public void createControl(Composite parent) {
106
		toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay()));
107
108
		compositeContainer = new Composite(parent, SWT.NULL);
109
		GridLayout layout = new GridLayout(1, true);
110
		compositeContainer.setLayout(layout);
111
112
		createContents(compositeContainer);
113
114
		setControl(compositeContainer);
115
	}
116
117
	/**
118
	 * Create the contents of the page. Subclasses may override this method to change where the contributions are added.
119
	 */
120
	protected void createContents(Composite parent) {
121
		createSettingControls(parent);
122
123
		addContributions(parent);
124
	}
125
126
	/**
127
	 * create the controls of this page
128
	 */
129
	protected abstract void createSettingControls(Composite parent);
130
131
	@Override
132
	public boolean isPageComplete() {
133
		return super.isPageComplete() && conributionsIsPageComplete();
134
	}
135
136
	@Override
137
	public boolean canFlipToNextPage() {
138
		return super.canFlipToNextPage() && contributionsCanFlipToNextPage();
139
	}
140
141
	private boolean contributionsCanFlipToNextPage() {
142
		for (ITaskRepositoryPageContribution contribution : contributions) {
143
			if (!contribution.canFlipToNextPage()) {
144
				return false;
145
			}
146
		}
147
		return true;
148
	}
149
150
	private boolean conributionsIsPageComplete() {
151
		for (ITaskRepositoryPageContribution contribution : contributions) {
152
			if (!contribution.isPageComplete()) {
153
				return false;
154
			}
155
		}
156
		return true;
157
	}
158
159
	/**
160
	 * subclasses should only call this method if they override {@link #createContents(Composite)}
161
	 * 
162
	 * @param parentControl
163
	 *            the container into which the contributions will create their UI
164
	 */
165
	protected void addContributions(Composite parentControl) {
166
		List<ITaskRepositoryPageContributor> contributors = findApplicableContributors();
167
		for (ITaskRepositoryPageContributor contributor : contributors) {
168
			ITaskRepositoryPageContribution contribution = contributor.createContribution(getConnectorKind(),
169
					repository);
170
			if (contribution != null) {
171
				contributions.add(contribution);
172
				contribution.addListener(contributionListener);
173
			}
174
		}
175
		if (!contributions.isEmpty()) {
176
			Collections.sort(contributions, CONTRIBUTION_COMPARATOR);
177
178
			for (ITaskRepositoryPageContribution contribution : contributions) {
179
180
				ExpandableComposite section = toolkit.createExpandableComposite(parentControl,
181
						ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
182
				section.clientVerticalSpacing = 0;
183
				section.setBackground(parentControl.getBackground());
184
				section.setFont(parentControl.getFont());
185
				section.addExpansionListener(new ExpansionAdapter() {
186
					@Override
187
					public void expansionStateChanged(ExpansionEvent e) {
188
						getControl().getShell().pack();
189
					}
190
				});
191
				section.setText(contribution.getTitle());
192
				section.setToolTipText(contribution.getDescription());
193
194
				GridDataFactory.fillDefaults().grab(true, false).applyTo(section);
195
196
				Composite sectionContentsContainer = toolkit.createComposite(section);
197
				sectionContentsContainer.setBackground(parentControl.getBackground());
198
				contribution.createControl(sectionContentsContainer, toolkit);
199
200
				section.setClient(sectionContentsContainer);
201
			}
202
		}
203
	}
204
205
	/**
206
	 * Validate the settings of this page, not including contributions. This method should not be called directly by
207
	 * page implementations. Implementations of this method must be capable of running in a non-UI thread.
208
	 * 
209
	 * @return an array of statuses, or null if there are no messages.
210
	 * 
211
	 * @see #validatePageSettings()
212
	 */
213
	protected abstract IStatus[] validate(IProgressMonitor monitor);
214
215
	/**
216
	 * Overriding methods should call <code>super.applyTo(repository)</code>
217
	 */
218
	public void applyTo(TaskRepository repository) {
219
		applyContributionSettingsTo(repository);
220
	}
221
222
	private void applyContributionSettingsTo(TaskRepository repository) {
223
		for (ITaskRepositoryPageContribution contribution : contributions) {
224
			contribution.applyTo(repository);
225
		}
226
	}
227
228
	private IStatus[] computeValidation(IProgressMonitor monitor) {
229
		int factor = 100;
230
		monitor.beginTask("Validating settings", (contributions.size() + 1) * factor);
231
232
		List<IStatus> statuses = null;
233
234
		// validate the page
235
		{
236
			SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, factor);
237
			IStatus[] result = validate(subMonitor);
238
			if (result != null && result.length > 0) {
239
				if (statuses == null) {
240
					statuses = new ArrayList<IStatus>(result.length);
241
				}
242
				statuses.addAll(Arrays.asList(result));
243
			}
244
			subMonitor.done();
245
		}
246
247
		// validate contributions
248
		for (ITaskRepositoryPageContribution contribution : contributions) {
249
			SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, factor);
250
			IStatus[] result = contribution.validate(subMonitor);
251
			if (result != null && result.length > 0) {
252
				if (statuses == null) {
253
					statuses = new ArrayList<IStatus>(result.length);
254
				}
255
				statuses.addAll(Arrays.asList(result));
256
			}
257
			subMonitor.done();
258
		}
259
		monitor.done();
260
		return statuses == null ? null : statuses.toArray(new IStatus[statuses.size()]);
261
	}
262
263
	/**
264
	 * Validate all settings in the page including contributions. This method should be called whenever a setting is
265
	 * changed on the page.
266
	 * 
267
	 * The results of validation are applied and the buttons of the page are updated.
268
	 * 
269
	 * @see #validate(IProgressMonitor)
270
	 * @see #applyValidationResult(IStatus[])
271
	 */
272
	protected void validatePageSettings() {
273
		final Object[] result = new Object[1];
274
		try {
275
			getWizard().getContainer().run(true, true, new IRunnableWithProgress() {
276
				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
277
					result[0] = computeValidation(monitor);
278
				}
279
			});
280
		} catch (InvocationTargetException e) {
281
			StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
282
					"Internal error validating repository", e.getCause()));
283
			return;
284
		} catch (InterruptedException e) {
285
			// canceled
286
			return;
287
		}
288
		applyValidationResult((IStatus[]) result[0]);
289
		getWizard().getContainer().updateButtons();
290
	}
291
292
	/**
293
	 * Apply the results of validation to the page. The implementation finds the most {@link IStatus#getSeverity()
294
	 * severe} status and {@link #setMessage(String, int) applies the message} to the page.
295
	 * 
296
	 * @param statuses
297
	 *            an array of statuses that indicate the result of validation, or null
298
	 */
299
	protected void applyValidationResult(IStatus[] statuses) {
300
		if (statuses == null || statuses.length == 0) {
301
			setMessage(null, IMessageProvider.INFORMATION);
302
			setErrorMessage(null);
303
		} else {
304
			// find the most severe status
305
			IStatus status = statuses[0];
306
			for (IStatus s : statuses) {
307
				if (status == null || s.getSeverity() > status.getSeverity()) {
308
					status = s;
309
				}
310
			}
311
			int messageType;
312
			switch (status.getSeverity()) {
313
			case IStatus.OK:
314
			case IStatus.INFO:
315
				messageType = IMessageProvider.INFORMATION;
316
				break;
317
			case IStatus.WARNING:
318
				messageType = IMessageProvider.WARNING;
319
				break;
320
			case IStatus.ERROR:
321
			default:
322
				messageType = IMessageProvider.ERROR;
323
				break;
324
			}
325
			setErrorMessage(null);
326
			setMessage(status.getMessage(), messageType);
327
		}
328
	}
329
330
	private List<ITaskRepositoryPageContributor> findApplicableContributors() {
331
		List<ITaskRepositoryPageContributor> contributors = new ArrayList<ITaskRepositoryPageContributor>();
332
333
		IExtensionRegistry registry = Platform.getExtensionRegistry();
334
335
		IExtensionPoint editorExtensionPoint = registry.getExtensionPoint(TASK_REPOSITORY_PAGE_CONTRIBUTOR_EXTENSION);
336
		IExtension[] editorExtensions = editorExtensionPoint.getExtensions();
337
		for (IExtension extension : editorExtensions) {
338
			IConfigurationElement[] elements = extension.getConfigurationElements();
339
			for (IConfigurationElement element : elements) {
340
				if (element.getName().equals(TASK_REPOSITORY_PAGE_CONTRIBUTOR)) {
341
					String kind = element.getAttribute(KIND);
342
					if ("*".equals(kind) || getConnectorKind().equals(kind)) {
343
						try {
344
							Object contributor = element.createExecutableExtension("class");
345
							contributors.add((ITaskRepositoryPageContributor) contributor);
346
						} catch (Exception e) {
347
							StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load "
348
									+ TASK_REPOSITORY_PAGE_CONTRIBUTOR, e));
349
						}
350
					}
351
				}
352
			}
353
		}
354
355
		return contributors;
356
	}
357
358
	private static class ContributionComparator implements Comparator<ITaskRepositoryPageContribution> {
359
360
		public int compare(ITaskRepositoryPageContribution o1, ITaskRepositoryPageContribution o2) {
361
			if (o1 == o2) {
362
				return 0;
363
			}
364
			String s1 = o1.getTitle();
365
			String s2 = o2.getTitle();
366
			int i = s1.compareTo(s2);
367
			if (i == 0) {
368
				i = new Integer(System.identityHashCode(s1)).compareTo(System.identityHashCode(s2));
369
			}
370
			return i;
371
		}
372
373
	}
374
}
(-)src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPageContribution.java (+70 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.tasks.ui.wizards;
10
11
import java.util.List;
12
import java.util.concurrent.CopyOnWriteArrayList;
13
14
import org.eclipse.mylyn.tasks.core.TaskRepository;
15
16
/**
17
 * An abstract implementation of {@link ITaskRepositoryPageContribution} that provides basic default functionality.
18
 * 
19
 * @since 3.1
20
 * 
21
 * @author David Green
22
 */
23
public abstract class AbstractTaskRepositoryPageContribution implements ITaskRepositoryPageContribution {
24
25
	private final List<Listener> listeners = new CopyOnWriteArrayList<Listener>();
26
27
	private final String title;
28
29
	private final String description;
30
31
	/**
32
	 * the repository for which this contribution was created, or null if it was created for a new repository
33
	 */
34
	protected final TaskRepository repository;
35
36
	/**
37
	 * the kind of connector for which this contribution was created
38
	 */
39
	protected final String connectorKind;
40
41
	protected AbstractTaskRepositoryPageContribution(String title, String description, String connectorKind,
42
			TaskRepository repository) {
43
		this.title = title;
44
		this.description = description;
45
		this.connectorKind = connectorKind;
46
		this.repository = repository;
47
	}
48
49
	public void addListener(Listener listener) {
50
		listeners.add(listener);
51
	}
52
53
	public String getDescription() {
54
		return description;
55
	}
56
57
	public String getTitle() {
58
		return title;
59
	}
60
61
	public void removeListener(Listener listener) {
62
		listeners.remove(listener);
63
	}
64
65
	protected void fireValidationRequired() {
66
		for (Listener l : listeners) {
67
			l.validationRequired(this);
68
		}
69
	}
70
}
(-)src/org/eclipse/mylyn/tasks/ui/wizards/ITaskRepositoryPageContribution.java (+102 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.tasks.ui.wizards;
10
11
import org.eclipse.core.runtime.IProgressMonitor;
12
import org.eclipse.core.runtime.IStatus;
13
import org.eclipse.jface.dialogs.IDialogPage;
14
import org.eclipse.jface.wizard.IWizardPage;
15
import org.eclipse.mylyn.tasks.core.TaskRepository;
16
import org.eclipse.swt.widgets.Composite;
17
import org.eclipse.ui.forms.widgets.FormToolkit;
18
19
/**
20
 * A contribution to a {@link ITaskRepositoryPage}
21
 * 
22
 * @see ITaskRepositoryPageContributor
23
 * 
24
 * @since 3.1
25
 * 
26
 * @author David Green
27
 */
28
public interface ITaskRepositoryPageContribution {
29
	/**
30
	 * a listener interface that should be implemented by classes wishing to be notified of changes that occur within
31
	 * the contribution.
32
	 */
33
	public interface Listener {
34
		/**
35
		 * Called when the state of the contribution changes such that validation should be performed
36
		 * 
37
		 * @param contribution
38
		 *            the contribution that changed
39
		 * 
40
		 * @see ITaskRepositoryPageContribution#validate(IProgressMonitor)
41
		 */
42
		public void validationRequired(ITaskRepositoryPageContribution contribution);
43
	}
44
45
	/**
46
	 * Add a listener to this contribution. The contribution must notify the listener at the appropriate times, for
47
	 * example when a setting has changed in the UI.
48
	 * 
49
	 * @see #removeListener(Listener)
50
	 */
51
	public void addListener(Listener listener);
52
53
	/**
54
	 * Remove a listener from this contribution.
55
	 * 
56
	 * @see #addListener(Listener)
57
	 */
58
	public void removeListener(Listener listener);
59
60
	/**
61
	 * @see IDialogPage#createControl(Composite)
62
	 */
63
	public void createControl(Composite parent, FormToolkit toolkit);
64
65
	/**
66
	 * @see IDialogPage#getTitle()
67
	 */
68
	public String getTitle();
69
70
	/**
71
	 * @see IDialogPage#getDescription()
72
	 */
73
	public String getDescription();
74
75
	/**
76
	 * @see IWizardPage#isPageComplete()
77
	 */
78
	public boolean isPageComplete();
79
80
	/**
81
	 * @see IWizardPage#canFlipToNextPage()
82
	 */
83
	public boolean canFlipToNextPage();
84
85
	/**
86
	 * Validate the settings of the contribution. Contributions should expect this method to be called often and should
87
	 * thus return quickly. Implementations of this method must be capable of running in a non-UI thread.
88
	 * 
89
	 * @return a list of errors on the contribution, or null if there are none
90
	 */
91
	public IStatus[] validate(IProgressMonitor monitor);
92
93
	/**
94
	 * Apply the settings in the contribution to the given repository.
95
	 * 
96
	 * @param repository
97
	 *            the repository to which settings should be applied
98
	 * 
99
	 * @see ITaskRepositoryPage#applyTo(TaskRepository)
100
	 */
101
	public void applyTo(TaskRepository repository);
102
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/wizards/LocalRepositorySettingsPage.java (+44 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.tasks.ui.wizards;
10
11
import org.eclipse.core.runtime.IProgressMonitor;
12
import org.eclipse.core.runtime.IStatus;
13
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
14
import org.eclipse.mylyn.tasks.core.TaskRepository;
15
import org.eclipse.mylyn.tasks.ui.wizards.AbstractExtensibleRepositorySettingsPage;
16
import org.eclipse.swt.widgets.Composite;
17
18
public class LocalRepositorySettingsPage extends AbstractExtensibleRepositorySettingsPage {
19
20
	public LocalRepositorySettingsPage(TaskRepository taskRepository) {
21
		super("Local Repository Settings", "Configure the local repository", taskRepository);
22
	}
23
24
	@Override
25
	public String getConnectorKind() {
26
		return LocalRepositoryConnector.CONNECTOR_KIND;
27
	}
28
29
	public String getRepositoryUrl() {
30
		return null;
31
	}
32
33
	@Override
34
	protected void createSettingControls(Composite parent) {
35
		// nothing to do, since the local repository has no settings
36
	}
37
38
	@Override
39
	protected IStatus[] validate(IProgressMonitor monitor) {
40
		// nothing to do
41
		return null;
42
	}
43
44
}
(-)schema/taskRepositoryPageContributor.exsd (+109 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.mylyn.tasks.ui" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.mylyn.tasks.ui" id="taskRepositoryPageContributor" name="Task Repository Page Contributor"/>
7
      </appinfo>
8
      <documentation>
9
         [Enter description of this extension point.]
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
19
      <complexType>
20
         <sequence>
21
            <element ref="taskRepositoryPageContributor" minOccurs="1" maxOccurs="unbounded"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appinfo>
43
                  <meta.attribute translatable="true"/>
44
               </appinfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="taskRepositoryPageContributor">
51
      <complexType>
52
         <attribute name="class" type="string" use="required">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appinfo>
58
                  <meta.attribute kind="java" basedOn=":org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPageContributor"/>
59
               </appinfo>
60
            </annotation>
61
         </attribute>
62
         <attribute name="connectorKind" type="string" use="required">
63
            <annotation>
64
               <documentation>
65
                  the kind of repository connector for which this contributor should be used, or &quot;*&quot; if it applies to all connectors
66
               </documentation>
67
            </annotation>
68
         </attribute>
69
      </complexType>
70
   </element>
71
72
   <annotation>
73
      <appinfo>
74
         <meta.section type="since"/>
75
      </appinfo>
76
      <documentation>
77
         [Enter the first release in which this extension point appears.]
78
      </documentation>
79
   </annotation>
80
81
   <annotation>
82
      <appinfo>
83
         <meta.section type="examples"/>
84
      </appinfo>
85
      <documentation>
86
         [Enter extension point usage example here.]
87
      </documentation>
88
   </annotation>
89
90
   <annotation>
91
      <appinfo>
92
         <meta.section type="apiinfo"/>
93
      </appinfo>
94
      <documentation>
95
         [Enter API information here.]
96
      </documentation>
97
   </annotation>
98
99
   <annotation>
100
      <appinfo>
101
         <meta.section type="implementation"/>
102
      </appinfo>
103
      <documentation>
104
         [Enter information about supplied implementation of this extension point.]
105
      </documentation>
106
   </annotation>
107
108
109
</schema>

Return to bug 244653