Skip to main content
summaryrefslogtreecommitdiffstats
blob: b5f9dd838b3c88e4b5adaf5fac95d9e221ed6dd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * Copyright (c) 2004, 2008 David Green 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
 *
 * Contributors:
 *     David Green - initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.internal.tasks.ui.wizards;

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.AbstractTaskRepositoryPage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.ExpandableComposite;

/**
 * A settings page for the local repository properties dialog. Local repositories have no settings, however they may
 * have settings contributed via the taskRepositoryPageContribution.
 * 
 * @author David Green
 */
public class LocalRepositorySettingsPage extends AbstractTaskRepositoryPage {

	public LocalRepositorySettingsPage(TaskRepository taskRepository) {
		super(Messages.LocalRepositorySettingsPage_Local_Repository_Settings,
				Messages.LocalRepositorySettingsPage_Configure_the_local_repository, taskRepository);
	}

	@Override
	public String getConnectorKind() {
		return LocalRepositoryConnector.CONNECTOR_KIND;
	}

	public String getRepositoryUrl() {
		return LocalRepositoryConnector.REPOSITORY_URL;
	}

	@Override
	protected void createSettingControls(Composite parent) {
		// nothing to do, since the local repository has no settings
	}

	@Override
	protected IStatus validate() {
		// nothing to do
		return null;
	}

	@Override
	protected void createContributionControls(Composite parentControl) {
		super.createContributionControls(parentControl);
		// expand the first contribution since we have no other settings
		Control[] children = parentControl.getChildren();
		if (children.length > 0) {
			if (children[0] instanceof ExpandableComposite) {
				((ExpandableComposite) children[0]).setExpanded(true);
			}
		}
	}

}

Back to the top