Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Open a JFace Dialog over another JFace Dialog
icon5.gif  Open a JFace Dialog over another JFace Dialog [message #1113654] Sat, 21 September 2013 13:19 Go to next message
Jayant Gupta is currently offline Jayant GuptaFriend
Messages: 10
Registered: March 2012
Junior Member
Hi,

I have a custom JFace Dialog (called PropertyDialog) which extends the FormDialog. I would like to open a modal message Dialog over the PropertryDialog as soon as it opens, to display a message to the user.

How could this be accomplished? Would I have to override the open() method? Note that it is required that the PropertyDialog.open() does not return until a button is pressed on the button bar.

Thanks for your help.

Regards,
Jayant
Re: Open a JFace Dialog over another JFace Dialog [message #1123078 is a reply to message #1113654] Wed, 02 October 2013 07:08 Go to previous message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 211
Registered: February 2012
Location: Düsseldorf
Senior Member
If you want to block the dialog I would not override the open method because you would have to open your dialog before calling super.open(). By that time the FormDialog shell has not yet been created and you need to show your MessageDialog over that shell. Instead you could simply add the follwing asyncExec to your implementation of createFormContent().

getShell().getDisplay().asyncExec(new Runnable() {
   @Override
   public void run() {
      MessageDialog.openInformation(getShell(), "Some Title", "Some info to the user");
   }
});


HTH
Thorsten
Previous Topic:Project Explorer Undo/Redo Operation
Next Topic:How to wrap the description on the first page of wizard
Goto Forum:
  


Current Time: Sat Dec 20 05:19:38 GMT 2014

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

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