1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

2005-04-11 Alain Magloire

Fix PR 91000: NPE in CEditorHoverConfigurationBlock
	* src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java
	* src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties
This commit is contained in:
Alain Magloire 2005-04-11 17:29:30 +00:00
parent 033cc2b06d
commit e4ecea9c92
3 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2005-04-11 Alain Magloire
Fix PR 91000: NPE in CEditorHoverConfigurationBlock
* src/org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfigurationBlock.java
* src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties
2005-04-11 Vladimir Hirsl 2005-04-11 Vladimir Hirsl
Fix for PR 90193: Scanner faililng on Local/User paths as provided in Std. Make Fix for PR 90193: Scanner faililng on Local/User paths as provided in Std. Make
User specified include paths (through the UI) are now created with User specified include paths (through the UI) are now created with

View file

@ -266,16 +266,18 @@ public class CEditorHoverConfigurationBlock {
if (id == null) if (id == null)
return; return;
CEditorTextHoverDescriptor[] descriptors= getContributedHovers(); CEditorTextHoverDescriptor[] descriptors= getContributedHovers();
HoverConfig hoverConfig = null;
int i= 0, length= fHoverConfigs.length; int i= 0, length= fHoverConfigs.length;
while (i < length) { while (i < length) {
if (id.equals(descriptors[i].getId())) { if (id.equals(descriptors[i].getId())) {
fHoverConfigs[i].fIsEnabled= event.getChecked(); hoverConfig = fHoverConfigs[i];
hoverConfig.fIsEnabled= event.getChecked();
fModifierEditor.setEnabled(event.getChecked()); fModifierEditor.setEnabled(event.getChecked());
break; break;
} }
i++; i++;
} }
updateStatus(); updateStatus(hoverConfig);
} }
}); });
@ -431,7 +433,7 @@ public class CEditorHoverConfigurationBlock {
fStatus= new StatusInfo(); fStatus= new StatusInfo();
restoreFromPreferences(); restoreFromPreferences();
initializeFields(); initializeFields();
updateStatus(); updateStatus(null);
} }
private void restoreFromPreferences() { private void restoreFromPreferences() {
@ -501,7 +503,7 @@ public class CEditorHoverConfigurationBlock {
// update table // update table
fHoverTableViewer.refresh(getContributedHovers()[i]); fHoverTableViewer.refresh(getContributedHovers()[i]);
updateStatus(); updateStatus(fHoverConfigs[i]);
} }
void handleHoverListSelection() { void handleHoverListSelection() {
@ -528,7 +530,12 @@ public class CEditorHoverConfigurationBlock {
return fStatus; return fStatus;
} }
void updateStatus() { void updateStatus(HoverConfig hoverConfig) {
if (hoverConfig != null && hoverConfig.fIsEnabled && hoverConfig.fStateMask == -1)
fStatus= new StatusInfo(IStatus.ERROR, PreferencesMessages.getFormattedString("CEditorHoverConfigurationBlock.modifierIsNotValid", hoverConfig.fModifierString)); //$NON-NLS-1$
else
fStatus= new StatusInfo();
int i= 0; int i= 0;
HashMap stateMasks= new HashMap(fHoverConfigs.length); HashMap stateMasks= new HashMap(fHoverConfigs.length);
while (fStatus.isOK() && i < fHoverConfigs.length) { while (fStatus.isOK() && i < fHoverConfigs.length) {

View file

@ -230,7 +230,7 @@ PathEntryVariableDialog.dialogTitle.existingVariable = Edit an Existing PathEntr
PathEntryVariableDialog.message.newVariable = Enter a new PathEntry variable name and its associated location. PathEntryVariableDialog.message.newVariable = Enter a new PathEntry variable name and its associated location.
PathEntryVariableDialog.message.existingVariable = Edit PathEntry variable's name and path value. PathEntryVariableDialog.message.existingVariable = Edit PathEntry variable's name and path value.
PathEntryVariableDialog.variableName = &Name: PathEntryVariableDialog.variableName = &Name:overConfigurationBlock
PathEntryVariableDialog.variableValue = &Location: PathEntryVariableDialog.variableValue = &Location:
PathEntryVariableDialog.variableNameEmptyMessage = You must provide a variable name. PathEntryVariableDialog.variableNameEmptyMessage = You must provide a variable name.
PathEntryVariableDialog.variableValueEmptyMessage = You must provide a file or folder path as variable value. PathEntryVariableDialog.variableValueEmptyMessage = You must provide a file or folder path as variable value.