Bug 237604 - [Contributions] Enablement of context menu actions is only updated after re-selection
Summary: [Contributions] Enablement of context menu actions is only updated after re-s...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-18 06:08 EDT by Artun Subasi CLA
Modified: 2019-09-06 15:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artun Subasi CLA 2008-06-18 06:08:23 EDT
Overview: In a context menu, there is an action whose enablement state depends on an objectState. Using this action changes the object state in such a way, that the state of the action must change. However, the state of action is not updated until the user changes the selection and re-selects the same selection.

Steps to Reproduce:

1) Create a view with a viewer (table, tree etc).
2) Create a class 'TestClass' which implements IActionFilter. It should have a single state, for example: 'isActive' (false by default).
3) Put an object of type 'TestClass' in the viewer.
4) Create a org.eclipse.ui.popupMenus extension. Add a viewerContribution to the created view. Add an action with the following enablement:
   <enablement>
      <and>
         <objectClass
            name="TestClass">
          </objectClass>
          <objectState
            name="isActive"
            value="false">
          </objectState>
       </and>
    </enablement>
5) Implement the action which changes the state 'isActive' to true when it is used.

Actual Results: Run the program. Right click on the object and use the action. The isActive state will be changed to 'true'. Right click on the object again. The action will be still enabled even though the state of the object is changed.

The state of the action only updates if the selection is changed and then the object is re-selected.

Expected Results: Since the action enablement is based on the objectState, the state of the action should change if the object state changes.

Maybe the enablement status can also be updated after an action is used or when the context menu is opened?

Build Date & Platform: Version: 3.3.0 / Build id: I20070625-1500

Additional Builds and Platforms: Only tested in Windows XP SP2. Most probably not OS dependant.
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:33:17 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.