Bug 386385 - Linux: open persistence.xml with double-click in Project Explorer - double-click no longer opens files
Summary: Linux: open persistence.xml with double-click in Project Explorer - double-cl...
Status: ASSIGNED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Brian Vosburgh CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-01 09:12 EDT by Jaroslav Jankovic CLA
Modified: 2012-08-08 13:50 EDT (History)
2 users (show)

See Also:


Attachments
Screencast of issue reproducing (1.22 MB, video/ogg)
2012-08-06 02:09 EDT, Jaroslav Jankovic CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Jankovic CLA 2012-08-01 09:12:06 EDT
EXEC: Create two jpa projects (persistence.xml must be included in both)
EXEC: Open persistence.xml of first project with double-click
ASSERT: persistence.xml is correctly opened in XML editor
EXEC: Open persistence.xml of second project with double-click
ASSERT: second persistence.xml file is correctly opened in XML editor as well
FAIL: second persistence.xml file is not opened


Workaround exists, actually there are two:

* open with context menu "Open"
* set focus on project explorer, then double click the persistence.xml file
Comment 1 Karen Butzke CLA 2012-08-01 09:42:51 EDT
I am unable to reproduce this problem in Juno. It works for me from the Package Explorer, Project Explorer, Navigator views.

What version of eclipse and dali are you using?

(In reply to comment #0)
> EXEC: Create two jpa projects (persistence.xml must be included in both)
What JPA platform did you choose, and is it the same for both projects?

> EXEC: Open persistence.xml of first project with double-click
Open the file from what view? (your workaround says it works from the project explorer)

> ASSERT: persistence.xml is correctly opened in XML editor
Does it work if you use the 'Persistence XML Editor' instead of the 'XML Editor'?

> EXEC: Open persistence.xml of second project with double-click
> ASSERT: second persistence.xml file is correctly opened in XML editor as well
> FAIL: second persistence.xml file is not opened
Is there an exception in the error log?
Maybe you could attach a screen shot after attempting to open the second file?
Comment 2 Jaroslav Jankovic CLA 2012-08-06 02:03:30 EDT
Hi Karen,

(In reply to comment #1)
> I am unable to reproduce this problem in Juno. It works for me from the
> Package Explorer, Project Explorer, Navigator views.
Issue is reproducible only in Project Explorer.
 
> What version of eclipse and dali are you using?
I am using Eclipse IDE for Java EE 3.7.2 with JBT 3.3.1 installed

> What JPA platform did you choose, and is it the same for both projects?
I chose Hibernate JPA platform and yes it is the same for both projects
 
> Open the file from what view? (your workaround says it works from the
> project explorer)
As I said in the beginning, issue is reproducible only with Project Explorer.
In workaround you have to set focus on Project Explorer (because focus is set to XML editor which opened persistence.xml of first project)
 
> Does it work if you use the 'Persistence XML Editor' instead of the 'XML
> Editor'?
I don't know what you mean, I am using double-click. When I right click to show context menu of persistence.xml, there is only two options: "Open" and "Synchronize Class List"

> Is there an exception in the error log?
> Maybe you could attach a screen shot after attempting to open the second
> file?
No, there is no exception in error log. Screenshot doesn't make any sense, because there would be nothing to see. I will rather create screencast.
Comment 3 Jaroslav Jankovic CLA 2012-08-06 02:09:32 EDT
Created attachment 219573 [details]
Screencast of issue reproducing
Comment 4 Brian Vosburgh CLA 2012-08-08 13:50:29 EDT
This problem seems to be limited to certain situations and to affect more than just opening other persistence.xml files. I have changed the bug summary appropriately.

The problem does not occur on Windows (which is why Karen could not reproduce it); but it does occur on Linux (and, according to other bug reports, possibly on Mac OS X). The problem seems to be related to how focus is handled by the tabs within the Dali persistence.xml editor. If the current tab within the editor has a Help button (to the right of the tabs title heading), this Help button appears to take the focus after the double-click and then misbehave. If the current tab does not have a Help button (e.g. the Source tab or, in JPA 2.0, the Options tab), double-clicking behaves as expected.

Also, the problem is not limited to opening other persistence.xml files. Double-clicking on the persistence.xml file (with a Help button tab on the top) prevents the user from opening *any* other file by directly double-clicking in the Project Explorer.

There seem to be a number of Eclipse Platform bugs related to the misbehavior of tool bars and their buttons (which is what this Help button is) on Linux and Mac OS X; so I'm guessing this is not a Dali-specific bug. From what I can tell, Dali appears to create and add the Help button to the tab's composite in the correct manner.

Another workaround is to "link" the Project Explorer with the editor. This seems to change the focus behavior enough to hide the problem.