1
/*******************************************************************************
2
* Copyright (c) 2004, 2009 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 Corp. - Rational Software - initial implementation
10
* Anton Leherbauer (Wind River Systems)
11
* Markus Schorn (Wind River Systems)
12
*******************************************************************************/
14
package org.eclipse.cdt.ui.dialogs;
16
import org.eclipse.core.resources.IProject;
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.IAdaptable;
19
import org.eclipse.core.runtime.NullProgressMonitor;
20
import org.eclipse.core.runtime.Preferences;
21
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.layout.GridLayout;
23
import org.eclipse.swt.widgets.Composite;
24
import org.eclipse.swt.widgets.Control;
25
import org.eclipse.ui.PlatformUI;
26
import org.eclipse.ui.dialogs.PropertyPage;
28
import org.eclipse.cdt.ui.CUIPlugin;
30
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
33
* @noextend This class is not intended to be subclassed by clients.
35
public class IndexerOptionPropertyPage extends PropertyPage implements ICOptionContainer {
37
private IndexerBlock optionPage;
39
public IndexerOptionPropertyPage(){
41
optionPage = new IndexerBlock();
42
optionPage.setContainer(this);
46
protected Control createContents(Composite parent) {
47
Composite composite = new Composite(parent, SWT.NONE);
48
composite.setLayout(new GridLayout());
50
optionPage.createControl(composite);
51
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICHelpContextIds.PROJECT_INDEXER_PROPERTIES);
57
protected void performDefaults() {
58
optionPage.performDefaults();
62
public boolean performOk() {
64
optionPage.performApply(new NullProgressMonitor());
65
} catch (CoreException e) {
71
public IProject getProject(){
72
IProject project= null;
73
IAdaptable elem = getElement();
74
if (elem instanceof IProject) {
75
project= (IProject) elem;
76
} else if (elem != null) {
77
project= (IProject) elem.getAdapter(IProject.class);
82
public Preferences getPreferences() {
83
throw new UnsupportedOperationException();
86
public void updateContainer() {