Bug 148424 - VM Capabilities only available from Target
Summary: VM Capabilities only available from Target
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.3 M4   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 149139 148421 148674
Blocks:
  Show dependency tree
 
Reported: 2006-06-23 13:55 EDT by Kevin Barnes CLA
Modified: 2006-11-15 12:22 EST (History)
2 users (show)

See Also:


Attachments
patch (5.04 KB, patch)
2006-06-23 14:35 EDT, Kevin Barnes CLA
no flags Details | Diff
patch (17.00 KB, patch)
2006-06-23 15:07 EDT, Kevin Barnes CLA
no flags Details | Diff
patch (4.90 KB, patch)
2006-06-28 17:17 EDT, Kevin Barnes CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Barnes CLA 2006-06-23 13:55:42 EDT
When opening the properties page on a java launch, process, thread or stack frame you only get the standard process properties page. Would be nice to get the VM Capabilities page as well.
Should be possible using an enablement expression.
Comment 1 Kevin Barnes CLA 2006-06-23 14:35:55 EDT
Created attachment 45199 [details]
patch

By setting objectClass=IAdaptable in property page definition (plugin.xml), the properties menu item appears for all adaptable objects resulting in a no properties for . error message if you try to view the properties of a launch. The objectClass attribute should not be necessary and is deprecated according to the doc, but it can't be removed do to bug 148241.

Also the VM capabilities page should present a nice error message when the target is terminated. With this patch it just barfs out the standard "vm does not allow access" message which in this case is a lie. This error message is also presented to the user when they ask for the properties of the Process. I have not investigated why that happens yet.
Comment 2 Kevin Barnes CLA 2006-06-23 15:07:24 EDT
Created attachment 45202 [details]
patch

fixes the error message for terminated VMs. Displays the vm capabilities when the process is selected.

Need to resolve the objectClass issue still. This patch contributes the property page to all adaptable objects in any view in the workbench. If there are no property pages for that view the user will get an ugly error message when they select the Properties... menu item. The menu item is enabled because the selection applies (IAdaptable is selected) but there are no property pages because the enablement expression says that the vm capabilities page doesn't apply. (ie objectClass and enablesWhen don't play well together)
Comment 3 Michael Rennie CLA 2006-06-26 14:17:28 EDT
fixed in HEAD with changes to allow the page to be shown for all elements with a JDIDebugTarget, as well as the process for the launch.

The solution for now is to have two property pages declared in the plugin.xml: one for IDebugTarget and the other for IProcess. Then once the objectClass issue is resolved we can remove one of the declaraitons and simply use the enabledWhen property tester to determine visibility of the properties page.

Also made changes to when the page will show: if the target is disconnected or terminated the property page is not available, in favour of showing the page with an error message.
Comment 4 Kevin Barnes CLA 2006-06-28 17:17:03 EDT
Created attachment 45507 [details]
patch

Still a problem with launch. The menu thinks that a property page is available when there isn't. This causes an ugly error dialog.
Comment 5 Kevin Barnes CLA 2006-06-28 17:35:27 EDT
Tod, we're trying to create a property page that is enabled solely by an expression, ie: if we can get a Java Debug Target adapter from the current selection we want to show the VM capabilities for that target.

When the selection in the debug view is the launch, we cannot get a target and no other property pages are contributed to launches. As a result the Properties... menu item is enabled, but selecting opens an error dialog.

Is there a way to avoid this? It seems that the action should just be disabled if there are no property pages.
Comment 6 Tod Creasey CLA 2006-06-29 07:54:20 EDT
Not yet - but that is a seperate issue that is worth looking at. If you log me another bug I'll have a look at it for you. 

If you wanted to play around yourself have a look at PropertyDialogAction and see what you think needs to be done.
Comment 7 Michael Rennie CLA 2006-07-17 12:13:41 EDT
The problem is in PropertyDialogAction#isApplicableForSelection, which further calls hasPropertyPagesFor, which will return true if the property page manager has contributed pages for the specified type in the plugin declaration. This does not work if we choose to determine the availability of the page using an enabledWhen expression: the manager will say it has a page for that contribution, but we are explicitly saying not to provide it based on our enabledWhen expression.

One of the two aforementioned methods needs to also consider enabledWhen expressions to determine if the object contribution is valid.
Comment 8 Michael Rennie CLA 2006-11-15 10:42:41 EST
fixed in HEAD

see LaunchView

also updated read only labels in the breakpoint property pages

see JavaBreakpointPage and JavaLineBreakpointChangePage
Comment 9 Michael Rennie CLA 2006-11-15 10:43:46 EST
please verify Curtis
Comment 10 Curtis Windatt CLA 2006-11-15 12:22:20 EST
Verified in Windows XP and Linux