Bug 2536

Summary: Window lifecycle needed (1GFL2TW)
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: UIAssignee: Eduardo Pereira <eduardo_pereira>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Darin_Swanson
Version: 2.0Keywords: api
Target Milestone: 2.0 M5   
Hardware: All   
OS: Windows 2000   
Whiteboard:

Description Nick Edgar CLA 2001-10-10 22:38:19 EDT
From Eclipse Corner (6/13/2001):

It seems some obvious functionality is missing from IWorkbench. We need to
know when a new workbench window is opened or an existing one closed. For
example:

IWorkbench.addWorkbenchListener(IWorkbenchListener)

IWorkbenchListener would contain, among other methods,
windowOpened(IWorkbenchWindow)
windowClosed(IWorkbenchWindow)
etc...


I've found a workaround. However, this is very ugly and it would be great if
someone could give an estimate when real listener support could be added to
IWorkbench. I'm adding a ShellListener to the current WorkbenchWindow's
shell. When I get a shellDeactivated, I check to see what the
activeWorkBenchWindow is. If its not the original window, I know I've got a
new one. I've discovered I must do the check in an asyncExec, because at the
time shellDeactivated is called, the original workbench window is still the
active one.

NOTES:
Comment 1 DJ Houghton CLA 2001-10-29 18:58:33 EST
PRODUCT VERSION:
125

Comment 2 Nick Edgar CLA 2002-01-26 21:35:52 EST
Should add for 2.0.
There was also a recent newsgroup request for this.
Comment 3 Eduardo Pereira CLA 2002-04-09 09:54:54 EDT
Fixed and released.
IWindowListener has the following methods:

public void windowActivated(IWorkbenchWindow window);
public void windowDeactivated(IWorkbenchWindow window);
public void windowClosed(IWorkbenchWindow window);
public void windowOpened(IWorkbenchWindow window);
Comment 4 Eduardo Pereira CLA 2002-04-10 15:11:42 EDT
Released.