Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to create ICompilationUnit from source
How to create ICompilationUnit from source [message #204459] Fri, 20 May 2005 19:49 Go to next message
Marcel  tör is currently offline Marcel törFriend
Messages: 73
Registered: July 2009
Member
Hi all,

I'd like to create an ICompilationUnit instance from either
- source code as String or
- source code as IDOMCompilationUnit

I've checked the Eclipse source code, but couldn't find a way to achieve
this. Any ideas?

--
Marcel Stör
http://www.frightanic.com
Re: How to create ICompilationUnit from source [message #207341 is a reply to message #204459] Mon, 20 June 2005 08:46 Go to previous messageGo to next message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
You can use: IPackageFragment#createCompilationUnit(String, String, ...)
Note this is the first topic of 'Manipulating Java code' of the JDT Programmer's Guide in Help.

Jerome

Marcel Stör wrote:
> Hi all,
>
> I'd like to create an ICompilationUnit instance from either
> - source code as String or
> - source code as IDOMCompilationUnit
>
> I've checked the Eclipse source code, but couldn't find a way to achieve
> this. Any ideas?
>
Re: How to create ICompilationUnit from source [message #210684 is a reply to message #207341] Fri, 22 July 2005 20:34 Go to previous messageGo to next message
Marcel  tör is currently offline Marcel törFriend
Messages: 73
Registered: July 2009
Member
"Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> schrieb im Newsbeitrag
news:d95vou$ktn$1@news.eclipse.org...
> You can use: IPackageFragment#createCompilationUnit(String, String, ...)
> Note this is the first topic of 'Manipulating Java code' of the JDT
Programmer's Guide in Help.

It's not that I didn't know that...
My problem is a bit more tricky, though. Our Swing application is running
outside Eclipse i.e. it's not a plugin. Still, I would like to invoke
Eclipse' "Organize imports" feature for a given String that represents a
Java class.

--
Marcel Stör
http://www.frightanic.com
Re: How to create ICompilationUnit from source [message #212090 is a reply to message #210684] Thu, 11 August 2005 08:43 Go to previous message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
Sorry. Invoking org.eclipse.jdt.core code outside a running Eclipse instance is not supported.

Marcel Stör wrote:
> "Jerome Lanneluc" <jerome_lanneluc@fr.ibm.com> schrieb im Newsbeitrag
> news:d95vou$ktn$1@news.eclipse.org...
>
>>You can use: IPackageFragment#createCompilationUnit(String, String, ...)
>>Note this is the first topic of 'Manipulating Java code' of the JDT
>
> Programmer's Guide in Help.
>
> It's not that I didn't know that...
> My problem is a bit more tricky, though. Our Swing application is running
> outside Eclipse i.e. it's not a plugin. Still, I would like to invoke
> Eclipse' "Organize imports" feature for a given String that represents a
> Java class.
>
Previous Topic:help moving project location
Next Topic:change eclipse vm frequently: easy solution?
Goto Forum:
  


Current Time: Thu Jul 25 18:38:29 GMT 2024

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

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

Back to the top