1 11 package org.eclipse.team.internal.ui.preferences; 12 13 import org.eclipse.jface.dialogs.Dialog; 14 import org.eclipse.jface.preference.IPreferenceStore; 15 import org.eclipse.jface.preference.PreferencePage; 16 import org.eclipse.swt.SWT; 17 import org.eclipse.swt.layout.GridData; 18 import org.eclipse.swt.layout.GridLayout; 19 import org.eclipse.swt.widgets.*; 20 import org.eclipse.team.internal.ui.*; 21 import org.eclipse.ui.IWorkbench; 22 import org.eclipse.ui.IWorkbenchPreferencePage; 23 import org.eclipse.ui.help.WorkbenchHelp; 24 25 public class TeamPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { 26 Button syncModeButton; 27 28 public TeamPreferencePage() { 29 setDescription(Policy.bind("TeamPreferencePage.General_settings_for_Team_support_1")); } 31 32 35 protected Control createContents(Composite parent) { 36 Composite composite = new Composite(parent, SWT.NULL); 37 38 WorkbenchHelp.setHelp(composite, IHelpContextIds.TEAM_PREFERENCE_PAGE); 40 41 GridLayout layout = new GridLayout(); 43 layout.numColumns = 1; 44 layout.marginWidth = 0; 45 layout.marginHeight = 0; 46 composite.setLayout(layout); 47 48 GridData data = new GridData(); 50 data.verticalAlignment = GridData.FILL; 51 data.horizontalAlignment = GridData.FILL; 52 composite.setLayoutData(data); 53 54 syncModeButton = createCheckBox(composite, Policy.bind("TeamPreferencePage.&Use_Incoming/Outgoing_mode_when_synchronizing_2")); 57 initializeValues(); 58 Dialog.applyDialogFont(parent); 59 return composite; 60 } 61 69 private Button createCheckBox(Composite group, String label) { 70 Button button = new Button(group, SWT.CHECK | SWT.LEFT); 71 button.setText(label); 72 GridData data = new GridData(); 73 data.horizontalSpan = 1; 74 button.setLayoutData(data); 75 return button; 76 } 77 84 protected IPreferenceStore doGetPreferenceStore() { 85 return TeamUIPlugin.getPlugin().getPreferenceStore(); 86 } 87 91 protected void performDefaults() { 92 super.performDefaults(); 93 IPreferenceStore store = getPreferenceStore(); 94 } 96 101 public boolean performOk() { 102 IPreferenceStore store = getPreferenceStore(); 103 TeamUIPlugin.getPlugin().savePluginPreferences(); 105 return true; 106 } 107 110 private void initializeValues() { 111 IPreferenceStore store = getPreferenceStore(); 112 } 114 117 public void init(IWorkbench workbench) { 118 } 119 } 120 | Popular Tags |