Bug 2536 - Window lifecycle needed (1GFL2TW)
Summary: Window lifecycle needed (1GFL2TW)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 enhancement (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Eduardo Pereira CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2001-10-10 22:38 EDT by Nick Edgar CLA
Modified: 2002-04-10 15:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.