Bug 209867

Summary: [TabbedProperties] Add wildcards to the enablesFor attribute of propertySection
Product: [Eclipse Project] Platform Reporter: Simon Ringuette <simon.ringuette>
Component: UIAssignee: Anthony Hunter <ahunter.eclipse>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Diff file for the enhancement
none
This is a demo project using the enhencement none

Description Simon Ringuette CLA 2007-11-14 16:46:14 EST
Created attachment 82915 [details]
Diff file for the enhancement

The enablesFor attribute of the propertySection attribute of the propertySections.exsd should follow the same standard as the enablesFor found in the schema actionSets of the org.eclipse.ui plugin.

This means that enablesFor could have the values:

enablesFor - a value indicating the selection count which must be met to enable the property section If specified and the condition is not met, the property section is disabled. If omitted, the property section enablement state is not affected. The following attribute formats are supported:

 ! - 0 items selected 
 ? - 0 or 1 items selected 
 + - 1 or more items selected 
 multiple, 2+ - 2 or more items selected 
 n - a precise number of items selected.a precise number of items selected.  For example: enablesFor=" 4" enables the action only when 4 items are selected 
 * - any number of items selected 

I've included the patch to add this enhancement
Comment 1 Simon Ringuette CLA 2007-11-14 16:52:03 EST
Created attachment 82917 [details]
This is a demo project using the enhencement

I've included a sample project that uses the enhencements.

The project is a plugin project that adds an editor for .sample files.

Simply create a .sample file in a project and open it (the content does not matter).

The editor is simply a list and depending on your seleciton various sections will appear in the proeprties.

There are 3 possible sections:

- One will show if exactly 3 items are selected (backward compatibility)
- One will show if none or one item is selected (well... one item is selected since if nothing is selected the property tabs will not show but this uses the wildcard for 0 or 1)
- One will show if two or more Srings are selected (using the 2+ wildcard)
Comment 2 Simon Ringuette CLA 2007-11-14 16:53:46 EST
A last comment on the enhancement implementaiton. I've re-used the org.eclipse.ui.SelectionEnabler to enablesFor wildcard.
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:17:46 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.