Search code examples
eclipsee4

Eclipse e4 TitleAreaDialog not adopting upper left corner icon from e4xmi icon uri


I'm building an eclipse e4 application. When calling a TitleAreaDialog i have overwritten, the upper left corner icon is not displayed correctly. It's the default eclipse icon, like if I had not specified it in the application.e4xmi. But I did that and the application itself is adopting the icon.

Any suggestions?

Icon not displayed correctly

While I'm here, how can i set the default size of the application when starting? The bounds of the Trimmed Window in the e4xmi file don't change anything.

Thanks in advance!


Solution

  • Using Icon URI in the e4xmi has one major drawback: You can only set one icon size! On Windows this is a bit limited, because the window needs different icon sizes (i.e. for the upper left corner and for the task bar).

    I'm not sure, if icons of dialogs are automatically set on Windows or if they are derived from its parent window (did you set the parent window?). Maybe that is not the case, but setting a default icon for all JFace windows solves both issues.

    To do this you can call Window.setDefaultImages on org.eclipse.jface.window.Window.

    A good place to do this is on @PostContextCreate in your life cycle handler.