Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Creating Custom Task Tags
Creating Custom Task Tags [message #1809215] Thu, 11 July 2019 17:31 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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 17:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
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

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 11 July 2019 17:54]

Report message to a moderator

Re: Creating Custom Task Tags [message #1809298 is a reply to message #1809217] Fri, 12 July 2019 19:02 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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 19:02]

Report message to a moderator

Re: Creating Custom Task Tags [message #1809299 is a reply to message #1809298] Fri, 12 July 2019 19:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Creating Custom Task Tags [message #1809301 is a reply to message #1809299] Fri, 12 July 2019 19:34 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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 19:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
TaskTagPreferencePageFragment2

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Creating Custom Task Tags [message #1809307 is a reply to message #1809302] Fri, 12 July 2019 22:20 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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 05:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Creating Custom Task Tags [message #1809315 is a reply to message #1809313] Sat, 13 July 2019 05:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Creating Custom Task Tags [message #1824367 is a reply to message #1809315] Tue, 14 April 2020 13:12 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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 13:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
hi, what did not work exactly?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Creating Custom Task Tags [message #1827154 is a reply to message #1824370] Fri, 08 May 2020 12:50 Go to previous message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
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 Mar 29 09:58:33 GMT 2024

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

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

Back to the top