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

Bug 348230

Summary: [Commands] Command expressions are not evaluated when a view is minimized/maximized
Product: [Eclipse Project] Platform Reporter: Vasanth Velusamy <vasanthv16>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Vasanth Velusamy CLA 2011-06-03 11:21:21 EDT
Build Identifier: 20110218-0911

There is a variable named 'activeEditor' used in the command framework evaluation. This variable value is modified, among other times, when a view is maximized or minimized. But, if I use the variable in an expression, the expression is not reevaluated when a view is maximized or minimized. This leads to action handlers being enabled/disabled incorrectly.

Reproducible: Always

Steps to Reproduce:
1. Create a command (org.eclipse.ui.commands extension point) for use in a view.
2. Create a handler for the command like:
      <handler commandId="xyz" class="abc">
         <enabledWhen>
            <and>
               <with variable="selection">
                  <count value="?"/>
               </with>
               <with variable="activeEditor">
                  <not><equals value="null"/></not>
               </with>
            </and>
         </enabledWhen>
      </handler>
3. Open some editor in eclipse.
Note that when there is zero or one selection and if there is an editor open, the view menu for that command is enabled with the above handler.
4. Maximize the view which has the menu in question.
This will make the editor get minimized. Note that the menu is still enabled. But at this point, the variable 'activeEditor' gets changed, but the handler expression is not reevaluated.
5. Now switch to a different view and back to the old view.
Note that the menu item is disabled. This is because selection changes and the handler expression gets reevaluated.

I would have expected the expression to be reevaluated in step 4, when I maximized the view.

6. I tried created a custom property tester, but I got similar results. My property tester was not evaluated at step 4.
Comment 1 Lars Vogel CLA 2019-11-14 03:43:53 EST
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.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.