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

Bug 365474

Summary: 'Show In' menu for java/JPA perspective for java and xml files should have JPA views
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Nan Li <nan.n.li>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: jolene.moffitt, neil.hauge
Version: 3.1Flags: karenfbutzke: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
proposed patch karenfbutzke: iplog+, karenfbutzke: review+

Description Karen Butzke CLA 2011-12-02 14:40:14 EST
The 'Show In' right-click menu on a java file or XML file should have the JPA Details and JPA Structure views. I think this might be perspective based and not file extension based, but not sure.
Comment 1 Nan Li CLA 2012-09-07 17:29:17 EDT
Created attachment 220856 [details]
proposed patch

1. Added JpaDetailsView and JpaStructureView to 'Show In' context menu of JPA perspective and Java perspective

2. The editor and the selected view will be opened for Java types and files and selection will be set in the view if the selected Java type is a persistent type or the selected file is a mapping file or persistence.xml. 

3. The selected view will be also opened for other types of selected items such as jar files and folders, but no selection will be set in the view and no editor will be opened for them.

This patch is based on the following commit:

2895790 removed now unnecessary validation methods Karen Butzke
Comment 2 Nan Li CLA 2012-09-07 17:38:34 EDT
Clarify:

1. Selection will be set in the editor, not the view, but the view will have content based on the selection.

2. No editor is able to be opened for other types of selected items such as jar files and folders, which means no selection is able to be set, so the view will be blank.
Comment 3 Karen Butzke CLA 2012-09-14 07:36:13 EDT
Now that I see the functionality, I'm not so sure we should be doing this. Maybe we should do a viewShortcut instead, at least in the Java perspective. This will make our views appear in the Window->Show View menu and seems like a more all inclusive list. We could also add them to the J2EE, Java Browsing, Java Type Hierarchy perspectives in this location.

I definitely think we should have the Show In->JPA Details/Structure option if the user is already in the JPA perspective. In the Java perspective I am concerned about adding it there because that will add it for everybody that uses the JEE package and does not use JPA. It certainly gives us visibility, but maybe too much! And you can't even do anything in our views if you don't already have a JPA facet.
Comment 4 Nan Li CLA 2012-09-14 12:27:37 EDT
Created attachment 221097 [details]
proposed patch

This patch removed JPA views from "Show In" context menu of Java perspective and is based on the following commit:

0199502 Updated docs Rick Sapir
Comment 5 Karen Butzke CLA 2012-09-17 08:37:14 EDT
We decided only to put these views in the Show In menu in the JPA perspective. Otherwise anyone with the JPA plugins (JEE package) who is not using JPA would see those options.

committed Nan's patch to master:
http://git.eclipse.org/c/dali/webtools.dali.git/commit/?id=a19a9b1d97989c7121ec46f421b2501b3439d650
Comment 6 Jolene Moffitt CLA 2012-11-02 15:48:06 EDT
Attempted to verify this bug in Build I-3.5.0-20121030031244  The ‘Show-In’ r-click menu (JPA Details, JPA Structure), works fine for the java file or XML file.   It is also available when you r-click on other files (such as .jar files, folders, etc.) it doesn’t do anything if you click on it but it appears.  JPA Details and JPA Structure should only be available for .java or .xml files.
Comment 7 Nan Li CLA 2012-11-03 19:12:52 EDT
The Show In context menu is perspective based which means you will see the menu no matter where you perform the right-click operation within the perspective, JPA perspective in this case. 

Karen, what do you think?
Comment 8 Karen Butzke CLA 2012-12-21 16:22:54 EST
(In reply to comment #7)
> The Show In context menu is perspective based which means you will see the
> menu no matter where you perform the right-click operation within the
> perspective, JPA perspective in this case. 
> 
> Karen, what do you think?

After some discussion with Neil and Paul, I have decided just to yank this functionality and close out this bug as WONTFIX. When I originally opened this bug I thought it might be simpler to make this menu item only appear in specific circumstances. I was also trying to give more visibility to our views, but this is not achieved by only putting this functionality in the JPA perspective. It doesn't seem worth the extra investigation to try to find a way to make this only appear on .java or .xml files in a JPA project.

I have reverted the commit for this bug.