Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Formatting in EmbeddedEditor
Formatting in EmbeddedEditor [message #905025] Wed, 29 August 2012 15:09 Go to next message
Martin Buchheim is currently offline Martin BuchheimFriend
Messages: 3
Registered: July 2012
Junior Member
Hello,

we're currently developing on a new project that uses Xtext, and the new EmbeddedEditor API works pretty well for our purpose. That's why we decided to use it, even though it is new and "discouraged" yet.

So far, everything works pretty well, except the Formatting through the <MyDSL>Formatter extension of AbstractDeclarativeFormatter.

Basically, the way I trigger the formatting from a widget outside the embedded editor is as follows:

formatNowButton.addMouseListener(new org.eclipse.swt.events.MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
        XtextSourceViewer viewer = embeddedEditor.getViewer();
	if (viewer.canDoOperation(ISourceViewer.FORMAT)) {
	    viewer.doOperation(ISourceViewer.FORMAT);
	}
    }
});


The formatting is correctly triggered, but basically all it does is removing all formations that have been done by the user.

The result looks as if a regular WhiteSpaceFormatter has been active with the AutoLineWrap setting from the Formatter-class of my DSL. All other configuration settings(linewraps etc.) don't have any effect -- everything is put together in one huge single block with whitespaces between all elements, and linewraps after the length specified through FormattingConfig.setAutoLinewrap().

Any idea what could be the cause for this problem?

Thank you for your input,
Martin
Re: Formatting in EmbeddedEditor [message #907046 is a reply to message #905025] Mon, 03 September 2012 07:54 Go to previous message
Martin Buchheim is currently offline Martin BuchheimFriend
Messages: 3
Registered: July 2012
Junior Member
Does nobody have any ideas or experience on that topic?
Previous Topic:Matching cross-references and IDs
Next Topic:OCLInEcore documentation
Goto Forum:
  


Current Time: Fri Apr 19 02:40:31 GMT 2024

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

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

Back to the top