KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > preferences > CodeAssistAdvancedPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.jdt.internal.ui.preferences;
12
13 import org.eclipse.core.resources.IProject;
14
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17
18 import org.eclipse.ui.PlatformUI;
19 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
20
21 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
22
23 public final class CodeAssistAdvancedPreferencePage extends PropertyAndPreferencePage {
24
25     private CodeAssistAdvancedConfigurationBlock fConfigurationBlock;
26
27     public void createControl(Composite parent) {
28         IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer();
29         fConfigurationBlock= new CodeAssistAdvancedConfigurationBlock(getNewStatusChangedListener(), container);
30         
31         super.createControl(parent);
32         PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
33     }
34
35     protected Control createPreferenceContent(Composite composite) {
36         return fConfigurationBlock.createContents(composite);
37     }
38
39     protected boolean hasProjectSpecificOptions(IProject project) {
40         return false;
41     }
42
43     protected String JavaDoc getPreferencePageID() {
44         return "org.eclipse.jdt.ui.preferences.CodeAssistPreferenceAdvanced"; //$NON-NLS-1$
45
}
46
47     protected String JavaDoc getPropertyPageID() {
48         return null;
49     }
50     
51         /* (non-Javadoc)
52      * @see org.eclipse.jface.dialogs.DialogPage#dispose()
53      */

54     public void dispose() {
55         if (fConfigurationBlock != null) {
56             fConfigurationBlock.dispose();
57         }
58         super.dispose();
59     }
60     
61     /*
62      * @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
63      */

64     protected void performDefaults() {
65         super.performDefaults();
66         if (fConfigurationBlock != null) {
67             fConfigurationBlock.performDefaults();
68         }
69     }
70
71     /*
72      * @see org.eclipse.jface.preference.IPreferencePage#performOk()
73      */

74     public boolean performOk() {
75         if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) {
76             return false;
77         }
78         return super.performOk();
79     }
80     
81     /*
82      * @see org.eclipse.jface.preference.IPreferencePage#performApply()
83      */

84     public void performApply() {
85         if (fConfigurationBlock != null) {
86             fConfigurationBlock.performApply();
87         }
88     }
89 }
90
Popular Tags