Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 241849 - [Markers] Need a property tester to test the marker type of a MarkerEntry
Summary: [Markers] Need a property tester to test the marker type of a MarkerEntry
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Prakash Rangaraj CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-23 13:52 EDT by Alanna Zito CLA
Modified: 2009-06-03 13:40 EDT (History)
2 users (show)

See Also:


Attachments
Marker Property tester v01 (11.79 KB, patch)
2008-10-20 15:30 EDT, Paul Webster CLA
no flags Details | Diff
Test project (4.20 KB, application/octet-stream)
2008-10-20 15:31 EDT, Paul Webster CLA
no flags Details
Patch with tests (22.18 KB, patch)
2008-10-23 05:50 EDT, Prakash Rangaraj CLA
pwebster: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alanna Zito CLA 2008-07-23 13:52:50 EDT
Build ID:  I20080617-2000

Steps To Reproduce:
There is no property tester defined in org.eclipse.ui.ide for testing the marker type of a MarkerEntry in a marker view.  Such a tester would be very useful for clients who are trying to add popup menu items to a marker view.

I could define a property tester in my own plug-in for testing the marker type, but then I run in to plug-in activation issues.  It would be better for the tester to be defined in a lower-level plug-in.  

More information:
In 3.4, the marker views no longer support using object contributions to add to the popup menu.  This means that existing object contributions need to be migrated to the command/handler infrastructure. However, with object contributions, it was possible to control visibility and enablement using the filters defined in IMarkerActionFilter.      The command/handler infrastructure uses property testers to accomplish this sort of filtering instead; it would be nice for the platform to define property testers equivalent to these filters to make migration easier.
Comment 1 Paul Webster CLA 2008-10-20 15:30:27 EDT
Created attachment 115599 [details]
Marker Property tester v01

Prakash's property tester
Comment 2 Paul Webster CLA 2008-10-20 15:31:35 EDT
Created attachment 115600 [details]
Test project

Prakash's sample test project
Comment 3 Paul Webster CLA 2008-10-20 15:49:01 EDT
For the type ... I believe that you need to adapt to org.eclipse.core.resources.IMarker

Also, for our core expressions to do with commands (visibleWhen, enabledWhen, activeWhen) we have a default variable that is the selection variable expressed as a Collection.

So most expressions look like:
<visibleWhen>
  <iterate operator="and">
    <adapt type="org.eclipse.core.resources.IMarker">
      <test ...whatever.../>
    </adapt>
  </iterate>
</visibleWhen>

This is the equivalent expression, except the default variables becomes an ISelection:

<visibleWhen>
  <with variable="selection">
  <iterate operator="and">
    <adapt type="org.eclipse.core.resources.IMarker">
      <test ...whatever.../>
    </adapt>
  </iterate>
  </with>
</visibleWhen>

PW
Comment 4 Prakash Rangaraj CLA 2008-10-23 05:50:50 EDT
Created attachment 115905 [details]
Patch with tests

Done.

Attached patch contains both code and the tests
Comment 5 Paul Webster CLA 2008-10-23 10:58:12 EDT
Released to HEAD >20081023

Good tests.

PW