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

Bug 315659

Summary: Occurrence marker problem
Product: z_Archived Reporter: Zoltan Ujhelyi <zoltan.ujhelyi>
Component: IMPAssignee: Robert M. Fuhrer <rfuhrer>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Zoltan Ujhelyi CLA 2010-06-03 15:40:33 EDT
Build Identifier: 20100527-0614

I created an occurence marker for an IMP editor (IMP platform version: 0.1.106.v201004212015) as described in the PIMP your Eclipse tutorial, but my code was not working.

When placing a breakpoint at the start of the getOccurences() method, it did not pause the execution on selection changes. On the other hand, when the IMP editor got activated (e.g. switching to another editor then back), the breakpoint activates.

I think, the getOccurences() method should be called for every selection change of the universal editor.

Reproducible: Always
Comment 1 Robert M. Fuhrer CLA 2010-06-04 10:21:09 EDT
You're right, getOccurrences() should certainly be called for every selection change, and there's code to do precisely that. Presumably something got messed up in the enablement logic of the selection listener.
Comment 2 Robert M. Fuhrer CLA 2010-06-04 11:25:36 EDT
Just a quick sanity check: you did click on the "Toggle Mark Occurrences" button to enable the mode, didn't you?

I ask because I just did a quick test on the toy LEG language, and mark occurrences behaves as expected there.
Comment 3 Zoltan Ujhelyi CLA 2010-06-04 11:30:31 EDT
That was the error. As this function is always enabled in my host Eclipse since about 2 years, I completely forgotten about that toolbar button.

Thank you for your help.
Comment 4 Robert M. Fuhrer CLA 2010-06-04 11:55:10 EDT
No problem... glad it wasn't actually a bug. :-)

Though your getOccurrences() method probably also shouldn't be called at all if the mode is disabled. I'll have to look into that.