Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Dialog missing title image
Dialog missing title image [message #719043] Thu, 25 August 2011 21:43
Josh Davis is currently offline Josh DavisFriend
Messages: 20
Registered: August 2011
Junior Member
I created a dialog that extends org.eclipse.jface.dialogs.MessageDialog

I am unable to display the title image, without adding SWT.CLOSE to the style.

Here is some sample code...

public class TestDialog extends MessageDialog {

public static boolean open(final Shell shell, final String title, final Image image) {
final String[] dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
final TestDialog = new TestDialog(shell, title, image, "close?", MessageDialog.QUESTION, dialogButtonLabels, 1);
return dialog.open() == 0;
}

private class TestDialog(final Shell parentShell, final String dialogTitle, final Image dialogTitleImage,
final String dialogMessage, final int dialogImageType, final String[] dialogButtonLabels,
final int defaultIndex) {
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels,
defaultIndex);
setShellStyle(SWT.TITLE | SWT.APPLICATION_MODAL | SWT.BORDER);
}
}

If I add SWT.CLOSE to the setShellStyle my title image will appear.
Any idea as to why I need to add SWT.CLOSE to get the icon to show up?
I am using org.eclipse.jface_3.6.0.I20100601-0800.jar
I am running Windows 7

Thanks,
Josh
Previous Topic:Set handler to parameterized comman
Next Topic:GridLayout Problems in Forms
Goto Forum:
  


Current Time: Tue Apr 23 14:50:10 GMT 2024

Powered by FUDForum. Page generated in 0.02994 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top