@Override
 public boolean select(Viewer viewer, Object parentElement, Object element) {
   if (element instanceof ICompilationUnit) {
     try {
       ICompilationUnit cu = (ICompilationUnit) element;
       if (cu.getUnderlyingResource() != null) {
         return !ROO_AJ_PATTERN.matcher(cu.getUnderlyingResource().getName()).matches();
       }
     } catch (JavaModelException e) {
       // just ignore this here
     }
   }
   return true;
 }
Ejemplo n.º 2
0
  private void printFilesProblems(ICompilationUnit unit, StringBuilder sb)
      throws JavaModelException, CoreException {
    IResource javaSourceFile = unit.getUnderlyingResource();
    IMarker[] markers =
        javaSourceFile.findMarkers(
            IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
    if (markers != null && markers.length > 0) {
      Document doc = new Document(unit.getSource());

      sb.append("<COMPILE_PROBLEMS>");
      for (IMarker marker : markers) {
        printProblemXML(marker, doc, sb);
      }
      sb.append("</COMPILE_PROBLEMS>");
    }
  }
Ejemplo n.º 3
0
 public static boolean isTypeGroovyElement(IType type) {
   // TODO CD verify following check with Groovy Eclipse
   ICompilationUnit cu = type.getCompilationUnit();
   if (cu != null && cu.getResource() != null) {
     return cu.getResource().getName().endsWith(GROOVY_FILE_EXTENSION);
   } else if (cu != null) {
     try {
       IResource resource = cu.getUnderlyingResource();
       if (resource != null) {
         return resource.getName().endsWith(GROOVY_FILE_EXTENSION);
       }
     } catch (JavaModelException e) {
       // ignore
     }
   }
   return false;
 }