Bug 40638 [Dialogs] TitleAreaDialog is not initialized in the usual way.
When the TitleAreaDialog is constructed, it isn't ready to handle all of its mutators. In this snippet, the create() line is required, because otherwise setMessage() will throw a NullPointer when it attempts to modify the messageLabel; but it shouldn't be (according to Eclipse conventions). TitleAreaDialog titleAreaDialog = new TitleAreaDialog(getShell()); titleAreaDialog.create(); titleAreaDialog.setTitle("Title: org.eclipse.jface.dialogs.TitleAreaDialog"); titleAreaDialog.setMessage("Message: org.eclipse.jface.dialogs.TitleAreaDialog"); titleAreaDialog.open();
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/TitleAreaDialog.java
* An error message overrides the current message until the error message is 
 * cleared. This method replaces the current message and does not affect the 
 * error message.
 * </p>
 *
 * @param newMessage the message, or <code>null</code> to clear
 *   the message
 * @param newType the message type
 * @since 2.0
 */
public void setMessage(String newMessage, int newType) {
	Image newImage = null;
	
	if (newMessage != null) {
		switch (newType) {
			case IMessageProvider.NONE :
				break;
			case IMessageProvider.INFORMATION :
				newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_INFO);
				break;
			case IMessageProvider.WARNING :
				newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING);
				break;
			case IMessageProvider.ERROR :
				newImage = JFaceResources.getImage(DLG_IMG_MESSAGE_ERROR);
				break;
		}
	}
	
	showMessage(newMessage, newImage);