Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Saving the Project in the background without closing open dialogs
icon5.gif  Saving the Project in the background without closing open dialogs [message #754716] Fri, 04 November 2011 01:04
Kivanc Muslu is currently offline Kivanc MusluFriend
Messages: 153
Registered: November 2010
Senior Member
Hi,

In one of my plug-ins, I save all open files in the background, without getting confirmation from the user with the following command:
        Display.getDefault().syncExec(new Thread()
        {
            public void run()
            {
                PlatformUI.getWorkbench().saveAllEditors(false);
            }
        });

It works very well, however to do this, it closes all open dialogs to do this action. For example, let's say that the user invoked a content assist, while trying to decide what to choose from that dialog, my plug-in closes that dialog (since it saves the file). I guess this is due to the fact that I am trying to do the action with the UI thread, and to get a hold to the UI thread, it first closes its current dialog.

Is there a way to overcome this (i.e., delay the save until all active dialogs are closed or save the files in the workbench without forcing to close the active dialogs)?

Thanks,
Previous Topic:JSDAI install problem
Next Topic:Open file from command line in Mac not working
Goto Forum:
  


Current Time: Wed Dec 17 21:40:55 GMT 2014

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

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