Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Transform to lowercase
Transform to lowercase [message #1259584] Fri, 28 February 2014 10:08 Go to next message
Eclipse UserFriend
Hi!

Is there a way to transform a name of a element to lowercase automatically? When typing CTRL+SPACE?

I'm trying this using Content Assist without results.

My grammar:

Element:
    name=QualifiedName;

QualifiedName:
	ID ('.' ID)*;

terminal ID:
	('a'..'z') ('a'..'z' | '_' | '0'..'9')*;



Thanks in advance.
Re: Transform to lowercase [message #1259657 is a reply to message #1259584] Fri, 28 February 2014 11:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

you may have a look at autoedit
Re: Transform to lowercase [message #1259720 is a reply to message #1259657] Fri, 28 February 2014 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the fast answer.

Sorry, but can you be more specific?

I tried this:

mport org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.IDocument;

public class OvmAutoEditStrategy implements IAutoEditStrategy {

	@Override
	public void customizeDocumentCommand(IDocument document,
			DocumentCommand command) {
		
	}

}


But i don't know how to get my elements from here.

I want something like this:

...
if(Parameter instanceof Element){
    Element.setName(Element.getName().toLowerCase());
}
...


Is it possible?
Re: Transform to lowercase [message #1259740 is a reply to message #1259720] Fri, 28 February 2014 13:54 Go to previous message
Eclipse UserFriend
i dont think so
Previous Topic:Abstract Syntax Tree (AST)
Next Topic:Xtext models in SOLr
Goto Forum:
  


Current Time: Sun Jul 06 01:50:11 EDT 2025

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

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

Back to the top