Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Creating Custom Task Tags
Creating Custom Task Tags [message #1809215] Thu, 11 July 2019 13:31 Go to next message
Eclipse UserFriend
Should it be a mystery to me why I can't create custom task tags and have my Xtext editor recognize them?

Xtext 2.12 Neon

Is there something I have to enable in the MWE2 workflow to get this enabled or get it added to my DSL preferences?

It seems simple, so I'm confused that I'm confused about it.
Re: Creating Custom Task Tags [message #1809217 is a reply to message #1809215] Thu, 11 July 2019 13:54 Go to previous messageGo to next message
Eclipse UserFriend
is ths about the preference page what the fragment is for or about the tags themselves? which is done via DefaultTaskTagProvider / PreferenceTaskTagProvider which can be customized using normal bindings

[Updated on: Thu, 11 July 2019 13:54] by Moderator

Re: Creating Custom Task Tags [message #1809298 is a reply to message #1809217] Fri, 12 July 2019 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Christian Dietrich wrote on Thu, 11 July 2019 13:54
is ths about the preference page what the fragment is for or about the tags themselves?


I'm using Neon 4.6.3 and Xtext 2.12 and I don't get any Task Tags preferences pages for my DSL by default. Is there a way to add the preference page in Xtext 2.12?

In general, I'm not having any luck adding task tags and getting them to be detected in my DSL files. Perhaps it's only because xtext is searching for its default set. I've tried to add task tags in the Structural Text Editor preferences, but that's not working.

Quote:

which is done via DefaultTaskTagProvider / PreferenceTaskTagProvider which can be customized using normal bindings


Cool, I've never seen those and can't find them in the docs. Is there a standard way to override them or a blog example somewhere for how to do the bindings/overrides?

I'm not getting any search hits doing a File Search in my workspace for TagProvider - i.e. searching for an existing stub where the binding should occur.

[Updated on: Fri, 12 July 2019 15:02] by Moderator

Re: Creating Custom Task Tags [message #1809299 is a reply to message #1809298] Fri, 12 July 2019 15:08 Go to previous messageGo to next message
Eclipse UserFriend
As is aid. You can add the fragment and merge plugin.xml_gen to plugin.xml
There is no example maybe a search on GitHub results in something
I doubt you can add simply a binding to the class to the runtime respectively zu module
Re: Creating Custom Task Tags [message #1809301 is a reply to message #1809299] Fri, 12 July 2019 15:34 Go to previous messageGo to next message
Eclipse UserFriend
Christian Dietrich wrote on Fri, 12 July 2019 15:08
As is aid. You can add the fragment and merge plugin.xml_gen to plugin.xml


Okay, I'll try that. Thank you. What fragment do I add in the generator?
Re: Creating Custom Task Tags [message #1809302 is a reply to message #1809301] Fri, 12 July 2019 15:53 Go to previous messageGo to next message
Eclipse UserFriend
TaskTagPreferencePageFragment2
Re: Creating Custom Task Tags [message #1809307 is a reply to message #1809302] Fri, 12 July 2019 18:20 Go to previous messageGo to next message
Eclipse UserFriend
Okay, thanks again. I don't think that class exists in Xtext 2.12. I can't find it with Open Type, File Search, and the MWE2 generator can't find it. I've manually looked through org.eclipse.xtext.xtext.generator packages tried to import org.eclipse.xtext.xtext.generator.ui.* into the MWE2 generator.

Github makes it look like it was there since 2.6. But I can't figure out what qualifier to put in front of it.

fragment = <mystery>..TaskTagPreferencePageFragment2 {}

I might just have to use #FIXME like everyone else. :-)
Re: Creating Custom Task Tags [message #1809313 is a reply to message #1809307] Sat, 13 July 2019 01:04 Go to previous messageGo to next message
Eclipse UserFriend
Which workflow do you use?
The javadoc says it is there since 2.6
Simply use the full qualified name
Also me sure that the plug-in that contains it is on the classpath
Re: Creating Custom Task Tags [message #1809315 is a reply to message #1809313] Sat, 13 July 2019 01:09 Go to previous messageGo to next message
Eclipse UserFriend
PS you can have at the fragment source code and do what it does manually
Or you execute it with 2 18 and copy the generated. Stuff over
Re: Creating Custom Task Tags [message #1824367 is a reply to message #1809315] Tue, 14 April 2020 09:12 Go to previous messageGo to next message
Eclipse UserFriend
Just following up...

This does appear to work in 2.18.

I've added the following line to my MWE2 generator:

 fragment = org.eclipse.xtext.xtext.generator.ui.tasks.TaskTagPreferencePageFragment2 auto-inject {} 


Once the generator is run, I merged the contents between the UI project's plugin.xml and plugin.xml_gen files. There was a easily detectable comment <#-- task preference page for <my_dsl> --> that needed to be merged. It adds two extensions to your UI plugin.

Once I did this, the preference page showed up under myDsl preferences and I could add customized tags and have them show up in Task View.

Thanks for the help.
Re: Creating Custom Task Tags [message #1824370 is a reply to message #1824367] Tue, 14 April 2020 09:31 Go to previous messageGo to next message
Eclipse UserFriend
hi, what did not work exactly?
Re: Creating Custom Task Tags [message #1827154 is a reply to message #1824370] Fri, 08 May 2020 08:50 Go to previous message
Eclipse UserFriend
When I first attempt this, I was on 2.12. In that version, I was having trouble resolving the Class path for the fragment in the MWE generator. In 2.18 it wasn't an issue resolving the class path/package for the fragment and it worked out of the box.
Previous Topic:[SOLVED] Export DSL as runnable Jar
Next Topic:[Solved] Specify path of file to generate
Goto Forum:
  


Current Time: Fri Jul 25 21:07:58 EDT 2025

Powered by FUDForum. Page generated in 1.10051 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top