KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > dialogs > IDEEditorsPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.ide.dialogs;
12
13 import org.eclipse.swt.SWT;
14 import org.eclipse.swt.layout.GridData;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17 import org.eclipse.ui.dialogs.PreferenceLinkArea;
18 import org.eclipse.ui.internal.dialogs.EditorsPreferencePage;
19 import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
20 import org.eclipse.ui.internal.tweaklets.TabBehaviour;
21 import org.eclipse.ui.internal.tweaklets.Tweaklets;
22 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
23
24 /**
25  * Extends the Editors preference page with IDE-specific settings.
26  *
27  * Note: want IDE settings to appear in main Editors preference page (via
28  * subclassing), however the superclass, EditorsPreferencePage, is internal
29  */

30 public class IDEEditorsPreferencePage extends EditorsPreferencePage {
31
32     protected Control createContents(Composite parent) {
33         Composite composite = createComposite(parent);
34         
35         PreferenceLinkArea fileEditorsArea = new PreferenceLinkArea(composite, SWT.NONE,
36                 "org.eclipse.ui.preferencePages.FileEditors", IDEWorkbenchMessages.IDEEditorsPreferencePage_WorkbenchPreference_FileEditorsRelatedLink,//$NON-NLS-1$
37
(IWorkbenchPreferenceContainer) getContainer(),null);
38
39         GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
40         fileEditorsArea.getControl().setLayoutData(data);
41
42         PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(composite, SWT.NONE,
43                 "org.eclipse.ui.preferencePages.ContentTypes", IDEWorkbenchMessages.IDEEditorsPreferencePage_WorkbenchPreference_contentTypesRelatedLink,//$NON-NLS-1$
44
(IWorkbenchPreferenceContainer) getContainer(),null);
45         
46         data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
47         contentTypeArea.getControl().setLayoutData(data);
48         
49         PreferenceLinkArea appearanceArea = new PreferenceLinkArea(composite, SWT.NONE,
50                 "org.eclipse.ui.preferencePages.Views", IDEWorkbenchMessages.IDEEditorsPreferencePage_WorkbenchPreference_viewsRelatedLink,//$NON-NLS-1$
51
(IWorkbenchPreferenceContainer) getContainer(),null);
52
53         data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
54         appearanceArea.getControl().setLayoutData(data);
55             
56         createEditorHistoryGroup(composite);
57
58         createSpace(composite);
59         createShowMultipleEditorTabsPref(composite);
60         createUseIPersistablePref(composite);
61         createPromptWhenStillOpenPref(composite);
62         createEditorReuseGroup(composite);
63         ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).setPreferenceVisibility(editorReuseGroup, showMultipleEditorTabs);
64
65         applyDialogFont(composite);
66         
67         super.setHelpContext(parent);
68         
69         return composite;
70     }
71     
72 }
73
Popular Tags