1 /*******************************************************************************
2 * Copyright (c) 2005, 2011 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 *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.preferences;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Control;
16 import org.eclipse.core.resources.IProject;
18 import org.eclipse.ui.PlatformUI;
19 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
21 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
23 public final class CodeAssistAdvancedPreferencePage extends PropertyAndPreferencePage {
25 private CodeAssistAdvancedConfigurationBlock fConfigurationBlock;
28 public void createControl(Composite parent) {
29 IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer();
30 fConfigurationBlock= new CodeAssistAdvancedConfigurationBlock(getNewStatusChangedListener(), container);
32 super.createControl(parent);
33 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
37 protected Control createPreferenceContent(Composite composite) {
38 return fConfigurationBlock.createContents(composite);
42 protected boolean hasProjectSpecificOptions(IProject project) {
47 protected String getPreferencePageID() {
48 return "org.eclipse.jdt.ui.preferences.CodeAssistPreferenceAdvanced"; //$NON-NLS-1$
52 protected String getPropertyPageID() {
57 * @see org.eclipse.jface.dialogs.DialogPage#dispose()
60 public void dispose() {
61 if (fConfigurationBlock != null) {
62 fConfigurationBlock.dispose();
68 * @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
71 protected void performDefaults() {
72 super.performDefaults();
73 if (fConfigurationBlock != null) {
74 fConfigurationBlock.performDefaults();
79 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
82 public boolean performOk() {
83 if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) {
86 return super.performOk();
90 * @see org.eclipse.jface.preference.IPreferencePage#performApply()
93 public void performApply() {
94 if (fConfigurationBlock != null) {
95 fConfigurationBlock.performApply();