Skip to main content


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: 112
Registered: July 2009
Senior 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: 3118
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: 112
Registered: July 2009
Senior 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: Fri Apr 19 13:02:13 GMT 2024

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

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

Back to the top