Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Disable formatting feature
Disable formatting feature [message #1729734] Mon, 18 April 2016 11:15 Go to next message
Eclipse UserFriend
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 11:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

what about letting

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

return null

by subclassing ContentFormatterFactory
Re: Disable formatting feature [message #1729738 is a reply to message #1729735] Mon, 18 April 2016 11:32 Go to previous messageGo to next message
Eclipse UserFriend
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 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Have a Look what the sourceviewerconfiguration does in your version
Re: Disable formatting feature [message #1729750 is a reply to message #1729740] Mon, 18 April 2016 12:29 Go to previous messageGo to next message
Eclipse UserFriend
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 12:31 Go to previous messageGo to next message
Eclipse UserFriend
?!? 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>
Re: Disable formatting feature [message #1729755 is a reply to message #1729752] Mon, 18 April 2016 12:45 Go to previous messageGo to next message
Eclipse UserFriend
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 12:53 Go to previous message
Eclipse UserFriend
no in yourdsl. in the plugin that ships with xtext


org.eclipse.xtext.ui
Previous Topic:XText TextViewer instead of Editor
Next Topic:Interger declared as keyword cannot be reused in other rules.
Goto Forum:
  


Current Time: Wed Jul 16 23:06:15 EDT 2025

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

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

Back to the top