01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide.dialogs;
11:
12: import org.eclipse.swt.SWT;
13: import org.eclipse.swt.layout.GridData;
14: import org.eclipse.swt.widgets.Composite;
15: import org.eclipse.swt.widgets.Control;
16: import org.eclipse.ui.dialogs.PreferenceLinkArea;
17: import org.eclipse.ui.internal.dialogs.EditorsPreferencePage;
18: import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
19: import org.eclipse.ui.internal.tweaklets.TabBehaviour;
20: import org.eclipse.ui.internal.tweaklets.Tweaklets;
21: import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
22:
23: /**
24: * Extends the Editors preference page with IDE-specific settings.
25: *
26: * Note: want IDE settings to appear in main Editors preference page (via
27: * subclassing), however the superclass, EditorsPreferencePage, is internal
28: */
29: public class IDEEditorsPreferencePage extends EditorsPreferencePage {
30:
31: protected Control createContents(Composite parent) {
32: Composite composite = createComposite(parent);
33:
34: PreferenceLinkArea fileEditorsArea = new PreferenceLinkArea(
35: composite,
36: SWT.NONE,
37: "org.eclipse.ui.preferencePages.FileEditors", IDEWorkbenchMessages.IDEEditorsPreferencePage_WorkbenchPreference_FileEditorsRelatedLink,//$NON-NLS-1$
38: (IWorkbenchPreferenceContainer) getContainer(), null);
39:
40: GridData data = new GridData(GridData.FILL_HORIZONTAL
41: | GridData.GRAB_HORIZONTAL);
42: fileEditorsArea.getControl().setLayoutData(data);
43:
44: PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(
45: composite,
46: SWT.NONE,
47: "org.eclipse.ui.preferencePages.ContentTypes", IDEWorkbenchMessages.IDEEditorsPreferencePage_WorkbenchPreference_contentTypesRelatedLink,//$NON-NLS-1$
48: (IWorkbenchPreferenceContainer) getContainer(), null);
49:
50: data = new GridData(GridData.FILL_HORIZONTAL
51: | GridData.GRAB_HORIZONTAL);
52: contentTypeArea.getControl().setLayoutData(data);
53:
54: PreferenceLinkArea appearanceArea = new PreferenceLinkArea(
55: composite,
56: SWT.NONE,
57: "org.eclipse.ui.preferencePages.Views", IDEWorkbenchMessages.IDEEditorsPreferencePage_WorkbenchPreference_viewsRelatedLink,//$NON-NLS-1$
58: (IWorkbenchPreferenceContainer) getContainer(), null);
59:
60: data = new GridData(GridData.FILL_HORIZONTAL
61: | GridData.GRAB_HORIZONTAL);
62: appearanceArea.getControl().setLayoutData(data);
63:
64: createEditorHistoryGroup(composite);
65:
66: createSpace(composite);
67: createShowMultipleEditorTabsPref(composite);
68: createUseIPersistablePref(composite);
69: createPromptWhenStillOpenPref(composite);
70: createEditorReuseGroup(composite);
71: ((TabBehaviour) Tweaklets.get(TabBehaviour.KEY))
72: .setPreferenceVisibility(editorReuseGroup,
73: showMultipleEditorTabs);
74:
75: applyDialogFont(composite);
76:
77: super.setHelpContext(parent);
78:
79: return composite;
80: }
81:
82: }
|