Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 264321 - [Edit] Undesired switch from compare editor to regular java editor
Summary: [Edit] Undesired switch from compare editor to regular java editor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 05:39 EST by Krzysztof Daniel CLA
Modified: 2009-02-26 03:55 EST (History)
1 user (show)

See Also:


Attachments
Patch v01 (3.03 KB, patch)
2009-02-23 11:16 EST, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (20.69 KB, application/octet-stream)
2009-02-23 11:16 EST, Tomasz Zarna CLA
no flags Details
Patch v02 (4.25 KB, patch)
2009-02-25 08:30 EST, Tomasz Zarna CLA
no flags Details | Diff
Patch v03 (1.93 KB, patch)
2009-02-25 09:46 EST, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Daniel CLA 2009-02-10 05:39:33 EST
1. make some changes in java file
2. compare with head
3. invoke quick fix (in my case it was add nonlns tag)
4. regular java editor is activated (or opened).
Comment 1 Tomasz Zarna CLA 2009-02-23 09:13:45 EST
(In reply to comment #0)
> 4. regular java editor is activated (or opened).

From what Dani has explained to me this is by design. When applying a quick fix in Compare Editor a regular Java editor will activated. However, when a Java editor is not open for a participant you're applying a quick fix in Compare Editor the focus will stay in the current editor part, ie Compare Editor.

Krzysztof, please let us know if you see the same thing and what are you feelings about it.
Comment 2 Dani Megert CLA 2009-02-23 09:18:18 EST
>> 4. regular java editor is activated (or opened).
>From what Dani has explained to me this is by design.
Nope. What should happen is that we (re-)use the compare editor as long as it is active (see Ctrl+O for example).
Comment 3 Tomasz Zarna CLA 2009-02-23 11:16:10 EST
Created attachment 126472 [details]
Patch v01

A fix proposition based on the work Dani did in EditorUtility for the ctrl+o issue[1]. Not sure if we need to check if the cu is primary in this case (commented out). Dani what do you think about the patch, is it a step in the right direction?

[1] bug 259408
Comment 4 Tomasz Zarna CLA 2009-02-23 11:16:14 EST
Created attachment 126473 [details]
mylyn/context/zip
Comment 5 Tomasz Zarna CLA 2009-02-23 11:19:33 EST
(In reply to comment #2)
> >> 4. regular java editor is activated (or opened).
> >From what Dani has explained to me this is by design.
> Nope. What should happen is that we (re-)use the compare editor as long as it is
> active (see Ctrl+O for example).

Sorry for twisting your words Dani, I must have misunderstood you.
Comment 6 Dani Megert CLA 2009-02-24 08:41:29 EST
>4. regular java editor is activated (or opened).
This step is not fully true: only if the Java (or any other) editor is already open it will activate it instead of staying in the compare editor.

>Dani what do you think about the patch, is it a step in the right direction?
The fix should go into EditorUtility.isOpenInEditor(Object).
Comment 7 Tomasz Zarna CLA 2009-02-25 08:30:08 EST
Created attachment 126711 [details]
Patch v02

Another approach here could be extending CompareEditor with its own editor matching strategy. This would work for JDT, but it would also bring the Compare Editor to top for other calls within Workbench. I'm afraid this might more than we actually need, ie this might be unexpected behavior change. Dani what do you think? Should I limit changes to JDT's EditorUtility only?
Comment 8 Dani Megert CLA 2009-02-25 08:52:45 EST
> Dani what do you think? Should I limit changes to JDT's EditorUtility only?
Yes, I think so.
Comment 9 Tomasz Zarna CLA 2009-02-25 09:46:24 EST
Created attachment 126723 [details]
Patch v03

How about this? Third time lucky?
Comment 10 Dani Megert CLA 2009-02-26 03:55:42 EST
The patch is good Tomasz. I renamed getEditor to findEditor and added Javadoc.

Fixed in HEAD.
Available in builds > N20090225-2000.