1
/*******************************************************************************
2
* Copyright (c) 2005, 2008 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
9
* IBM Corporation - initial API and implementation
10
* Anton Leherbauer (Wind River Systems)
11
*******************************************************************************/
12
package org.eclipse.cdt.internal.ui.preferences;
14
import org.eclipse.core.resources.IProject;
16
import org.eclipse.swt.widgets.Composite;
17
import org.eclipse.swt.widgets.Control;
19
import org.eclipse.ui.PlatformUI;
20
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
22
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
24
public final class CodeAssistAdvancedPreferencePage extends PropertyAndPreferencePage {
26
private CodeAssistAdvancedConfigurationBlock fConfigurationBlock;
29
public void createControl(Composite parent) {
30
IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer();
31
fConfigurationBlock= new CodeAssistAdvancedConfigurationBlock(getNewStatusChangedListener(), container);
33
super.createControl(parent);
34
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ICHelpContextIds.C_EDITOR_PREF_PAGE);
38
protected Control createPreferenceContent(Composite composite) {
39
return fConfigurationBlock.createContents(composite);
43
protected boolean hasProjectSpecificOptions(IProject project) {
48
protected String getPreferencePageID() {
49
return "org.eclipse.cdt.ui.preferences.CodeAssistPreferenceAdvanced"; //$NON-NLS-1$
53
protected String getPropertyPageID() {
54
// no project settings supported
59
* @see org.eclipse.jface.dialogs.DialogPage#dispose()
62
public void dispose() {
63
if (fConfigurationBlock != null) {
64
fConfigurationBlock.dispose();
70
* @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
73
protected void performDefaults() {
74
super.performDefaults();
75
if (fConfigurationBlock != null) {
76
fConfigurationBlock.performDefaults();
81
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
84
public boolean performOk() {
85
if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) {
88
return super.performOk();
92
* @see org.eclipse.jface.preference.IPreferencePage#performApply()
95
public void performApply() {
96
if (fConfigurationBlock != null) {
97
fConfigurationBlock.performApply();