01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 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.jdt.internal.ui.preferences;
11:
12: import org.eclipse.core.resources.IProject;
13:
14: import org.eclipse.swt.widgets.Composite;
15: import org.eclipse.swt.widgets.Control;
16:
17: import org.eclipse.ui.PlatformUI;
18: import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
19:
20: import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
21:
22: public final class CodeAssistAdvancedPreferencePage extends
23: PropertyAndPreferencePage {
24:
25: private CodeAssistAdvancedConfigurationBlock fConfigurationBlock;
26:
27: public void createControl(Composite parent) {
28: IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
29: fConfigurationBlock = new CodeAssistAdvancedConfigurationBlock(
30: getNewStatusChangedListener(), container);
31:
32: super .createControl(parent);
33: PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
34: IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
35: }
36:
37: protected Control createPreferenceContent(Composite composite) {
38: return fConfigurationBlock.createContents(composite);
39: }
40:
41: protected boolean hasProjectSpecificOptions(IProject project) {
42: return false;
43: }
44:
45: protected String getPreferencePageID() {
46: return "org.eclipse.jdt.ui.preferences.CodeAssistPreferenceAdvanced"; //$NON-NLS-1$
47: }
48:
49: protected String getPropertyPageID() {
50: return null;
51: }
52:
53: /* (non-Javadoc)
54: * @see org.eclipse.jface.dialogs.DialogPage#dispose()
55: */
56: public void dispose() {
57: if (fConfigurationBlock != null) {
58: fConfigurationBlock.dispose();
59: }
60: super .dispose();
61: }
62:
63: /*
64: * @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
65: */
66: protected void performDefaults() {
67: super .performDefaults();
68: if (fConfigurationBlock != null) {
69: fConfigurationBlock.performDefaults();
70: }
71: }
72:
73: /*
74: * @see org.eclipse.jface.preference.IPreferencePage#performOk()
75: */
76: public boolean performOk() {
77: if (fConfigurationBlock != null
78: && !fConfigurationBlock.performOk()) {
79: return false;
80: }
81: return super .performOk();
82: }
83:
84: /*
85: * @see org.eclipse.jface.preference.IPreferencePage#performApply()
86: */
87: public void performApply() {
88: if (fConfigurationBlock != null) {
89: fConfigurationBlock.performApply();
90: }
91: }
92: }
|