Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 10-16
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.team.internal.ccvs.ui; |
11 |
package org.eclipse.team.internal.ccvs.ui; |
12 |
|
12 |
|
13 |
|
|
|
14 |
import org.eclipse.jface.dialogs.Dialog; |
13 |
import org.eclipse.jface.dialogs.Dialog; |
15 |
import org.eclipse.jface.dialogs.IDialogConstants; |
14 |
import org.eclipse.jface.dialogs.IDialogConstants; |
16 |
import org.eclipse.jface.preference.IPreferenceStore; |
15 |
import org.eclipse.jface.preference.IPreferenceStore; |
Lines 18-31
Link Here
|
18 |
import org.eclipse.swt.SWT; |
17 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.events.SelectionAdapter; |
18 |
import org.eclipse.swt.events.SelectionAdapter; |
20 |
import org.eclipse.swt.events.SelectionEvent; |
19 |
import org.eclipse.swt.events.SelectionEvent; |
21 |
import org.eclipse.swt.layout.GridData; |
20 |
import org.eclipse.swt.layout.*; |
22 |
import org.eclipse.swt.layout.GridLayout; |
|
|
23 |
import org.eclipse.swt.widgets.*; |
21 |
import org.eclipse.swt.widgets.*; |
24 |
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; |
22 |
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; |
25 |
import org.eclipse.team.internal.ccvs.core.IConnectionMethod; |
23 |
import org.eclipse.team.internal.ccvs.core.IConnectionMethod; |
26 |
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; |
24 |
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; |
27 |
import org.eclipse.team.internal.ui.SWTUtils; |
25 |
import org.eclipse.team.internal.ui.SWTUtils; |
28 |
import org.eclipse.ui.*; |
26 |
import org.eclipse.ui.*; |
|
|
27 |
import org.eclipse.ui.dialogs.PreferenceLinkArea; |
29 |
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; |
28 |
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; |
30 |
|
29 |
|
31 |
public class ExtMethodPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { |
30 |
public class ExtMethodPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { |
Lines 43-54
Link Here
|
43 |
*/ |
42 |
*/ |
44 |
protected Control createContents(Composite parent) { |
43 |
protected Control createContents(Composite parent) { |
45 |
Composite composite = new Composite(parent, SWT.NULL); |
44 |
Composite composite = new Composite(parent, SWT.NULL); |
46 |
GridLayout layout = new GridLayout(); |
|
|
47 |
layout.marginWidth = 0; |
48 |
layout.marginHeight = 0; |
49 |
layout.numColumns = 1; |
50 |
composite.setLayout(layout); |
51 |
composite.setLayoutData(new GridData()); |
52 |
|
45 |
|
53 |
SelectionAdapter selectionListener = new SelectionAdapter() { |
46 |
SelectionAdapter selectionListener = new SelectionAdapter() { |
54 |
public void widgetSelected(SelectionEvent e) { |
47 |
public void widgetSelected(SelectionEvent e) { |
Lines 56-72
Link Here
|
56 |
} |
49 |
} |
57 |
}; |
50 |
}; |
58 |
|
51 |
|
|
|
52 |
// create radio buttons in a consecutive manner (see bug 282032) |
59 |
useExternal = createRadioButton(composite, CVSUIMessages.ExtMethodPreferencePage_0, 1); |
53 |
useExternal = createRadioButton(composite, CVSUIMessages.ExtMethodPreferencePage_0, 1); |
60 |
useExternal.addSelectionListener(selectionListener); |
54 |
useExternal.addSelectionListener(selectionListener); |
61 |
external = createExternalArea(composite); |
|
|
62 |
|
63 |
useInternal = createRadioButton(composite, CVSUIMessages.ExtMethodPreferencePage_1, 1); |
55 |
useInternal = createRadioButton(composite, CVSUIMessages.ExtMethodPreferencePage_1, 1); |
64 |
useInternal.addSelectionListener(selectionListener); |
56 |
useInternal.addSelectionListener(selectionListener); |
|
|
57 |
|
58 |
external = createExternalArea(composite); |
65 |
internal = createInternalArea(composite); |
59 |
internal = createInternalArea(composite); |
66 |
|
60 |
|
67 |
SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSPreferencesPage_52, CVSUIMessages.CVSPreferencesPage_53); |
61 |
PreferenceLinkArea proxyLink = SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSPreferencesPage_52, CVSUIMessages.CVSPreferencesPage_53); |
68 |
|
62 |
|
69 |
SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSPreferencesPage_54, CVSUIMessages.CVSPreferencesPage_55); |
63 |
PreferenceLinkArea ssh2Link = SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSPreferencesPage_54, CVSUIMessages.CVSPreferencesPage_55); |
|
|
64 |
|
65 |
// lay out controls in a different order than they were created in |
66 |
FormLayout formLayout = new FormLayout(); |
67 |
composite.setLayout(formLayout); |
68 |
|
69 |
FormData data = new FormData(); |
70 |
data.top = new FormAttachment(0, SWT.DEFAULT); |
71 |
data.left = new FormAttachment(0, 0); |
72 |
data.right = new FormAttachment(100, 0); |
73 |
useExternal.setLayoutData(data); |
74 |
|
75 |
data = new FormData(); |
76 |
data.top = new FormAttachment(useExternal, 5, SWT.DEFAULT); |
77 |
data.left = new FormAttachment(0, 0); |
78 |
data.right = new FormAttachment(100, 0); |
79 |
external.setLayoutData(data); |
80 |
|
81 |
data = new FormData(); |
82 |
data.top = new FormAttachment(external, 5, SWT.DEFAULT); |
83 |
data.left = new FormAttachment(0, 0); |
84 |
data.right = new FormAttachment(100, 0); |
85 |
useInternal.setLayoutData(data); |
86 |
|
87 |
data = new FormData(); |
88 |
data.top = new FormAttachment(useInternal, 5, SWT.DEFAULT); |
89 |
data.left = new FormAttachment(0, 0); |
90 |
data.right = new FormAttachment(100, 0); |
91 |
internal.setLayoutData(data); |
92 |
|
93 |
data = new FormData(); |
94 |
data.top = new FormAttachment(internal, 5, SWT.DEFAULT); |
95 |
data.left = new FormAttachment(0, 0); |
96 |
data.right = new FormAttachment(100, 0); |
97 |
proxyLink.getControl().setLayoutData(data); |
98 |
|
99 |
data = new FormData(); |
100 |
data.top = new FormAttachment(proxyLink.getControl(), 5, SWT.DEFAULT); |
101 |
data.left = new FormAttachment(0, 0); |
102 |
data.right = new FormAttachment(100, 0); |
103 |
ssh2Link.getControl().setLayoutData(data); |
70 |
|
104 |
|
71 |
initializeDefaults(); |
105 |
initializeDefaults(); |
72 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.EXT_PREFERENCE_PAGE); |
106 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.EXT_PREFERENCE_PAGE); |