Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329457

Summary: [compatibility] Editors do not get reused
Product: [Eclipse Project] e4 Reporter: Brian de Alwis <bsd>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: remy.suen
Version: unspecified   
Target Milestone: 4.1 RC3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Reuse editors patch v1 none

Description Brian de Alwis CLA 2010-11-04 12:45:44 EDT
BuildId: I20101029

I use the following settings for Preferences > General > Editors:

  * Close editors automatically: true
  * Number of opened editors before closing: 8
  * When all editors are dirty or pinned: open new editor

I've noticed that editors are never closed with > 8 editors when none are dirty.

Unable to check if this was still present in 1104 as I can't get a running image :(
Comment 1 Remy Suen CLA 2010-11-04 12:56:08 EDT
I suppose the question is how do we pick which one to close?
Comment 2 Brian de Alwis CLA 2010-11-08 09:43:09 EST
(In reply to comment #1)
> I suppose the question is how do we pick which one to close?

I thought this functionality would just pick up the implementation from the E3.x code.
Comment 3 Remy Suen CLA 2010-11-08 09:55:02 EST
(In reply to comment #2)
> I thought this functionality would just pick up the implementation from the
> E3.x code.

I suppose that would be the easiest way out.
Comment 4 Remy Suen CLA 2011-02-23 10:13:20 EST
junit.framework.AssertionFailedError: expected:<org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor@1a34181> but was:<org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor@1e7c4d4>
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.failNotEquals(Assert.java:283)
	at junit.framework.Assert.assertEquals(Assert.java:64)
	at junit.framework.Assert.assertEquals(Assert.java:71)
	at org.eclipse.jdt.text.tests.MarkOccurrenceTest.testMarkOccurrencesAfterEditorReuse(MarkOccurrenceTest.java:192)
Comment 5 Remy Suen CLA 2011-05-26 11:43:10 EDT
Created attachment 196675 [details]
Reuse editors patch v1

Add back code that queries whether editors should be reused. Based on the requested id and any available editors, we'll make the call as to whether we should reuse editors or open new ones.
Comment 6 Remy Suen CLA 2011-05-26 11:44:00 EDT
(In reply to comment #5)
> Created attachment 196675 [details]
> Reuse editors patch v1

Patch released to CVS HEAD.
Comment 7 Remy Suen CLA 2011-06-06 11:15:24 EDT
Verified with I20110604-2201 on Windows XP.