| 
| Trouble with Jobs after multiple calls to PlatformUI.createAndRunWorkbench [message #330625] | Tue, 05 August 2008 19:37  |  | 
| Eclipse User  |  |  |  |  | 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 10:07  |  | 
| Eclipse User  |  |  |  |  | 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
 >
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03683 seconds