Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Transform to lowercase
Transform to lowercase [message #1259584] Fri, 28 February 2014 15:08 Go to next message
Cristiano Politowski is currently offline Cristiano PolitowskiFriend
Messages: 11
Registered: February 2014
Location: Brasil
Junior Member
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 16:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

you may have a look at autoedit


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Transform to lowercase [message #1259720 is a reply to message #1259657] Fri, 28 February 2014 18:25 Go to previous messageGo to next message
Cristiano Politowski is currently offline Cristiano PolitowskiFriend
Messages: 11
Registered: February 2014
Location: Brasil
Junior Member
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 18:54 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
i dont think so

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Abstract Syntax Tree (AST)
Next Topic:Xtext models in SOLr
Goto Forum:
  


Current Time: Fri Apr 26 23:10:47 GMT 2024

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

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

Back to the top