Bug 85005 - [WorkbenchParts] too many editors activated upon startup
Summary: [WorkbenchParts] too many editors activated upon startup
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Stefan Xenos CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 75558 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-11 10:44 EST by Tom Hofmann CLA
Modified: 2006-03-29 11:58 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hofmann CLA 2005-02-11 10:44:47 EST
I20050209

- have 2 editor areas in your workbench, left and right
- in the left area, open A.java and B.java (use multiple tabs)
- in the right area, open C.java

- make sure that in the left area, B.java (the second tab) is visible (i.e. at
the top of the editor stack)
- give focus to the right area (C.java)
- quit eclipse (ensure you don't close any editors when shutting down)

- restart eclipse - the editors are restored as they were when shutting down

Expected: only B.java (in the left editor area) and C.java (in the right area)
are real editors. A.java is showing as a tab, but the underlying editor is not
instantiated.

Actual: A.java is already activated. When quering the workbench page whether
A.java is visible, it returns false. When activating A.java, an IPartListener2
will receive a partActivated event for A.java, but not a partVisible event.


Note that this behavior is only reproducible if A.java is the first tab in an
editor area, but not the one that is visible. Other editors than the first one
in an editor stack are not instantiated until they are made visible.
Comment 1 John Arthorne CLA 2005-03-08 12:12:26 EST
Also reproducible on Windows, so changing hardware and OS accordingly. 
Reproducible in 3.1 M4 and M5.
Comment 2 Nick Edgar CLA 2005-03-08 12:32:14 EST
Marking for consideration for 3.1.
Comment 3 John Arthorne CLA 2005-03-29 10:22:38 EST
I have seen cases in my performance.log where at least three Java editors were
created on startup (I20050315).  This suggests there is a deeper problem than
the currently reproducible case of the first editor in the list always being
restored.

Note: bug 83316 looks like a duplicate.
Comment 4 Nick Edgar CLA 2005-03-29 12:05:21 EST
The first editor in a workbook is always restored, even if it is not the active one.
This is due to the requirement that presentations always have a selected part if
they have any parts.  It selects the first editor when it is added.  It should
defer this until the selection is restored.
Comment 5 Nick Edgar CLA 2005-03-29 12:09:30 EST
I just checked: opened A, B, C, with C active, shutdown/restart, and A and C get
eagerly restored.  A should not, but that is due to the problem described in the
previous comment.

John, silly question, but are you using multiple windows?
If you see any further patterns that might help us explain how multiple editors
are getting eagerl restored, please log them here.
Comment 6 Nick Edgar CLA 2005-03-29 12:11:14 EST
I've filed bug 89374 for the partVisible event notification problem.
Comment 7 John Arthorne CLA 2005-03-29 12:29:06 EST
I never use multiple windows, or split my editor pane.  I do typically have two
or three perspectives open.  All I have now is the evidence from my performance
log - I'll try to find a reproducible case where more than two editors are being
opened.
Comment 8 Nick Edgar CLA 2005-04-05 10:23:24 EDT
*** Bug 75558 has been marked as a duplicate of this bug. ***
Comment 9 Stefan Xenos CLA 2005-04-12 17:05:17 EDT
Here's an even better scenario:

Create two editor stacks.
until (lots of editors open) {
   Click on the left stack
   Open an editor by double-clicking a file
   Click on the right stack
   Open an editor by double-clicking a file
   repeat...
}
Restart the workbench

This will activate every editor in the workspace.

BTW, I've got a fix for this ready but it's a big patch and I'm still testing it.

Comment 10 Stefan Xenos CLA 2005-04-16 02:08:19 EDT
There is a fix for this in bug 89246
Comment 11 Stefan Xenos CLA 2005-04-18 19:08:11 EDT
Fixed in HEAD
Comment 12 Stefan Xenos CLA 2005-05-10 23:52:54 EDT
Verified in I20050510-0010