~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedPreferencePage.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
 *
 
8
 * Contributors:
 
9
 *     IBM Corporation - initial API and implementation
 
10
 *     Anton Leherbauer (Wind River Systems)
 
11
 *******************************************************************************/
 
12
package org.eclipse.cdt.internal.ui.preferences;
 
13
 
 
14
import org.eclipse.core.resources.IProject;
 
15
 
 
16
import org.eclipse.swt.widgets.Composite;
 
17
import org.eclipse.swt.widgets.Control;
 
18
 
 
19
import org.eclipse.ui.PlatformUI;
 
20
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
 
21
 
 
22
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
 
23
 
 
24
public final class CodeAssistAdvancedPreferencePage extends PropertyAndPreferencePage  {
 
25
 
 
26
        private CodeAssistAdvancedConfigurationBlock fConfigurationBlock;
 
27
 
 
28
        @Override
 
29
        public void createControl(Composite parent) {
 
30
                IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer();
 
31
                fConfigurationBlock= new CodeAssistAdvancedConfigurationBlock(getNewStatusChangedListener(), container);
 
32
                
 
33
                super.createControl(parent);
 
34
                PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ICHelpContextIds.C_EDITOR_PREF_PAGE);
 
35
        }
 
36
 
 
37
        @Override
 
38
        protected Control createPreferenceContent(Composite composite) {
 
39
                return fConfigurationBlock.createContents(composite);
 
40
        }
 
41
 
 
42
        @Override
 
43
        protected boolean hasProjectSpecificOptions(IProject project) {
 
44
                return false;
 
45
        }
 
46
 
 
47
        @Override
 
48
        protected String getPreferencePageID() {
 
49
                return "org.eclipse.cdt.ui.preferences.CodeAssistPreferenceAdvanced"; //$NON-NLS-1$
 
50
        }
 
51
 
 
52
        @Override
 
53
        protected String getPropertyPageID() {
 
54
                // no project settings supported
 
55
                return null;
 
56
        }
 
57
        
 
58
        /*
 
59
         * @see org.eclipse.jface.dialogs.DialogPage#dispose()
 
60
         */
 
61
        @Override
 
62
        public void dispose() {
 
63
                if (fConfigurationBlock != null) {
 
64
                        fConfigurationBlock.dispose();
 
65
                }
 
66
                super.dispose();
 
67
        }
 
68
        
 
69
        /*
 
70
         * @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
 
71
         */
 
72
        @Override
 
73
        protected void performDefaults() {
 
74
                super.performDefaults();
 
75
                if (fConfigurationBlock != null) {
 
76
                        fConfigurationBlock.performDefaults();
 
77
                }
 
78
        }
 
79
 
 
80
        /*
 
81
         * @see org.eclipse.jface.preference.IPreferencePage#performOk()
 
82
         */
 
83
        @Override
 
84
        public boolean performOk() {
 
85
                if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) {
 
86
                        return false;
 
87
                }       
 
88
                return super.performOk();
 
89
        }
 
90
        
 
91
        /*
 
92
         * @see org.eclipse.jface.preference.IPreferencePage#performApply()
 
93
         */
 
94
        @Override
 
95
        public void performApply() {
 
96
                if (fConfigurationBlock != null) {
 
97
                        fConfigurationBlock.performApply();
 
98
                }
 
99
        }
 
100
}