/******************************************************************************* * Copyright © 2011, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * *******************************************************************************/ package org.eclipse.edt.ide.ui.internal.preferences; import org.eclipse.core.resources.IProject; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; public class ContentAssistAdvancedPreferencePage extends PropertyAndPreferencePage implements IWorkbenchPreferencePage { private ContentAssistAdvancedConfigurationBlock fConfigurationBlock; public void createControl(Composite parent) { IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); fConfigurationBlock= new ContentAssistAdvancedConfigurationBlock(getNewStatusChangedListener(), container); super.createControl(parent); } protected Control createPreferenceContent(Composite composite) { return fConfigurationBlock.createContents(composite); } protected boolean hasProjectSpecificOptions(IProject project) { return false; } protected String getPreferencePageID() { return "org.eclipse.edt.ide.ui.ContentAssistAdvancedPreferences"; //$NON-NLS-1$ } protected String getPropertyPageID() { return null; } public void dispose() { if (fConfigurationBlock != null) { fConfigurationBlock.dispose(); } super.dispose(); } protected void performDefaults() { super.performDefaults(); if (fConfigurationBlock != null) { fConfigurationBlock.performDefaults(); } } public boolean performOk() { if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) { return false; } return super.performOk(); } public void performApply() { if (fConfigurationBlock != null) { fConfigurationBlock.performApply(); } } }