public String createMoveRefactoringSession(IJavaElement[] javaElements) throws JavaModelException, RefactoringException {
  IReorgPolicy.IMovePolicy policy=ReorgPolicyFactory.createMovePolicy(new IResource[0],javaElements);
  if (policy.canEnable()) {
    JavaMoveProcessor processor=new JavaMoveProcessor(policy);
    processor.setReorgQueries(new NullReorgQueries());
    processor.setCreateTargetQueries(null);
    Refactoring refactoring=new MoveRefactoring(processor);
    MoveRefactoringSession session=new MoveRefactoringSession(refactoring,processor);
    final String id=String.format("move-%s",sessionId.getAndIncrement());
    sessions.put(id,session);
    return id;
  }
 else {
    throw new RefactoringException("Can't create move refactoring session.");
  }
}

public String createMoveRefactoringSession ( IJavaElement [ ] javaElements ) throws JavaModelException , RefactoringException { IReorgPolicy . IMovePolicy policy = ReorgPolicyFactory . createMovePolicy ( new IResource [ 0 ] , javaElements ) ; if ( policy . canEnable ( ) ) { JavaMoveProcessor processor = new JavaMoveProcessor ( policy ) ; processor . setReorgQueries ( new NullReorgQueries ( ) ) ; processor . setCreateTargetQueries ( null ) ; Refactoring refactoring = new MoveRefactoring ( processor ) ; MoveRefactoringSession session = new MoveRefactoringSession ( refactoring , processor ) ; final String id = String . format ( "move-%s" , sessionId . getAndIncrement ( ) ) ; sessions . put ( id , session ) ; return id ; } else { throw new RefactoringException ( "Can't create move refactoring session." ) ; } }
create move refactoring session .
