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
labelY += data[0].getHeight();
	
	titleImageLargest = titleY > labelY;
}
	
/**
 * Set the layout values for the messageLabel, messageImageLabel and 
 * fillerLabel for the case where there is a normal message.
 * @param verticalSpacing int The spacing between widgets on the vertical axis.
 * @param horizontalSpacing int The spacing between widgets on the horizontal axis.
 */
private void setLayoutsForNormalMessage(
	int verticalSpacing,
	int horizontalSpacing) {
	FormData messageImageData = new FormData();
	messageImageData.top = new FormAttachment(titleLabel,verticalSpacing);
	messageImageData.left = new FormAttachment(0,H_GAP_IMAGE);
	messageImageLabel.setLayoutData(messageImageData);
	
	FormData messageLabelData = new FormData();
	messageLabelData.top = new FormAttachment(titleLabel,verticalSpacing);
	messageLabelData.right = new FormAttachment(titleImage);
	messageLabelData.left = new FormAttachment(messageImageLabel,horizontalSpacing);
	
	if(titleImageLargest)
		messageLabelData.bottom = new FormAttachment(titleImage,0,SWT.BOTTOM);
		
	messageLabel.setLayoutData(messageLabelData);
	
	FormData fillerData = new FormData();