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

Bug 330876

Summary: Disabling WikiText menu element
Product: z_Archived Reporter: Ilya Platonov <realill>
Component: MylynAssignee: David Green <greensopinion>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: kds, steffen.pingel
Version: unspecified   
Target Milestone: 1.4.0   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot
none
screenshot showing content types registry
none
Sceenshot of mylin version
none
screenshot of menu element on Java file
none
patch that fixes the issue
none
mylyn/context/zip none

Description Ilya Platonov CLA 2010-11-23 00:26:32 EST
Build Identifier: 20100917-0705

Right now we are in the middle of developing some GEF based editor. The problem is - it hard to remove WikiText menu element from our editors context menu. 
There are two reasons for it:
1) It does contribute itself into popup:org.eclipse.ui.popup.any
2) It does not have any id specified so I could track it and remove from my contributor easily.

So to avoid it appearing in the editor we need to instruct user to either remove Mylyn plugin or go into preferences and do some manipulations there, which is confusing.

There should be something done there to avoid this situation, since WikiText does not have any sense for model files.

Reproducible: Always
Comment 1 David Green CLA 2010-11-25 15:02:23 EST
Thanks for the bug.  The WikiText menu _should_ only appear for files that WikiText can work with... not sure why it's appearing on your editor.  I'll look into this.
Comment 2 Ilya Platonov CLA 2010-11-26 00:49:06 EST
We are using XML (EMF) files with custom (*.am) extension.

Looks like property tester for menu contribution is broken
Comment 3 Ilya Platonov CLA 2010-11-26 00:50:02 EST
Created attachment 183900 [details]
Screenshot

Attaching screenshot.
Comment 4 David Green CLA 2010-12-02 17:13:16 EST
Created attachment 184419 [details]
screenshot showing content types registry

I'm having troubles reproducing here.  Can you take a look at your content types and see if anything under wikitext would register against a file extension that you're using?  You can see this in your preferences as shown in the attached screenshot
Comment 5 David Green CLA 2010-12-02 17:14:37 EST
In case it helps i've added an id 'org.eclipse.mylyn.wikitext.ui.contextmenu' to the WikiText menu.
Comment 6 David Green CLA 2010-12-02 17:15:09 EST
what version of Mylyn WikiText are you using?
Comment 7 Ilya Platonov CLA 2010-12-03 00:53:25 EST
I have the same configuration as you do.

It is easy to reproduce - donwload eclipse from eclipse.org
---
Eclipse IDE for Java Developers

Version: Helios Service Release 1
Build id: 20100917-0705
---
I am using linux version eclipse-java-helios-SR1-linux-gtk.tar.gz

- unpack it
- run it on fresh workspace
- create Java project with java file
- Open java and right click it and it will be right there

After tring to use "Generate Docbook" on Java file it will give error and turn off.
Comment 8 Ilya Platonov CLA 2010-12-03 00:54:15 EST
Created attachment 184437 [details]
Sceenshot of mylin version
Comment 9 Ilya Platonov CLA 2010-12-03 00:55:37 EST
Created attachment 184438 [details]
screenshot of menu element on Java file
Comment 10 David Green CLA 2011-03-10 12:13:22 EST
sorry, didn't make it in time for this release.   resetting target milestone
Comment 11 David Green CLA 2011-03-10 13:14:23 EST
might still be possible to get this one in, it should just be a fix to the enablement expression.  I'll take another look.
Comment 12 David Green CLA 2011-03-10 14:22:54 EST
Created attachment 190903 [details]
patch that fixes the issue

The problem was that we were using a property tester that required plug-in activation.

The attached patch removes the FilePropertyTester class and instead uses org.eclipse.core.resources.contentTypeId with kindOf argument.  

Tested and it has the desired behaviour.   Steffen, can you take a look?  It would be great to get this in the build.
Comment 13 David Green CLA 2011-03-10 14:22:56 EST
Created attachment 190904 [details]
mylyn/context/zip
Comment 14 Steffen Pingel CLA 2011-03-10 15:09:38 EST
The patch looks great. Please go ahead and apply and we can then do some testing on older versions of Eclipse.
Comment 15 David Green CLA 2011-03-10 15:34:43 EST
changes pushed.  Let's discuss a test plan.
Comment 16 Steffen Pingel CLA 2011-03-10 22:03:06 EST
I did some quick testing on 3.4 and 3.5 with the latest weekly build and the WikiText menu did not show for textile or mediawiki files any longer. It still works on Eclipse 3.6 and 3.7 though.
Comment 17 David Green CLA 2011-03-11 14:19:45 EST
Thanks Steffen.  I'll see if there's something that can be done about 3.5 and 3.4.
Comment 18 Steffen Pingel CLA 2011-03-15 20:56:01 EDT
Closing. Release build is under way. We can consider a fix for Eclipse 3.4/3.5 for WikiText 1.4.1 or 1.5 if needed.