Bug 66292 [Dialogs] InputDialog NPE when invoking setErrorMessage(...) too early
06081200 build Setting the error message this early is probably not anticipated, but it shouldn't throw an exception... public class Main { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); InputDialog dialog = new InputDialog (shell, "TEST", "value", "test", null); dialog.setErrorMessage("error"); dialog.open(); shell.open(); } }
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/InputDialog.java
validateInput();
            }
        });
        errorMessageText = new Text(composite, SWT.READ_ONLY);
        errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
                | GridData.HORIZONTAL_ALIGN_FILL));
        errorMessageText.setBackground(errorMessageText.getDisplay()
                .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
        applyDialogFont(composite);
        return composite;
    }
    /**
     * Returns the error message label.
     * 
     * @return the error message label
     * @deprecated use setErrorMessage(String) instead
     */
    protected Label getErrorMessageLabel() {
        return null;
    }
    /**
     * Returns the ok button.
     * 
     * @return the ok button
     */
    protected Button getOkButton() {
        return okButton;
    }
    /**
     * Returns the text area.