Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Accesing to imports....
Accesing to imports.... [message #42023] Wed, 28 May 2003 09:04 Go to next message
Eclipse UserFriend
Originally posted by: jmordax.terra.es

I am not able to find a way to get access to imports....

Once I arrive to a Compilation Unit, it seems getChildren retuns just:

- A PackageDeclaration.

- A SourceType.

Both within internal packages.

Using IType, instead of SourceType I got access to:

- Static blocks.
- Fields.
- Methods.

But I haven't found a way to access imports. Any help?

Thanks in advance,

Chemi.
Re: Accesing to imports.... [message #42054 is a reply to message #42023] Wed, 28 May 2003 09:09 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

CompilationUnit.imports() will return a List with ImportDecleration element.

Michael


"Chemi" <jmordax@terra.es> schrieb im Newsbeitrag
news:bb2c42$uac$1@rogue.oti.com...
> I am not able to find a way to get access to imports....
>
> Once I arrive to a Compilation Unit, it seems getChildren retuns just:
>
> - A PackageDeclaration.
>
> - A SourceType.
>
> Both within internal packages.
>
> Using IType, instead of SourceType I got access to:
>
> - Static blocks.
> - Fields.
> - Methods.
>
> But I haven't found a way to access imports. Any help?
>
> Thanks in advance,
>
> Chemi.
>
Re: Accesing to imports.... [message #42084 is a reply to message #42054] Wed, 28 May 2003 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adam_kiezun.ch.ibm.spam.protection.com

or ICompilationUnit.getImportContainer().getImports()

depends what you have in hand, ICompilationUnit or org.eclipse.jdt.core.dom.CompilationUnit

a.
--
eclipse.org
Re: Accesing to imports.... [message #42115 is a reply to message #42054] Wed, 28 May 2003 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jmordax.terra.es

Ouch! How I missed that?

Thanks and sorry for such stupid question,

Chemi.

Michael Täge wrote:

>Hello,
>
>CompilationUnit.imports() will return a List with ImportDecleration element.
>
>Michael
>
Re: Accesing to imports.... [message #42146 is a reply to message #42084] Wed, 28 May 2003 09:56 Go to previous message
Eclipse UserFriend
Originally posted by: jmordax.terra.es

It seems IImportContainer just let me access imports by name. I will
have to use ICompilationUnit option which let me access all the imports
at the same time (an array).

What is the purpose/usage of IImportContainer?

Thanks again,

Chemi.

Adam Kiezun wrote:

>or ICompilationUnit.getImportContainer().getImports()
>
>depends what you have in hand, ICompilationUnit or org.eclipse.jdt.core.dom.CompilationUnit
>
>a.
>--
>eclipse.org
>
>
Previous Topic:exporting to jar, include library from build path
Next Topic:Outline
Goto Forum:
  


Current Time: Tue Jul 22 13:58:37 EDT 2025

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

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

Back to the top