Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Trouble with Jobs after multiple calls to PlatformUI.createAndRunWorkbench
Trouble with Jobs after multiple calls to PlatformUI.createAndRunWorkbench [message #330625] Tue, 05 August 2008 23:37 Go to next message
Gary is currently offline GaryFriend
Messages: 6
Registered: July 2009
Junior Member
My application uses a TrayIcon which is wrapped around the call to
PlatformUI.createAndRunWorkbench(). When the user choose to Exit the
application (from File->Exit, which is the IWorkbenchAction from the
ActionFactory), I call Display.readAndDispatch() until the MenuItems for
Open or Exit on the TrayIcon are pressed. If Open is pressed then i
call PlatformUI.createAndRunWorkbench() again.

One key point is that I create a new Display from PlatformUI and use a
new WorkbenchAdvisor each time PlatformUI.createAndRunWorkbench(),
otherwise more issues arise.

The only problem i am experiencing is with my Jobs on subsequent
createAndRunWorkbench() calls .. while they do execute correctly, they
do not appear in the ProgressView, nor do they display progress
information in a dialog.

Does anyone have insight onto calling PlatformUI.createAndRunWorkbench()
multiple times? Or a better way to hide the workbench with the ability
to retrieve it from a Tray Icon?

I have noted that the ProgressManager object is the same through both
launches of the Workbench.


Gary
Re: Trouble with Jobs after multiple calls to PlatformUI.createAndRunWorkbench [message #330793 is a reply to message #330625] Wed, 13 August 2008 14:07 Go to previous message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

When you want to implement a tray icon, that shows up, if the user
closes the window you can override the preWindowShellClose() in your
WorkbenchWindowAdvisor:

@Override
public boolean preWindowShellClose() {
final boolean[] res = new boolean[] { true };
this.fMinimizeFromClose = true;
getWindowConfigurer().getWindow().getShell().notifyListeners (SWT.Iconify,
new Event());
res[0] = false;
this.fMinimizeFromClose = false;
return res[0];
}

Tom

Gary Louttit schrieb:
> My application uses a TrayIcon which is wrapped around the call to
> PlatformUI.createAndRunWorkbench(). When the user choose to Exit the
> application (from File->Exit, which is the IWorkbenchAction from the
> ActionFactory), I call Display.readAndDispatch() until the MenuItems for
> Open or Exit on the TrayIcon are pressed. If Open is pressed then i
> call PlatformUI.createAndRunWorkbench() again.
>
> One key point is that I create a new Display from PlatformUI and use a
> new WorkbenchAdvisor each time PlatformUI.createAndRunWorkbench(),
> otherwise more issues arise.
>
> The only problem i am experiencing is with my Jobs on subsequent
> createAndRunWorkbench() calls .. while they do execute correctly, they
> do not appear in the ProgressView, nor do they display progress
> information in a dialog.
>
> Does anyone have insight onto calling PlatformUI.createAndRunWorkbench()
> multiple times? Or a better way to hide the workbench with the ability
> to retrieve it from a Tray Icon?
>
> I have noted that the ProgressManager object is the same through both
> launches of the Workbench.
>
>
> Gary
>
Previous Topic:Best way of removing data from a virtual TableViewer
Next Topic:Open files from shell
Goto Forum:
  


Current Time: Tue Nov 05 14:24:48 GMT 2024

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

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

Back to the top