Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Disable formatting feature
Disable formatting feature [message #1729734] Mon, 18 April 2016 15:15 Go to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
Hi,

I need to disable the formatting feature totally. I removed its fragment from the MWE2 and I don't have any other implementations for it but I am still finding it kinda working (default support) and I still find it in the right click menu -> source -> Formatting.

I need to disable it totally and remove this item from the menu.

Re: Disable formatting feature [message #1729735 is a reply to message #1729734] Mon, 18 April 2016 15:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

what about letting

org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration.getContentFormatter(ISourceViewer)

return null

by subclassing ContentFormatterFactory


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Disable formatting feature [message #1729738 is a reply to message #1729735] Mon, 18 April 2016 15:32 Go to previous messageGo to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
FYI I am using xtext 2.8.1
Do u mean to create a new class and extend ContentFormatterFactory ? I didn't find it in my classes list
Re: Disable formatting feature [message #1729740 is a reply to message #1729738] Mon, 18 April 2016 15:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Have a Look what the sourceviewerconfiguration does in your version

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Disable formatting feature [message #1729750 is a reply to message #1729740] Mon, 18 April 2016 16:29 Go to previous messageGo to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
ok that helped alot. Now it is shown as a disabled item in the right mouse button -> source -> formatting. How can I access this menu from the plugin.xml. I couldn't find this menu however the rest of the items are there in plugin.xml
Re: Disable formatting feature [message #1729752 is a reply to message #1729750] Mon, 18 April 2016 16:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
?!? i dont get that question.

...xtext.ui/plugin.xml contains

<command
commandId="org.eclipse.xtext.ui.FormatAction"
style="push">
<visibleWhen
checkEnabled="false">
<reference
definitionId="isActiveEditorAnInstanceOfXtextEditor">
</reference>
</visibleWhen>
</command>


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Disable formatting feature [message #1729755 is a reply to message #1729752] Mon, 18 April 2016 16:45 Go to previous messageGo to next message
Eleanor Richie is currently offline Eleanor RichieFriend
Messages: 125
Registered: August 2014
Senior Member
Actually I don't have it in my...xtext.ui/plugin.xml. However I still find it in the menu!
Re: Disable formatting feature [message #1729757 is a reply to message #1729755] Mon, 18 April 2016 16:53 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
no in yourdsl. in the plugin that ships with xtext


org.eclipse.xtext.ui


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:XText TextViewer instead of Editor
Next Topic:Interger declared as keyword cannot be reused in other rules.
Goto Forum:
  


Current Time: Thu Mar 28 11:55:16 GMT 2024

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

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

Back to the top