Bug 1577 - Use new workbench API for editor re-use
Summary: Use new workbench API for editor re-use
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Eduardo Pereira CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 2676 (view as bug list)
Depends on:
Blocks: 7969
  Show dependency tree
 
Reported: 2001-10-10 22:15 EDT by Darin Wright CLA
Modified: 2002-02-04 16:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2001-10-10 22:15:40 EDT
DW (5/18/01 8:58:12 AM)
	Can we re-use editors? And just re-set the input? Can we look at editor IDs?

DW (5/18/01 1:37:06 PM)
	EditorPart.setInput(IEditorInput) is not part of the API - just the implementation.

DW (6/19/01 9:37:28 AM)
	Requires API request/change from workbench.

DS (8/3/2001 3:39:38 PM)
	@see 1GHWE4M: ITPUI:ALL - Reuse of editors: changing the input
Comment 1 Darin Wright CLA 2001-12-14 12:10:01 EST
The debugger had its own editor re-use algorithm in 1.0. In 2.0, we will simply 
use the workbench's editor re-use policy. No special algorithm.
Comment 2 Darin Wright CLA 2001-12-18 17:24:02 EST
Fixed. Re-assigning for verification.
Comment 3 Darin Wright CLA 2001-12-18 17:24:15 EST
Please verify
Comment 4 Joe Szurszewski CLA 2002-01-21 16:02:37 EST
I can't seem to get any editor reuse in the Debug Perspective.  
Comment 5 Darin Wright CLA 2002-01-21 16:06:46 EST
Editors are shared between perspectives, and the max number of open editors is 
as defined by the workbench preference.
Comment 6 Joe Szurszewski CLA 2002-01-21 16:34:01 EST
Test case:

Set # of shared editors in workbench prefs to 1.
Create two classes as 
follows:

public class Main {

	public static void main(String[] args) {
		Main main = 
new Main();
		main.run();
	}
	
	public void run() {
		int i = 0;    // Set breakpoint 
here
		while (true) {
			Message message = new 
Message(i);
			message.print();
			i++;
		}
	}
}


and


public class 
Message {
	private int value;
	
	public Message(int value) {
		this.value = 
value;
	}
	
	public void print() {
		System.out.println("value = " + 
value);
	}
}


Set a breakpoint where indicated in Main.
Close all editors in debug 
persp.
Debug.
When breakpoint is hit, Main pops up in an editor.
Step into 
Message.print().
Run To Return.
If the toolbar action for Run to Return was clicked, 
everything is fine.  However, if the F7 key was used, when control returns to Main, a second editor 
is opened on Main.  This is repeatable.
Comment 7 Darin Wright CLA 2002-01-21 17:10:35 EST
Re-assigning to Platform UI, as the code the debugger uses to open editors is 
the same irrespective of key press or tool click.
Comment 8 Kevin Haaland CLA 2002-01-21 19:03:22 EST
This should be resolved in this release. 
Comment 9 Nick Edgar CLA 2002-01-31 21:23:50 EST
Pls investigate.
Comment 10 Eduardo Pereira CLA 2002-02-04 13:06:23 EST
The current implementation would not re-use the active editor.
Changed and released.
Comment 11 Eduardo Pereira CLA 2002-02-04 13:37:57 EST
*** Bug 2676 has been marked as a duplicate of this bug. ***
Comment 12 Eduardo Pereira CLA 2002-02-04 16:16:04 EST
Changed to reuse active editors as well.

PS: I have "moved" the API set/getEditorReuseThreshold from IWorkbenchPage to 
IPageLayout. The debugger could overwrite the threshold to "1".