/**
   * @see
   *     edu.buffalo.cse.green.RefactorHandler#handleRemove(edu.buffalo.cse.green.editor.model.RootModel,
   *     org.eclipse.jdt.core.IJavaElement)
   */
  public void handleRemove(RootModel root, E element) {
    List<IJavaElement> cus = root.getElementsOfKind(COMPILATION_UNIT);

    for (IJavaElement cu : cus) {
      if (JavaModelListener.sameElements(cu.getAncestor(PACKAGE_FRAGMENT), element)) {
        CompilationUnitRefactorHandler.instance().handleRemove(root, (ICompilationUnit) cu);
      }
    }
  }
 static {
   // add the elements to consider changes for to a list
   map = new HashMap<Class, RefactorHandler>();
   map.put(JavaProject.class, ProjectRefactorHandler.instance());
   map.put(PackageFragment.class, PackageRefactorHandler.instance());
   map.put(CompilationUnit.class, CompilationUnitRefactorHandler.instance());
   map.put(SourceType.class, TypeRefactorHandler.instance());
   map.put(SourceField.class, FieldRefactorHandler.instance());
   map.put(SourceMethod.class, MethodRefactorHandler.instance());
 }
  /**
   * @see
   *     edu.buffalo.cse.green.RefactorHandler#handleMove(edu.buffalo.cse.green.editor.model.RootModel,
   *     org.eclipse.jdt.core.IJavaElement, org.eclipse.jdt.core.IJavaElement)
   */
  public void handleMove(RootModel root, E sourceElement, E targetElement) {
    try {
      List<IJavaElement> cus = root.getElementsOfKind(COMPILATION_UNIT);
      ICompilationUnit[] newCUs = targetElement.getCompilationUnits();

      for (IJavaElement cuElement : cus) {
        ICompilationUnit iCU = (ICompilationUnit) cuElement;
        if (JavaModelListener.sameElements(iCU.getAncestor(PACKAGE_FRAGMENT), sourceElement)) {
          for (ICompilationUnit cu : newCUs) {
            if (cu.getElementName().equals(iCU.getElementName())) {
              CompilationUnitRefactorHandler.instance().handleMove(root, iCU, cu);
            }
          }
        }
      }
    } catch (JavaModelException e) {
      e.printStackTrace();
    }
  }