Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Check is type imported
Check is type imported [message #921548] Mon, 24 September 2012 08:00 Go to next message
Zvonimir Pavlinovic is currently offline Zvonimir Pavlinovic
Messages: 10
Registered: June 2012
Junior Member
Is there a simple way to check is some type imported? Basically, I have a code that I need to inject into some Java editor and I have all the bindings related to that code. What I need to is to check is some type, that is referenced in the code to be injected, imported within the targeted editor. I can get import statements and its binding but there seems to be none built-in functionality to achieve this check. Did I maybe miss it or I'll need to hack around it?
Re: Check is type imported [message #922225 is a reply to message #921548] Mon, 24 September 2012 21:17 Go to previous message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1024
Registered: July 2009
Senior Member
Simplified checking if a type is imported is probably not exposed (I may be wrong) because the typical way of dealing with imports is to use org.eclipse.jdt.core.dom.rewrite.ImportRewrite, if you're performing your changes by ast rewriting that is.

If you want to see example usage, just search for callers of org.eclipse.jdt.core.dom.rewrite.ImportRewrite.addImport(ITypeBinding, ImportRewriteContext).

HTH,
Stephan
Previous Topic:Eclipse and Lion - Kinda lost...
Next Topic:Debugger doesn't remain paused
Goto Forum:
  


Current Time: Fri Oct 31 10:13:12 GMT 2014

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

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