Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » organize imports beautifier?
organize imports beautifier? [message #61148] Tue, 12 May 2009 22:56 Go to next message
Miles Parker is currently offline Miles Parker
Messages: 1340
Registered: July 2009
Senior Member
Will M2T include a java beautifier that cleans up imports ala the
hybrid labs beautifier? I'm asking because I want to find out if an
Eclipse external dependency would be neccessary to achieve this.

cheers,

Miles
Re: organize imports beautifier? [message #61245 is a reply to message #61148] Fri, 15 May 2009 13:06 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Miles:

I'm not aware of any plans within the various M2T components.

As for implementing such a thing in Eclipse, the easiest approach would
be to make use of the Java Development Tools (JDT) that currently
implements the Organize Imports command. I haven't looked, but I'd guess
you'd end up with a dependency on JDT.

Paul
Re: organize imports beautifier? [message #61318 is a reply to message #61245] Fri, 15 May 2009 22:30 Go to previous messageGo to next message
Miles Parker is currently offline Miles Parker
Messages: 1340
Registered: July 2009
Senior Member
Thanks Paul,

I heard from Karsten on oAW list that they're working to try to get it over.

FWIW: The hybridlabs functionality is actually a bit different from
that in JDT -- it takes fully qualified inline package names and makes
them into import statements. One could strip all qualifications and
then do the import but this wouldn't handle the many cases where class
names are shared, or for example where some one uses java.awt.List and
java.util.List in the same class. :)

In practice what I have been doing is using the oAW M2T beautifier
which uses the JDT settings IIRC, and then using the hybrid labs
beauifier with formatting turned off just to get the import qualified
package names.

Miles

On 2009-05-15 06:06:10 -0700, Paul Elder <pelder@ca.ibm.com> said:

> Miles:
>
> I'm not aware of any plans within the various M2T components.
>
> As for implementing such a thing in Eclipse, the easiest approach would
> be to make use of the Java Development Tools (JDT) that currently
> implements the Organize Imports command. I haven't looked, but I'd
> guess you'd end up with a dependency on JDT.
>
> Paul
Re: organize imports beautifier? [message #61341 is a reply to message #61318] Sun, 17 May 2009 18:25 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten Thoms
Messages: 354
Registered: July 2009
Location: Dortmund
Senior Member

I have agreement from Karsten Klein to migrate the Hybridlabs beautifier
to Google Code. It cannot be itself hosted at M2T since it has a
dependency to Jalopy for code formatting. It might be that I take over
the import organizing feature to M2T, depending on IP approval and time.
For a first approach I have enough to do just to found the project at
Google and add a component for M2T compliance.

~Karsten

On 16.05.09 00:30, Miles Parker wrote:
>
> Thanks Paul,
>
> I heard from Karsten on oAW list that they're working to try to get it
> over.
>
> FWIW: The hybridlabs functionality is actually a bit different from that
> in JDT -- it takes fully qualified inline package names and makes them
> into import statements. One could strip all qualifications and then do
> the import but this wouldn't handle the many cases where class names are
> shared, or for example where some one uses java.awt.List and
> java.util.List in the same class. :)
>
> In practice what I have been doing is using the oAW M2T beautifier which
> uses the JDT settings IIRC, and then using the hybrid labs beauifier
> with formatting turned off just to get the import qualified package names.
>
> Miles
>
> On 2009-05-15 06:06:10 -0700, Paul Elder <pelder@ca.ibm.com> said:
>
>> Miles:
>>
>> I'm not aware of any plans within the various M2T components.
>>
>> As for implementing such a thing in Eclipse, the easiest approach
>> would be to make use of the Java Development Tools (JDT) that
>> currently implements the Organize Imports command. I haven't looked,
>> but I'd guess you'd end up with a dependency on JDT.
>>
>> Paul
>
>


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: organize imports beautifier? [message #61387 is a reply to message #61341] Mon, 18 May 2009 22:00 Go to previous message
Karsten Thoms is currently offline Karsten Thoms
Messages: 354
Registered: July 2009
Location: Dortmund
Senior Member

Hi Miles!

I have founded the Google Code project for the Hybridlabs Beautifier -
and made it ready for M2T. The JavaImportBeautifier class now implements
both PostProcessor interfaces, from oAW4 and M2T. This way it is
backward compatible.

We won't be able to migrate the import organizing feature to M2T, it is
dependend on Antlr. So the component will stay standalone, and we should
discuss therefore further issues outside this list.

A first distribution of the beautifier is available:
http://code.google.com/p/hybridlabs-beautifier/downloads/lis t

Best wishes,
~Karsten


On 17.05.09 20:25, Karsten Thoms wrote:
> I have agreement from Karsten Klein to migrate the Hybridlabs beautifier
> to Google Code. It cannot be itself hosted at M2T since it has a
> dependency to Jalopy for code formatting. It might be that I take over
> the import organizing feature to M2T, depending on IP approval and time.
> For a first approach I have enough to do just to found the project at
> Google and add a component for M2T compliance.
>
> ~Karsten
>
> On 16.05.09 00:30, Miles Parker wrote:
>>
>> Thanks Paul,
>>
>> I heard from Karsten on oAW list that they're working to try to get it
>> over.
>>
>> FWIW: The hybridlabs functionality is actually a bit different from that
>> in JDT -- it takes fully qualified inline package names and makes them
>> into import statements. One could strip all qualifications and then do
>> the import but this wouldn't handle the many cases where class names are
>> shared, or for example where some one uses java.awt.List and
>> java.util.List in the same class. :)
>>
>> In practice what I have been doing is using the oAW M2T beautifier which
>> uses the JDT settings IIRC, and then using the hybrid labs beauifier
>> with formatting turned off just to get the import qualified package
>> names.
>>
>> Miles
>>
>> On 2009-05-15 06:06:10 -0700, Paul Elder <pelder@ca.ibm.com> said:
>>
>>> Miles:
>>>
>>> I'm not aware of any plans within the various M2T components.
>>>
>>> As for implementing such a thing in Eclipse, the easiest approach
>>> would be to make use of the Java Development Tools (JDT) that
>>> currently implements the Organize Imports command. I haven't looked,
>>> but I'd guess you'd end up with a dependency on JDT.
>>>
>>> Paul
>>
>>
>


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:<c:iterate> over elements
Next Topic:[Announce] M2T XPAND 0.7.0RC1 is available
Goto Forum:
  


Current Time: Thu Sep 18 21:45:04 GMT 2014

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

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