Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IImportDeclaration


*/
public class JdtQuickfixUtils {

  public static TextEdit getTextEditForImport(ICompilationUnit cu, String importTypeNString) {
    try {
      IImportDeclaration requestMappingDecl = cu.getImport(importTypeNString);
      if (requestMappingDecl == null || !requestMappingDecl.exists()) {
        ImportRewrite importRewrite = StubUtility.createImportRewrite(cu, true);
        importRewrite.addImport(importTypeNString);
        return importRewrite.rewriteImports(null);
      }

View Full Code Here


    if (!(element instanceof ISourceReference))
      return null;

    if (element.getElementType() == IJavaElement.IMPORT_DECLARATION) {

      IImportDeclaration declaration = (IImportDeclaration) element;
      IImportContainer container = (IImportContainer) declaration
          .getParent();
      ISourceRange srcRange = null;
      try {
        srcRange = container.getSourceRange();
      }
View Full Code Here

    if (!(element instanceof ISourceReference))
      return null;

    if (element.getElementType() == IJavaElement.IMPORT_DECLARATION) {

      IImportDeclaration declaration = (IImportDeclaration) element;
      IImportContainer container = (IImportContainer) declaration.getParent();
      ISourceRange srcRange = null;
      try {
        srcRange = container.getSourceRange();
      }
      catch (JavaModelException e) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IImportDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.