Bug 10065 - [ActionSets] Better enableFor support required
Summary: [ActionSets] Better enableFor support required
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2002-02-21 11:39 EST by Anshu Prasad CLA
Modified: 2002-10-16 13:06 EDT (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 Anshu Prasad CLA 2002-02-21 11:39:27 EST
Sample problem scenario:

User starts Eclipse. 
Eclipse opens. Our product's action set is shown. Nothing is selected, so the 
action set is disabled. The "connect to our product" button is enabled.
User selects "connect to our product".
A progress dialog is shown. Resources in the navigator are updated with our 
product's status icon overlays.
User selects a resource in a particular state.
All icons are enabled, although their enabled state should depend on the state 
of the selected resource.
User selects an option to change the state to the state its already in.
A completely unacceptable "This action is not available." dialog is shown, and 
the item is finally disabled. The resource was already in the desired state - 
the item should already have been disabled.

Our plugin cannot enable its items based on the selection, because the action 
set delegates are not instantiated until after the item is clicked.

We need:
better enabling rules in .xml, or
a way to instantiate the action set delegates once a plugin loads, or
some way to run a piece of code on selection changes.
Comment 1 Anshu Prasad CLA 2002-03-04 13:39:35 EST
There is the following issue:

Menu item on Perspective A is enabled.
User switches to Perspective B, which does not contain the menu.
User switches back to Perspective A, and the menu item is now grayed out.

The menu item should have remained enabled when the user switched back to 
Perspective A.
Comment 2 Kevin Haaland CLA 2002-03-07 20:53:04 EST
It is going to be difficult to make progress on this defect report without a 
test cases and steps that we can try here. 

I will attempt to address as many issues as I can with the information 
currently in this defect report. 

Problem 1: "Nothing is selected so the action set is disabled"

What enablement rules are you using. Other action sets do not have this
limitation. (e.g. Search). 


Problem 2: Instantiating action delegates

   Is this the "all icons are enabled, although their enabled state should
depend on the state of the selected resource" issue?

   In the current 2.0 builds action delegates are instantiated after the plugin 
is loaded. See org.eclipse.ui.internal.PluginAction.selectionChanged
(ISelection) and isOkToCreateDelegate()

Problem 3: "user selected a state to chagnge teh state to the state its already 
in ...."

   There isn't enough information in this defect report to work with. Please 
provide code and the steps to recreate. 

Problem 4: "better enabled rules in xml"

   There has been some progress in this area in the 2.0 stream. It is still 
very limited in the ability to express complex enablement rules if you have 
suggestions for improving the support I would love to hear them.


Problem 5: "There is the following issue ..."

   Please provide code and steps to recreate. There isn't enough information in 
this defect report to diagnose the problem you have found in Eclipse. In other 
cases plugins are able to enable their menus when the perspective changes. For 
example open the Resource and Debug Perspective and switch between them. Notice 
that the "Debug" menu and it's menu items are enabled and disabled correctly. 
Comment 3 Kevin Haaland CLA 2002-03-19 14:59:24 EST
Waiting for feedback from reporter.
Comment 4 Nick Edgar CLA 2002-05-13 22:27:16 EDT
No response.  Closing PR.
Comment 5 Nick Edgar CLA 2002-05-28 10:00:47 EDT
Reopening on customer request for consideration post 2.0.
Comment 6 Nick Edgar CLA 2002-05-28 10:01:47 EDT
Defering to post 2.0.
Comment 7 Nick Edgar CLA 2002-05-28 10:02:37 EDT
Reminder: Anshu sent email containing an example demonstrating the problem.
Comment 8 Randy Giffen CLA 2002-08-09 12:50:53 EDT
Reopen to investigate
Comment 9 Simon Arsenault CLA 2002-09-03 14:31:08 EDT
Anshu, can you attach the code to reproduce the problem (switch persp, and 
actions grayed out) to this bug report. Please make sure it is still 
reproducable in 2.0.1 release.

As for the enablement issues on object states, were these resolved? Assuming so 
unless someone else states otherwise.

Downgrading priority until further information
Comment 10 Nick Edgar CLA 2002-10-16 13:06:16 EDT
Closing PR, assuming that the support in 2.0 / 2.0.1 is good enough.
Please reopen with additional info if you are not satisfied with the current 
support.