added missing action descriptions
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / preferences / CompilerConfigurationBlock.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.preferences;
12
13 import java.util.ArrayList;
14 import java.util.Map;
15
16 import net.sourceforge.phpdt.core.IJavaProject;
17 import net.sourceforge.phpdt.core.JavaCore;
18 import net.sourceforge.phpdt.internal.ui.dialogs.StatusInfo;
19 import net.sourceforge.phpdt.internal.ui.dialogs.StatusUtil;
20 import net.sourceforge.phpdt.internal.ui.util.PixelConverter;
21 import net.sourceforge.phpdt.internal.ui.util.TabFolderLayout;
22 import net.sourceforge.phpdt.internal.ui.wizards.IStatusChangeListener;
23
24 import org.eclipse.core.runtime.IStatus;
25 import org.eclipse.swt.SWT;
26 import org.eclipse.swt.layout.GridData;
27 import org.eclipse.swt.layout.GridLayout;
28 import org.eclipse.swt.widgets.Composite;
29 import org.eclipse.swt.widgets.Control;
30 import org.eclipse.swt.widgets.Label;
31 import org.eclipse.swt.widgets.TabFolder;
32 import org.eclipse.swt.widgets.TabItem;
33 import org.eclipse.swt.widgets.Text;
34
35 /**
36   */
37 public class CompilerConfigurationBlock extends OptionsConfigurationBlock {
38
39         // Preference store keys, see JavaCore.getOptions
40     private static final String PREF_PB_PHP_VAR_DEPRECATED= JavaCore.COMPILER_PB_PHP_VAR_DEPRECATED;
41     private static final String PREF_PB_PHP_KEYWORD= JavaCore.COMPILER_PB_PHP_KEYWORD;
42     private static final String PREF_PB_PHP_UPPERCASE_IDENTIFIER= JavaCore.COMPILER_PB_PHP_UPPERCASE_IDENTIFIER;
43     private static final String PREF_PB_PHP_FILE_NOT_EXIST= JavaCore.COMPILER_PB_PHP_FILE_NOT_EXIST;
44     private static final String PREF_PB_UNREACHABLE_CODE= JavaCore.COMPILER_PB_UNREACHABLE_CODE;
45     private static final String PREF_PB_UNINITIALIZED_LOCAL_VARIABLE= JavaCore.COMPILER_PB_UNINITIALIZED_LOCAL_VARIABLE;
46 //      private static final String PREF_LOCAL_VARIABLE_ATTR=  JavaCore.COMPILER_LOCAL_VARIABLE_ATTR;
47 //      private static final String PREF_LINE_NUMBER_ATTR= JavaCore.COMPILER_LINE_NUMBER_ATTR;
48 //      private static final String PREF_SOURCE_FILE_ATTR= JavaCore.COMPILER_SOURCE_FILE_ATTR;
49 //      private static final String PREF_CODEGEN_UNUSED_LOCAL= JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL;
50 //      private static final String PREF_CODEGEN_TARGET_PLATFORM= JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM;
51         //private static final String PREF_PB_UNREACHABLE_CODE= JavaCore.COMPILER_PB_UNREACHABLE_CODE;
52         //private static final String PREF_PB_INVALID_IMPORT= JavaCore.COMPILER_PB_INVALID_IMPORT;
53 //      private static final String PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD= JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD;
54 //      private static final String PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME;
55 //      private static final String PREF_PB_DEPRECATION= JavaCore.COMPILER_PB_DEPRECATION;
56 //      private static final String PREF_PB_DEPRECATION_WHEN_OVERRIDING= JavaCore.COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD;
57         
58 //      private static final String PREF_PB_HIDDEN_CATCH_BLOCK= JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK;
59 //      private static final String PREF_PB_UNUSED_LOCAL= JavaCore.COMPILER_PB_UNUSED_LOCAL;
60 //      private static final String PREF_PB_UNUSED_PARAMETER= JavaCore.COMPILER_PB_UNUSED_PARAMETER;
61 //      private static final String PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING= JavaCore.COMPILER_PB_UNUSED_PARAMETER_WHEN_OVERRIDING_CONCRETE;
62 //      private static final String PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT= JavaCore.COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT;
63 //      private static final String PREF_PB_SYNTHETIC_ACCESS_EMULATION= JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION;
64 //      private static final String PREF_PB_NON_EXTERNALIZED_STRINGS= JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL;
65 //      private static final String PREF_PB_ASSERT_AS_IDENTIFIER= JavaCore.COMPILER_PB_ASSERT_IDENTIFIER;
66         private static final String PREF_PB_MAX_PER_UNIT= JavaCore.COMPILER_PB_MAX_PER_UNIT;
67 //      private static final String PREF_PB_UNUSED_IMPORT= JavaCore.COMPILER_PB_UNUSED_IMPORT;
68 //      private static final String PREF_PB_UNUSED_PRIVATE= JavaCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER;
69 //      private static final String PREF_PB_STATIC_ACCESS_RECEIVER= JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER;
70 //      private static final String PREF_PB_NO_EFFECT_ASSIGNMENT= JavaCore.COMPILER_PB_NO_EFFECT_ASSIGNMENT;
71 //      private static final String PREF_PB_CHAR_ARRAY_IN_CONCAT= JavaCore.COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION;
72 //      private static final String PREF_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT= JavaCore.COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT;
73 //      private static final String PREF_PB_LOCAL_VARIABLE_HIDING= JavaCore.COMPILER_PB_LOCAL_VARIABLE_HIDING;
74 //      private static final String PREF_PB_FIELD_HIDING= JavaCore.COMPILER_PB_FIELD_HIDING;
75 //      private static final String PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD= JavaCore.COMPILER_PB_SPECIAL_PARAMETER_HIDING_FIELD;
76 //      private static final String PREF_PB_INDIRECT_STATIC_ACCESS= JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS;
77 //      private static final String PREF_PB_SUPERFLUOUS_SEMICOLON= JavaCore.COMPILER_PB_SUPERFLUOUS_SEMICOLON;
78 //      private static final String PREF_PB_UNNECESSARY_TYPE_CHECK= JavaCore.COMPILER_PB_UNNECESSARY_TYPE_CHECK;
79         
80 //      private static final String PREF_PB_INVALID_JAVADOC= JavaCore.COMPILER_PB_INVALID_JAVADOC;
81 //      private static final String PREF_PB_INVALID_JAVADOC_TAGS= JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS;
82 //      private static final String PREF_PB_INVALID_JAVADOC_TAGS_VISIBILITY= JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY;
83 //
84 //      private static final String PREF_PB_MISSING_JAVADOC_TAGS= JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS;
85 //      private static final String PREF_PB_MISSING_JAVADOC_TAGS_VISIBILITY= JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY;
86 //      private static final String PREF_PB_MISSING_JAVADOC_TAGS_OVERRIDING= JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING;
87 //
88 //      private static final String PREF_PB_MISSING_JAVADOC_COMMENTS= JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS;
89 //      private static final String PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY= JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY;
90 //      private static final String PREF_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING= JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING;
91 //      
92 //      private static final String PREF_SOURCE_COMPATIBILITY= JavaCore.COMPILER_SOURCE;
93 //      private static final String PREF_COMPLIANCE= JavaCore.COMPILER_COMPLIANCE;
94 //
95 //      private static final String PREF_RESOURCE_FILTER= JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER;
96 //      private static final String PREF_BUILD_INVALID_CLASSPATH= JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH;
97 //      private static final String PREF_BUILD_CLEAN_OUTPUT_FOLDER= JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER;
98 //      private static final String PREF_ENABLE_EXCLUSION_PATTERNS= JavaCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS;
99 //      private static final String PREF_ENABLE_MULTIPLE_OUTPUT_LOCATIONS= JavaCore.CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS;
100 //
101 //      private static final String PREF_PB_INCOMPLETE_BUILDPATH= JavaCore.CORE_INCOMPLETE_CLASSPATH;
102 //      private static final String PREF_PB_CIRCULAR_BUILDPATH= JavaCore.CORE_CIRCULAR_CLASSPATH;
103 ////    private static final String PREF_PB_INCOMPATIBLE_JDK_LEVEL= JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL;
104 //      private static final String PREF_PB_DEPRECATION_IN_DEPRECATED_CODE= JavaCore.COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE;
105 //      private static final String PREF_PB_DUPLICATE_RESOURCE= JavaCore.CORE_JAVA_BUILD_DUPLICATE_RESOURCE;
106 //      private static final String PREF_PB_INCOMPATIBLE_INTERFACE_METHOD= JavaCore.COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD;
107
108 //      private static final String PREF_PB_UNDOCUMENTED_EMPTY_BLOCK= JavaCore.COMPILER_PB_UNDOCUMENTED_EMPTY_BLOCK;
109 //      private static final String PREF_PB_FINALLY_BLOCK_NOT_COMPLETING= JavaCore.COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING;
110 //      private static final String PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION= JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION;
111 //      private static final String PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING= JavaCore.COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING;
112 //      private static final String PREF_PB_UNQUALIFIED_FIELD_ACCESS= JavaCore.COMPILER_PB_UNQUALIFIED_FIELD_ACCESS;
113         
114 //      private static final String INTR_DEFAULT_COMPLIANCE= "internal.default.compliance"; //$NON-NLS-1$
115
116         // values
117         private static final String GENERATE= JavaCore.GENERATE;
118         private static final String DO_NOT_GENERATE= JavaCore.DO_NOT_GENERATE;
119         
120         private static final String PRESERVE= JavaCore.PRESERVE;
121         private static final String OPTIMIZE_OUT= JavaCore.OPTIMIZE_OUT;
122         
123         private static final String VERSION_1_1= JavaCore.VERSION_1_1;
124         private static final String VERSION_1_2= JavaCore.VERSION_1_2;
125         private static final String VERSION_1_3= JavaCore.VERSION_1_3;
126         private static final String VERSION_1_4= JavaCore.VERSION_1_4;
127         
128         private static final String ERROR= JavaCore.ERROR;
129         private static final String WARNING= JavaCore.WARNING;
130         private static final String IGNORE= JavaCore.IGNORE;
131         private static final String ABORT= JavaCore.ABORT;
132         
133         private static final String CLEAN= JavaCore.CLEAN;
134
135         private static final String ENABLED= JavaCore.ENABLED;
136         private static final String DISABLED= JavaCore.DISABLED;
137         
138 //      private static final String PUBLIC= JavaCore.PUBLIC;
139 //      private static final String PROTECTED= JavaCore.PROTECTED;
140 //      private static final String DEFAULT= JavaCore.DEFAULT;
141 //      private static final String PRIVATE= JavaCore.PRIVATE;
142         
143         private static final String DEFAULT_CONF= "default"; //$NON-NLS-1$
144         private static final String USER_CONF= "user";   //$NON-NLS-1$
145
146         private ArrayList fComplianceControls;
147         private PixelConverter fPixelConverter;
148
149         private IStatus fMaxNumberProblemsStatus;
150 //      private IStatus fComplianceStatus, fMaxNumberProblemsStatus, fResourceFilterStatus;
151
152         public CompilerConfigurationBlock(IStatusChangeListener context, IJavaProject project) {
153                 super(context, project, getKeys());
154                 
155                 fComplianceControls= new ArrayList();
156                         
157 //              fComplianceStatus= new StatusInfo();
158                 fMaxNumberProblemsStatus= new StatusInfo();
159 //              fResourceFilterStatus= new StatusInfo();
160                 
161                 // compatibilty code for the merge of the two option PB_SIGNAL_PARAMETER: 
162 //              if (ENABLED.equals(fWorkingValues.get(PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT))) {
163 //                      fWorkingValues.put(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING, ENABLED);
164 //              }
165                 
166         }
167         
168         private final static String[] KEYS= new String[] {
169             PREF_PB_PHP_FILE_NOT_EXIST,
170             PREF_PB_PHP_VAR_DEPRECATED,
171             PREF_PB_PHP_KEYWORD,
172             PREF_PB_PHP_UPPERCASE_IDENTIFIER,
173             PREF_PB_UNREACHABLE_CODE,
174             PREF_PB_UNINITIALIZED_LOCAL_VARIABLE,
175 //              PREF_LOCAL_VARIABLE_ATTR, 
176 //              PREF_LINE_NUMBER_ATTR, PREF_SOURCE_FILE_ATTR, PREF_CODEGEN_UNUSED_LOCAL,
177 //              PREF_CODEGEN_TARGET_PLATFORM, 
178 //              PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, 
179 //              PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, 
180 //              PREF_PB_DEPRECATION, 
181 //              PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
182 //              PREF_PB_UNUSED_PARAMETER, 
183 //              PREF_PB_SYNTHETIC_ACCESS_EMULATION, PREF_PB_NON_EXTERNALIZED_STRINGS,
184 //              PREF_PB_ASSERT_AS_IDENTIFIER, 
185 //              PREF_PB_UNUSED_IMPORT, 
186                 PREF_PB_MAX_PER_UNIT, 
187 //              PREF_SOURCE_COMPATIBILITY, 
188 //              PREF_COMPLIANCE, 
189 //              PREF_RESOURCE_FILTER, PREF_BUILD_INVALID_CLASSPATH, PREF_PB_STATIC_ACCESS_RECEIVER, PREF_PB_INCOMPLETE_BUILDPATH,
190 //              PREF_PB_CIRCULAR_BUILDPATH, PREF_PB_DEPRECATION_IN_DEPRECATED_CODE, PREF_BUILD_CLEAN_OUTPUT_FOLDER,
191 //              PREF_PB_DUPLICATE_RESOURCE, PREF_PB_NO_EFFECT_ASSIGNMENT, PREF_PB_INCOMPATIBLE_INTERFACE_METHOD,
192 //              PREF_PB_UNUSED_PRIVATE, PREF_PB_CHAR_ARRAY_IN_CONCAT, PREF_ENABLE_EXCLUSION_PATTERNS, PREF_ENABLE_MULTIPLE_OUTPUT_LOCATIONS,
193 //              PREF_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT, 
194 //              PREF_PB_LOCAL_VARIABLE_HIDING, 
195 //              PREF_PB_FIELD_HIDING,
196 //              PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD, 
197 //              PREF_PB_INCOMPATIBLE_JDK_LEVEL, 
198 //              PREF_PB_INDIRECT_STATIC_ACCESS,
199 //              PREF_PB_SUPERFLUOUS_SEMICOLON, 
200 //              PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING, 
201 //              PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT,
202 //              PREF_PB_UNNECESSARY_TYPE_CHECK, 
203 //              PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, 
204 //              PREF_PB_UNQUALIFIED_FIELD_ACCESS,
205 //              PREF_PB_UNDOCUMENTED_EMPTY_BLOCK, 
206 //              PREF_PB_FINALLY_BLOCK_NOT_COMPLETING, 
207 //              PREF_PB_DEPRECATION_WHEN_OVERRIDING,
208 //              PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING,
209
210 //              PREF_PB_INVALID_JAVADOC, 
211 //              PREF_PB_INVALID_JAVADOC_TAGS_VISIBILITY, 
212 //              PREF_PB_INVALID_JAVADOC_TAGS_VISIBILITY,
213 //              PREF_PB_MISSING_JAVADOC_TAGS, 
214 //              PREF_PB_MISSING_JAVADOC_TAGS_VISIBILITY, 
215 //              PREF_PB_MISSING_JAVADOC_TAGS_OVERRIDING,
216 //              PREF_PB_MISSING_JAVADOC_COMMENTS, 
217 //              PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY, 
218 //              PREF_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING
219         };      
220         
221         private static  String[] getKeys() {
222                 return KEYS;    
223         }
224         
225         protected final Map getOptions(boolean inheritJavaCoreOptions) {
226                 Map map= super.getOptions(inheritJavaCoreOptions);
227         //      map.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance(map));
228                 return map;
229         }
230         
231         protected final Map getDefaultOptions() {
232                 Map map= super.getDefaultOptions();
233         //      map.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance(map));
234                 return map;
235         }       
236         
237         
238         /*
239          * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
240          */
241         protected Control createContents(Composite parent) {
242                 fPixelConverter= new PixelConverter(parent);
243                 setShell(parent.getShell());
244                 
245                 TabFolder folder= new TabFolder(parent, SWT.NONE);
246                 folder.setLayout(new TabFolderLayout());        
247                 folder.setLayoutData(new GridData(GridData.FILL_BOTH));
248                 
249                 Composite commonComposite= createStyleTabContent(folder);
250 //              Composite unusedComposite= createUnusedCodeTabContent(folder);
251                 Composite advancedComposite= createAdvancedTabContent(folder);
252 //              Composite javadocComposite= createJavadocTabContent(folder);
253 //              Composite complianceComposite= createComplianceTabContent(folder);
254 //              Composite othersComposite= createBuildPathTabContent(folder);
255
256                 TabItem item= new TabItem(folder, SWT.NONE);
257                 item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.common.tabtitle")); //$NON-NLS-1$
258                 item.setControl(commonComposite);
259
260                 item= new TabItem(folder, SWT.NONE);
261                 item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.advanced.tabtitle")); //$NON-NLS-1$
262                 item.setControl(advancedComposite);
263
264 //              item= new TabItem(folder, SWT.NONE);
265 //              item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.unused.tabtitle")); //$NON-NLS-1$
266 //              item.setControl(unusedComposite);
267                 
268 //              item= new TabItem(folder, SWT.NONE);
269 //              item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.javadoc.tabtitle")); //$NON-NLS-1$
270 //              item.setControl(javadocComposite);
271         
272 //              item= new TabItem(folder, SWT.NONE);
273 //              item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.compliance.tabtitle")); //$NON-NLS-1$
274 //              item.setControl(complianceComposite);
275                 
276 //              item= new TabItem(folder, SWT.NONE);
277 //              item.setText(PreferencesMessages.getString("CompilerConfigurationBlock.others.tabtitle")); //$NON-NLS-1$
278 //              item.setControl(othersComposite);               
279                 
280                 validateSettings(null, null);
281         
282                 return folder;
283         }
284
285         private Composite createStyleTabContent(Composite folder) {
286                 String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
287                 
288                 String[] errorWarningIgnoreLabels= new String[] {
289                         PreferencesMessages.getString("CompilerConfigurationBlock.error"),  //$NON-NLS-1$
290                         PreferencesMessages.getString("CompilerConfigurationBlock.warning"), //$NON-NLS-1$
291                         PreferencesMessages.getString("CompilerConfigurationBlock.ignore") //$NON-NLS-1$
292                 };
293                 
294                 int nColumns= 3;
295                 
296                 GridLayout layout= new GridLayout();
297                 layout.numColumns= nColumns;
298
299                 Composite composite= new Composite(folder, SWT.NULL);
300                 composite.setLayout(layout);
301                 
302                 Label description= new Label(composite, SWT.WRAP);
303                 description.setText(PreferencesMessages.getString("CompilerConfigurationBlock.common.description")); //$NON-NLS-1$
304                 GridData gd= new GridData();
305                 gd.horizontalSpan= nColumns;
306                 gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(50);
307                 description.setLayoutData(gd);          
308
309                 String label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_file_not_exist.label"); //$NON-NLS-1$
310                 addComboBox(composite, label, PREF_PB_PHP_FILE_NOT_EXIST, errorWarningIgnore, errorWarningIgnoreLabels, 0);                     
311                 
312                 label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_var_deprecated.label"); //$NON-NLS-1$
313                 addComboBox(composite, label, PREF_PB_PHP_VAR_DEPRECATED, errorWarningIgnore, errorWarningIgnoreLabels, 0);                     
314                 
315                 label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_keyword.label"); //$NON-NLS-1$
316                 addComboBox(composite, label, PREF_PB_PHP_KEYWORD, errorWarningIgnore, errorWarningIgnoreLabels, 0);                    
317                 
318                 label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_uppercase_identifier.label"); //$NON-NLS-1$
319                 addComboBox(composite, label, PREF_PB_PHP_UPPERCASE_IDENTIFIER, errorWarningIgnore, errorWarningIgnoreLabels, 0);                       
320                 
321                 label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_unreachable_code.label"); //$NON-NLS-1$
322                 addComboBox(composite, label, PREF_PB_UNREACHABLE_CODE, errorWarningIgnore, errorWarningIgnoreLabels, 0);       
323                 
324                 label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_unitialized_local_variable.label"); //$NON-NLS-1$
325                 addComboBox(composite, label, PREF_PB_UNINITIALIZED_LOCAL_VARIABLE, errorWarningIgnore, errorWarningIgnoreLabels, 0);   
326                 
327                 label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_overriding_pkg_dflt.label"); //$NON-NLS-1$
328 //              addComboBox(composite, label, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, errorWarningIgnore, errorWarningIgnoreLabels, 0);                      
329
330 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_method_naming.label"); //$NON-NLS-1$
331 //              addComboBox(composite, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningIgnore, errorWarningIgnoreLabels, 0);                   
332 //
333 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_hidden_catchblock.label"); //$NON-NLS-1$
334 //              addComboBox(composite, label, PREF_PB_HIDDEN_CATCH_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels, 0);
335 //              
336 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_static_access_receiver.label"); //$NON-NLS-1$
337 //              addComboBox(composite, label, PREF_PB_STATIC_ACCESS_RECEIVER, errorWarningIgnore, errorWarningIgnoreLabels, 0);
338 //              
339 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_no_effect_assignment.label"); //$NON-NLS-1$
340 //              addComboBox(composite, label, PREF_PB_NO_EFFECT_ASSIGNMENT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
341
342 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_indirect_access_to_static.label"); //$NON-NLS-1$
343 //              addComboBox(composite, label, PREF_PB_INDIRECT_STATIC_ACCESS, errorWarningIgnore, errorWarningIgnoreLabels, 0); 
344 //
345 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_accidential_assignement.label"); //$NON-NLS-1$
346 //              addComboBox(composite, label, PREF_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
347 //
348 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_finally_block_not_completing.label"); //$NON-NLS-1$
349 //              addComboBox(composite, label, PREF_PB_FINALLY_BLOCK_NOT_COMPLETING, errorWarningIgnore, errorWarningIgnoreLabels, 0);
350 //
351 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_undocumented_empty_block.label"); //$NON-NLS-1$
352 //              addComboBox(composite, label, PREF_PB_UNDOCUMENTED_EMPTY_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels, 0);
353
354                 
355                 return composite;
356         }
357
358         private Composite createAdvancedTabContent(TabFolder folder) {
359                 String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
360                 
361                 String[] errorWarningIgnoreLabels= new String[] {
362                         PreferencesMessages.getString("CompilerConfigurationBlock.error"),  //$NON-NLS-1$
363                         PreferencesMessages.getString("CompilerConfigurationBlock.warning"), //$NON-NLS-1$
364                         PreferencesMessages.getString("CompilerConfigurationBlock.ignore") //$NON-NLS-1$
365                 };
366                 
367                 String[] enabledDisabled= new String[] { ENABLED, DISABLED };
368                 
369                 int nColumns= 3;
370                 
371                 GridLayout layout= new GridLayout();
372                 layout.numColumns= nColumns;
373                                         
374                 Composite composite= new Composite(folder, SWT.NULL);
375                 composite.setLayout(layout);
376
377                 Label description= new Label(composite, SWT.WRAP);
378                 description.setText(PreferencesMessages.getString("CompilerConfigurationBlock.advanced.description")); //$NON-NLS-1$
379                 GridData gd= new GridData();
380                 gd.horizontalSpan= nColumns;
381                 gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(50);
382                 description.setLayoutData(gd);
383                         
384 //              String label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_synth_access_emul.label"); //$NON-NLS-1$
385 //              addComboBox(composite, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
386
387 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_local_variable_hiding.label"); //$NON-NLS-1$
388 //              addComboBox(composite, label, PREF_PB_LOCAL_VARIABLE_HIDING, errorWarningIgnore, errorWarningIgnoreLabels, 0);
389
390 //              int indent= fPixelConverter.convertWidthInCharsToPixels(2);
391 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_special_param_hiding.label"); //$NON-NLS-1$
392 //              addCheckBox(composite, label, PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD, enabledDisabled, indent);
393
394 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_field_hiding.label"); //$NON-NLS-1$
395 //              addComboBox(composite, label, PREF_PB_FIELD_HIDING, errorWarningIgnore, errorWarningIgnoreLabels, 0);
396
397 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_non_externalized_strings.label"); //$NON-NLS-1$
398 //              addComboBox(composite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
399 //
400 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_incompatible_interface_method.label"); //$NON-NLS-1$
401 //              addComboBox(composite, label, PREF_PB_INCOMPATIBLE_INTERFACE_METHOD, errorWarningIgnore, errorWarningIgnoreLabels, 0);
402 //
403 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_char_array_in_concat.label"); //$NON-NLS-1$
404 //              addComboBox(composite, label, PREF_PB_CHAR_ARRAY_IN_CONCAT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
405
406 //              label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_unqualified_field_access.label"); //$NON-NLS-1$
407 //              addComboBox(composite, label, PREF_PB_UNQUALIFIED_FIELD_ACCESS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
408                 
409                 gd= new GridData();
410                 gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(6);
411                 
412                 String label= PreferencesMessages.getString("CompilerConfigurationBlock.pb_max_per_unit.label"); //$NON-NLS-1$
413                 Text text= addTextField(composite, label, PREF_PB_MAX_PER_UNIT, 0, 0);
414                 text.setTextLimit(6);
415                 text.setLayoutData(gd);
416
417                 return composite;
418         }
419
420         
421         
422                 
423         
424         /* (non-javadoc)
425          * Update fields and validate.
426          * @param changedKey Key that changed, or null, if all changed.
427          */     
428         protected void validateSettings(String changedKey, String newValue) {
429                 
430                 if (changedKey != null) {
431 //                      if (INTR_DEFAULT_COMPLIANCE.equals(changedKey)) {
432 //                              updateComplianceEnableState();
433 //                              if (DEFAULT_CONF.equals(newValue)) {
434 //                                      updateComplianceDefaultSettings();
435 //                              }
436 //                              fComplianceStatus= validateCompliance();
437 //                      } else if (PREF_COMPLIANCE.equals(changedKey)) {
438 //                              if (checkValue(INTR_DEFAULT_COMPLIANCE, DEFAULT_CONF)) {
439 //                                      updateComplianceDefaultSettings();
440 //                              }
441 //                              fComplianceStatus= validateCompliance();
442 //                      } else if (PREF_SOURCE_COMPATIBILITY.equals(changedKey) ||
443 //                                      PREF_CODEGEN_TARGET_PLATFORM.equals(changedKey) ||
444 //                                      PREF_PB_ASSERT_AS_IDENTIFIER.equals(changedKey)) {
445 //                              fComplianceStatus= validateCompliance();
446 //                      } else 
447                           if (PREF_PB_MAX_PER_UNIT.equals(changedKey)) {
448                                 fMaxNumberProblemsStatus= validateMaxNumberProblems();
449 //                      } else if (PREF_RESOURCE_FILTER.equals(changedKey)) {
450 //                              fResourceFilterStatus= validateResourceFilters();
451 //                      } else if (S.equals(changedKey) ||
452 //                                      PREF_PB_DEPRECATION.equals(changedKey) ) { // ||
453 ////                                    PREF_PB_INVALID_JAVADOC.equals(changedKey) ||
454 ////                                    PREF_PB_MISSING_JAVADOC_TAGS.equals(changedKey) ||
455 ////                                    PREF_PB_MISSING_JAVADOC_COMMENTS.equals(changedKey) ||
456 ////                                    PREF_PB_MISSING_JAVADOC_COMMENTS.equals(changedKey) ||
457 ////                                    PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey)) {                          
458 //                              updateEnableStates();
459 //                      } else if (PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING.equals(changedKey)) {
460 //                              // merging the two options
461 //                              fWorkingValues.put(PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT, newValue);
462                         } else {
463                                 return;
464                         }
465                 } else {
466 //                      updateEnableStates();
467 //                      updateComplianceEnableState();
468 //                      fComplianceStatus= validateCompliance();
469                         fMaxNumberProblemsStatus= validateMaxNumberProblems();
470 //                      fResourceFilterStatus= validateResourceFilters();
471                 }               
472 //              IStatus status= StatusUtil.getMostSevere(new IStatus[] { fComplianceStatus, fMaxNumberProblemsStatus, fResourceFilterStatus });
473                 IStatus status= StatusUtil.getMostSevere(new IStatus[] { fMaxNumberProblemsStatus });
474                 fContext.statusChanged(status);
475         }
476         
477 //      private void updateEnableStates() {
478 //              boolean enableUnusedParams= !checkValue(PREF_PB_UNUSED_PARAMETER, IGNORE);
479 //              getCheckBox(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING).setEnabled(enableUnusedParams);
480                 
481 //              boolean enableDeprecation= !checkValue(PREF_PB_DEPRECATION, IGNORE);
482 //              getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation);
483 //              getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation);
484 //              
485 //              boolean enableThrownExceptions= !checkValue(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, IGNORE);
486 //              getCheckBox(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING).setEnabled(enableThrownExceptions);
487 //
488 //              boolean enableHiding= !checkValue(PREF_PB_LOCAL_VARIABLE_HIDING, IGNORE);
489 //              getCheckBox(PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD).setEnabled(enableHiding);
490 //
491 //              boolean enableInvalidTagsErrors= !checkValue(PREF_PB_INVALID_JAVADOC, IGNORE);
492 //              getCheckBox(PREF_PB_INVALID_JAVADOC_TAGS).setEnabled(enableInvalidTagsErrors);
493 //              setComboEnabled(PREF_PB_INVALID_JAVADOC_TAGS_VISIBILITY, enableInvalidTagsErrors);
494 //              
495 //              boolean enableMissingTagsErrors= !checkValue(PREF_PB_MISSING_JAVADOC_TAGS, IGNORE);
496 //              getCheckBox(PREF_PB_MISSING_JAVADOC_TAGS_OVERRIDING).setEnabled(enableMissingTagsErrors);
497 //              setComboEnabled(PREF_PB_MISSING_JAVADOC_TAGS_VISIBILITY, enableMissingTagsErrors);
498 //              
499 //              boolean enableMissingCommentsErrors= !checkValue(PREF_PB_MISSING_JAVADOC_COMMENTS, IGNORE);
500 //              getCheckBox(PREF_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING).setEnabled(enableMissingCommentsErrors);
501 //              setComboEnabled(PREF_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY, enableMissingCommentsErrors);
502 //      }
503
504 //      private IStatus validateCompliance() {
505 //              StatusInfo status= new StatusInfo();
506 //              if (checkValue(PREF_COMPLIANCE, VERSION_1_3)) {
507 //                      if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
508 //                              status.setError(PreferencesMessages.getString("CompilerConfigurationBlock.cpl13src14.error")); //$NON-NLS-1$
509 //                              return status;
510 //                      } else if (checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) {
511 //                              status.setError(PreferencesMessages.getString("CompilerConfigurationBlock.cpl13trg14.error")); //$NON-NLS-1$
512 //                              return status;
513 //                      }
514 //              }
515 //              if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
516 //                      if (!checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR)) {
517 //                              status.setError(PreferencesMessages.getString("CompilerConfigurationBlock.src14asrterr.error")); //$NON-NLS-1$
518 //                              return status;
519 //                      }
520 //              }
521 //              if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) {
522 //                      if (!checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) {
523 //                              status.setError(PreferencesMessages.getString("CompilerConfigurationBlock.src14tgt14.error")); //$NON-NLS-1$
524 //                              return status;
525 //                      }
526 //              }
527 //              return status;
528 //      }
529         
530         private IStatus validateMaxNumberProblems() {
531                 String number= (String) fWorkingValues.get(PREF_PB_MAX_PER_UNIT);
532                 StatusInfo status= new StatusInfo();
533                 if (number.length() == 0) {
534                         status.setError(PreferencesMessages.getString("CompilerConfigurationBlock.empty_input")); //$NON-NLS-1$
535                 } else {
536                         try {
537                                 int value= Integer.parseInt(number);
538                                 if (value <= 0) {
539                                         status.setError(PreferencesMessages.getFormattedString("CompilerConfigurationBlock.invalid_input", number)); //$NON-NLS-1$
540                                 }
541                         } catch (NumberFormatException e) {
542                                 status.setError(PreferencesMessages.getFormattedString("CompilerConfigurationBlock.invalid_input", number)); //$NON-NLS-1$
543                         }
544                 }
545                 return status;
546         }
547         
548 //      private IStatus validateResourceFilters() {
549 //              String text= (String) fWorkingValues.get(PREF_RESOURCE_FILTER);
550 //              
551 //              IWorkspace workspace= ResourcesPlugin.getWorkspace();
552 //
553 //              String[] filters= getTokens(text, ","); //$NON-NLS-1$
554 //              for (int i= 0; i < filters.length; i++) {
555 //                      String fileName= filters[i].replace('*', 'x');
556 //                      int resourceType= IResource.FILE;
557 //                      int lastCharacter= fileName.length() - 1;
558 //                      if (lastCharacter >= 0 && fileName.charAt(lastCharacter) == '/') {
559 //                              fileName= fileName.substring(0, lastCharacter);
560 //                              resourceType= IResource.FOLDER;
561 //                      }
562 //                      IStatus status= workspace.validateName(fileName, resourceType);
563 //                      if (status.matches(IStatus.ERROR)) {
564 //                              String message= PreferencesMessages.getFormattedString("CompilerConfigurationBlock.filter.invalidsegment.error", status.getMessage()); //$NON-NLS-1$
565 //                              return new StatusInfo(IStatus.ERROR, message);
566 //                      }
567 //              }
568 //              return new StatusInfo();
569 //      }
570         
571         protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
572                 String title= PreferencesMessages.getString("CompilerConfigurationBlock.needsbuild.title"); //$NON-NLS-1$
573                 String message;
574                 if (workspaceSettings) {
575                         message= PreferencesMessages.getString("CompilerConfigurationBlock.needsfullbuild.message"); //$NON-NLS-1$
576                 } else {
577                         message= PreferencesMessages.getString("CompilerConfigurationBlock.needsprojectbuild.message"); //$NON-NLS-1$
578                 }
579                 return new String[] { title, message };
580         }       
581                         
582 }