Examples of ITypeRoot


Examples of org.eclipse.jdt.core.ITypeRoot

   */
  public static ImportRewrite create(CompilationUnit astRoot, boolean restoreExistingImports) {
    if (astRoot == null) {
      throw new IllegalArgumentException("AST must not be null"); //$NON-NLS-1$
    }
    ITypeRoot typeRoot = astRoot.getTypeRoot();
    if (!(typeRoot instanceof ICompilationUnit)) {
      throw new IllegalArgumentException("AST must have been constructed from a Java element"); //$NON-NLS-1$
    }
    List existingImport= null;
    if (restoreExistingImports) {
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

    ASTNode root= rootNode.getRoot();
    if (!(root instanceof CompilationUnit)) {
      throw new IllegalArgumentException("This API can only be used if the AST is created from a compilation unit or class file"); //$NON-NLS-1$
    }
    CompilationUnit astRoot= (CompilationUnit) root;
    ITypeRoot typeRoot = astRoot.getTypeRoot();
    if (typeRoot == null || typeRoot.getBuffer() == null) {
      throw new IllegalArgumentException("This API can only be used if the AST is created from a compilation unit or class file"); //$NON-NLS-1$
    }

    char[] content= typeRoot.getBuffer().getCharacters();
    LineInformation lineInfo= LineInformation.create(astRoot);
    String lineDelim= typeRoot.findRecommendedLineSeparator();
    Map options= typeRoot.getJavaProject().getOptions(true);

    return internalRewriteAST(content, lineInfo, lineDelim, astRoot.getCommentList(), options, rootNode, (RecoveryScannerData)astRoot.getStatementsRecoveryData());
  }
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

    TestNGPlugin.log("[TestNGLaunchShortcut] " + s);
//    System.out.println("[TestNGLaunchShortcut] " + s);
  }

  public void launch(IEditorPart editor, String mode) {
    ITypeRoot root = JavaUI.getEditorInputTypeRoot(editor.getEditorInput());
    if (root != null) {
      IMethod method = resolveSelectedMethod(editor, root);
      if (method != null) {
        run(method, mode);
      }
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

      IEditorReference[] editors = page.getEditorReferences();
//        workbench.getActiveWorkbenchWindow().getActivePage().getEditorReferences();
      for (IEditorReference ref : editors) {
        IEditorPart editor = ref.getEditor(false);
        if (editor != null) {
          ITypeRoot root = JavaUI.getEditorInputTypeRoot(editor.getEditorInput());
          if (root != null && root.getElementType() == IJavaElement.COMPILATION_UNIT) {
            result.add(convertToJavaElement(root));
          }
        }
      }
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

  public void reconcile(ReconcileContext context) {

    try {

      CompilationUnit compilationUnit = context.getAST3();
      ITypeRoot typeRoot = compilationUnit.getTypeRoot();
      IType type = typeRoot.findPrimaryType();

      // Skip non-interfaces
      if (type == null || !type.isInterface() || type.isAnnotation()) {
        super.reconcile(context);
        return;
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

  public void validate(CompilationUnit element,
      SpringDataValidationContext context, IProgressMonitor monitor) {

    try {

      ITypeRoot typeRoot = element.getTypeRoot();
      IType type = typeRoot.findPrimaryType();

      if (!supports(typeRoot))
        return;

      // resolve repository information and generate problem markers
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

      return false;
    }

    if (element instanceof CompilationUnit) {
      CompilationUnit cu = (CompilationUnit) element;
      ITypeRoot typeRoot = cu.getTypeRoot();

      if (typeRoot == null) {
        return false;
      }

      IType type = typeRoot.findPrimaryType();
      if (type == null) {
        return false;
      }

      // Skip non-interfaces
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot

  }

  public void validate(CompilationUnit element,
      SpringDataValidationContext context, IProgressMonitor monitor) {

    ITypeRoot typeRoot = element.getTypeRoot();
    IType type = typeRoot.findPrimaryType();

    // resolve repository information and generate problem markers
    RepositoryInformation information = new RepositoryInformation(type);

    Class<?> domainClass = information.getManagedDomainClass();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.