Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xbase] Auto-extensions
[Xbase] Auto-extensions [message #1005783] Mon, 28 January 2013 17:23 Go to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hello,


7 Languages For The JVM "Little Tortoise" language make use of an static auto-extension for Math and ColorConstants classes:

http://www.eclipse.org/Xtext/7languagesDoc.html#tortoise_additons

All imported extension methods from those two classes are static. This is equivalent to:

import static extension java.lang.Math
import static extension org.eclipse.draw2d.ColorConstants

My question is, how to add non-static auto-extension? Something like:

class MyClass {
extension MyExtensionClass = new MyExtensionClass
}

Thank you very much!


Regards,
Boris Brodski
Re: [Xbase] Auto-extensions [message #1005872 is a reply to message #1005783] Tue, 29 January 2013 07:20 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2961
Registered: July 2009
Senior Member
Hi Boris,

that's currently not easily possible but will be in the next release.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 28.01.13 18:23, schrieb Boris Brodski:
> Hello,
>
>
> 7 Languages For The JVM "Little Tortoise" language make use of an static
> auto-extension for Math and ColorConstants classes:
>
> http://www.eclipse.org/Xtext/7languagesDoc.html#tortoise_additons
>
> All imported extension methods from those two classes are static. This
> is equivalent to:
>
> import static extension java.lang.Math
> import static extension org.eclipse.draw2d.ColorConstants
>
> My question is, how to add non-static auto-extension? Something like:
>
> class MyClass {
> extension MyExtensionClass = new MyExtensionClass
> }
>
> Thank you very much!
>
>
> Regards,
> Boris Brodski
Re: [Xbase] Auto-extensions [message #1005998 is a reply to message #1005872] Tue, 29 January 2013 14:06 Go to previous message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 86
Registered: July 2009
Member
Hi Sebastian,


thank you very much for the advice.


Regards,
Boris
Previous Topic:ParserBasedContentAssistContextFactory.StatefulFactory mixing instances of the same grammar
Next Topic:Outline tree provider and view
Goto Forum:
  


Current Time: Sun Dec 21 20:22:45 GMT 2014

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

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