Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 1ad77f9b4b156db6fc1d2b080fbfd72b77131cf2 (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
/*******************************************************************************
 * Copyright (c) 2006, 2007 IBM Corporation 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:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;

import org.eclipse.jface.preference.*;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.team.internal.ui.IHelpContextIds;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.ui.*;

public class StartupPreferencePage extends FieldEditorPreferencePage implements
		IWorkbenchPreferencePage {

	public static final String PROP_STARTUP_ACTION = "startupAction"; //$NON-NLS-1$
	public static final String STARTUP_ACTION_NONE = "none"; //$NON-NLS-1$
	public static final String STARTUP_ACTION_POPULATE = "populate"; //$NON-NLS-1$
	public static final String STARTUP_ACTION_SYNCHRONIZE = "synchronize"; //$NON-NLS-1$
	
	// Property used to make preferences available in the page configuration
	public static final String STARTUP_PREFERENCES = "org.eclipse.team.ui.startupPreferences"; //$NON-NLS-1$
	
	public StartupPreferencePage(IPreferenceStore store) {
		super(GRID);
		setTitle(TeamUIMessages.StartupPreferencePage_0); 
		setDescription(TeamUIMessages.StartupPreferencePage_1); 
		setPreferenceStore(store);
	}

	public void init(IWorkbench workbench) {
		// Nothing to do
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
	 */
	public void createControl(Composite parent) {
		super.createControl(parent);
        // set F1 help
        PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.SYNC_STARTUP_PREFERENCE_PAGE);
	}

	protected void createFieldEditors() {
	    addField(new RadioGroupFieldEditor(PROP_STARTUP_ACTION, 
	            TeamUIMessages.StartupPreferencePage_2, 1,  
	            new String[][] {
	            	{TeamUIMessages.StartupPreferencePage_3, STARTUP_ACTION_POPULATE}, 
	            	{TeamUIMessages.StartupPreferencePage_4, STARTUP_ACTION_SYNCHRONIZE},
	            	{TeamUIMessages.StartupPreferencePage_5, STARTUP_ACTION_NONE}
	    		}, 
	    		getFieldEditorParent(), true /* use a group */));
	}

}

Back to the top