Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 60462
Collapse All | Expand All

(-)ComboBoxCellEditor.java (-3 / +14 lines)
Lines 244-254 Link Here
244
        markDirty();
244
        markDirty();
245
        boolean isValid = isCorrect(newValue);
245
        boolean isValid = isCorrect(newValue);
246
        setValueValid(isValid);
246
        setValueValid(isValid);
247
        
247
        if (!isValid) {
248
        if (!isValid) {
248
            // try to insert the current value into the error message.
249
        	// Fix for 60462...only format if the 'index' is valid
249
            setErrorMessage(MessageFormat.format(getErrorMessage(),
250
        	if (items.length > 0 && selection >= 0 && selection < items.length) {
250
                    new Object[] { items[selection] }));
251
	            // try to insert the current value into the error message.
252
	            setErrorMessage(MessageFormat.format(getErrorMessage(),
253
	                    new Object[] { items[selection] }));
254
        	}
255
        	else {
256
	            // Since we don't have a valid index, assume we're using an 'edit'
257
        		// combo so format using its text value
258
	            setErrorMessage(MessageFormat.format(getErrorMessage(),
259
	                    new Object[] { comboBox.getText() }));
260
        	}
251
        }
261
        }
262
252
        fireApplyEditorValue();
263
        fireApplyEditorValue();
253
        deactivate();
264
        deactivate();
254
    }
265
    }

Return to bug 60462