|
Lines 11-16
Link Here
|
| 11 |
package org.eclipse.wst.jsdt.internal.ui.preferences; |
11 |
package org.eclipse.wst.jsdt.internal.ui.preferences; |
| 12 |
|
12 |
|
| 13 |
import org.eclipse.core.resources.IProject; |
13 |
import org.eclipse.core.resources.IProject; |
|
|
14 |
import org.eclipse.jface.dialogs.ControlEnableState; |
| 14 |
import org.eclipse.jface.dialogs.IDialogSettings; |
15 |
import org.eclipse.jface.dialogs.IDialogSettings; |
| 15 |
import org.eclipse.swt.SWT; |
16 |
import org.eclipse.swt.SWT; |
| 16 |
import org.eclipse.swt.layout.GridData; |
17 |
import org.eclipse.swt.layout.GridData; |
|
Lines 32-37
Link Here
|
| 32 |
|
33 |
|
| 33 |
private static final String SETTINGS_SECTION_NAME= "ProblemSeveritiesConfigurationBlock"; //$NON-NLS-1$ |
34 |
private static final String SETTINGS_SECTION_NAME= "ProblemSeveritiesConfigurationBlock"; //$NON-NLS-1$ |
| 34 |
|
35 |
|
|
|
36 |
private static final Key PREF_PB_ONLY_PARSE_ERRORS = getJDTCoreKey("onlySyntaxErrors"); //$NON-NLS-1$ |
| 37 |
|
| 35 |
// Preference store keys, see JavaScriptCore.getOptions |
38 |
// Preference store keys, see JavaScriptCore.getOptions |
| 36 |
private static final Key PREF_PB_UNDEFINED_FIELD= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNDEFINED_FIELD); |
39 |
private static final Key PREF_PB_UNDEFINED_FIELD= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNDEFINED_FIELD); |
| 37 |
// private static final Key PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= getJDTCoreKey(JavaScriptCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME); |
40 |
// private static final Key PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= getJDTCoreKey(JavaScriptCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME); |
|
Lines 117-122
Link Here
|
| 117 |
|
120 |
|
| 118 |
|
121 |
|
| 119 |
private PixelConverter fPixelConverter; |
122 |
private PixelConverter fPixelConverter; |
|
|
123 |
|
| 124 |
private ControlEnableState fBlockEnableState; |
| 125 |
private Composite fControlsComposite; |
| 120 |
|
126 |
|
| 121 |
public ProblemSeveritiesConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) { |
127 |
public ProblemSeveritiesConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) { |
| 122 |
super(context, project, getKeys(), container); |
128 |
super(context, project, getKeys(), container); |
|
Lines 129-134
Link Here
|
| 129 |
|
135 |
|
| 130 |
private static Key[] getKeys() { |
136 |
private static Key[] getKeys() { |
| 131 |
return new Key[] { |
137 |
return new Key[] { |
|
|
138 |
PREF_PB_ONLY_PARSE_ERRORS, |
| 132 |
PREF_PB_UNDEFINED_FIELD, |
139 |
PREF_PB_UNDEFINED_FIELD, |
| 133 |
/*PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME,*/ PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL, |
140 |
/*PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME,*/ PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL, |
| 134 |
PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, |
141 |
PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, |
|
Lines 167-176
Link Here
|
| 167 |
layout.marginWidth= 0; |
174 |
layout.marginWidth= 0; |
| 168 |
mainComp.setLayout(layout); |
175 |
mainComp.setLayout(layout); |
| 169 |
|
176 |
|
|
|
177 |
String label = PreferencesMessages.ProblemSeveritiesConfigurationBlock_onlySyntaxErrors; |
| 178 |
addCheckBox(mainComp, label, PREF_PB_ONLY_PARSE_ERRORS, new String[] {"true", "false"}, 0); //$NON-NLS-1$ //$NON-NLS-2$ |
| 179 |
|
| 170 |
Composite commonComposite= createStyleTabContent(mainComp); |
180 |
Composite commonComposite= createStyleTabContent(mainComp); |
| 171 |
GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true); |
181 |
GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true); |
| 172 |
gridData.heightHint= fPixelConverter.convertHeightInCharsToPixels(20); |
182 |
gridData.heightHint= fPixelConverter.convertHeightInCharsToPixels(20); |
| 173 |
commonComposite.setLayoutData(gridData); |
183 |
commonComposite.setLayoutData(gridData); |
|
|
184 |
|
| 185 |
fControlsComposite = commonComposite; |
| 174 |
|
186 |
|
| 175 |
validateSettings(null, null, null); |
187 |
validateSettings(null, null, null); |
| 176 |
|
188 |
|
|
Lines 489-495
Link Here
|
| 489 |
} |
501 |
} |
| 490 |
|
502 |
|
| 491 |
if (changedKey != null) { |
503 |
if (changedKey != null) { |
| 492 |
if (PREF_PB_UNUSED_PARAMETER.equals(changedKey) ) |
504 |
if (PREF_PB_UNUSED_PARAMETER.equals(changedKey) || PREF_PB_ONLY_PARSE_ERRORS.equals(changedKey) ) |
| 493 |
// PREF_PB_DEPRECATION.equals(changedKey) || |
505 |
// PREF_PB_DEPRECATION.equals(changedKey) || |
| 494 |
// PREF_PB_LOCAL_VARIABLE_HIDING.equals(changedKey) || |
506 |
// PREF_PB_LOCAL_VARIABLE_HIDING.equals(changedKey) || |
| 495 |
// PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey)) |
507 |
// PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey)) |
|
Lines 508-526
Link Here
|
| 508 |
} |
520 |
} |
| 509 |
|
521 |
|
| 510 |
private void updateEnableStates() { |
522 |
private void updateEnableStates() { |
| 511 |
boolean enableUnusedParams= !checkValue(PREF_PB_UNUSED_PARAMETER, IGNORE); |
523 |
boolean onlyParseErrors = checkValue(PREF_PB_ONLY_PARSE_ERRORS, "true"); //$NON-NLS-1$ |
| 512 |
// getCheckBox(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING).setEnabled(enableUnusedParams); |
524 |
enableConfigControls(!onlyParseErrors); |
| 513 |
getCheckBox(PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE).setEnabled(enableUnusedParams); |
|
|
| 514 |
|
| 515 |
boolean enableDeprecation= !checkValue(PREF_PB_DEPRECATION, IGNORE); |
| 516 |
getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation); |
| 517 |
getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation); |
| 518 |
|
525 |
|
| 519 |
// boolean enableThrownExceptions= !checkValue(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, IGNORE); |
526 |
if (!onlyParseErrors) { |
| 520 |
// getCheckBox(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING).setEnabled(enableThrownExceptions); |
527 |
boolean enableUnusedParams= !checkValue(PREF_PB_UNUSED_PARAMETER, IGNORE); |
| 521 |
|
528 |
// getCheckBox(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING).setEnabled(enableUnusedParams); |
| 522 |
// boolean enableHiding= !checkValue(PREF_PB_LOCAL_VARIABLE_HIDING, IGNORE); |
529 |
getCheckBox(PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE).setEnabled(enableUnusedParams); |
| 523 |
// getCheckBox(PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD).setEnabled(enableHiding); |
530 |
|
|
|
531 |
boolean enableDeprecation= !checkValue(PREF_PB_DEPRECATION, IGNORE); |
| 532 |
getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation); |
| 533 |
getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation); |
| 534 |
|
| 535 |
// boolean enableThrownExceptions= !checkValue(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, IGNORE); |
| 536 |
// getCheckBox(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING).setEnabled(enableThrownExceptions); |
| 537 |
|
| 538 |
// boolean enableHiding= !checkValue(PREF_PB_LOCAL_VARIABLE_HIDING, IGNORE); |
| 539 |
// getCheckBox(PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD).setEnabled(enableHiding); |
| 540 |
} |
| 541 |
} |
| 542 |
|
| 543 |
protected void enableConfigControls(boolean enable) { |
| 544 |
if (enable) { |
| 545 |
if (fBlockEnableState != null) { |
| 546 |
fBlockEnableState.restore(); |
| 547 |
fBlockEnableState= null; |
| 548 |
} |
| 549 |
} else { |
| 550 |
if (fBlockEnableState == null) { |
| 551 |
fBlockEnableState= ControlEnableState.disable(fControlsComposite); |
| 552 |
} |
| 553 |
} |
| 524 |
} |
554 |
} |
| 525 |
|
555 |
|
| 526 |
protected String[] getFullBuildDialogStrings(boolean workspaceSettings) { |
556 |
protected String[] getFullBuildDialogStrings(boolean workspaceSettings) { |