I am opening an editor from a view on click of a treenode. Now, when editor loads and controls are displayed to the user, I want to display a warning message dialog to the user based on certain values present on the editor.
I tried by putting the warning dialog at the end of createPartControl method of the editor. Dialog appears on double cliking the treenode as per the required functionality. But, the problem is that when the dialog appears, the controls on the editor are not yet visible. It’s only when I close the dialog the editor controls are shown.
I want it to happen the other way around. i.e. The editor controls to show up first and then the warning dialog should appear. What changes should I do to achieve this effect?
You may want to call that MessageDialog in an asynchronous way, to leave the Editor the opportunity to complete itself, as suggested in this message.
So, something like (not tested) this code might do the trick:
Some other examples in this MapEditor class, where a MessageDialog is displayed through an asyncExec which waits for the result:
PlatformGIS.syncInDisplayThread