XtextEditor with folding disabled by defaulthttps://www.eclipse.org/forums/index.php/mv/msg/457448/1014812/#msg_1014812

I need to have a XtextEditor which has folding disabled by default.

In other words, I want that folding is disabled by default, in the same way the user can disable it by deselecting "Folding" -> "Enable Folding" from the context menu.

How can I get that?

Thanks in advance
Marco]]>Marco Naddeo2013-02-26T14:06:51-00:00Re: XtextEditor with folding disabled by defaulthttps://www.eclipse.org/forums/index.php/mv/msg/457448/1014908/#msg_1014908
simply subclassing DefaultFoldingRegionProvider and binding it doesnt work?]]>Christian Dietrich2013-02-26T18:13:10-00:00Re: XtextEditor with folding disabled by defaulthttps://www.eclipse.org/forums/index.php/mv/msg/457448/1015032/#msg_1015032
getFoldingRegions method , but if I only want to change the preference value (disabling it by default and not completely), how can I do it?

In addition, is there a way to completely disable the folding from the context menu?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de]]>Christian Dietrich2013-02-27T09:22:33-00:00Re: XtextEditor with folding disabled by defaulthttps://www.eclipse.org/forums/index.php/mv/msg/457448/1015213/#msg_1015213
regarding the second question, bind your own implementation of XtextEditor and override the rulerContextMenuAboutToShow method. You should be able to remove the foldingMenu again.

Alex]]>Alexander Nittka2013-02-27T18:53:55-00:00Re: XtextEditor with folding disabled by defaulthttps://www.eclipse.org/forums/index.php/mv/msg/457448/1015215/#msg_1015215
org.eclipse.xtext.ui.editor.XtextEditor.installFoldingSupport(ProjectionViewer)
and e.g. calling projectionViewer.doOperation(ProjectionViewer.TOGGLE); once mor
so that folding is disabled again]]>Christian Dietrich2013-02-27T19:08:29-00:00