Package org.eclipse.ltk.core.refactoring

Examples of org.eclipse.ltk.core.refactoring.RefactoringStatus


    return getNewElementName();
  }

  @Override
  public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
    return new RefactoringStatus();
  }
View Full Code Here


          }
        }
      }
    }

    return new RefactoringStatus();
  }
View Full Code Here

  }

  @Override
  public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
      throws CoreException, OperationCanceledException {
    RefactoringStatus status = new RefactoringStatus();
   
    fSelectedSource = fSourceModule.getSource().substring(fSelectionStart,
        fSelectionStart + fSelectionLength);
    try {
      parsePHPCode();
     
      computeRequiredArgumentsForExtractedMethod();
      computeMethodReturnValues();
      computePassByReferenceArguments();
      computeReplacements();
     
    } catch(RefactoringStatusException exception){
      status.addFatalError(exception.getStatusMessage());
    }
   
    if(fMustExplicitReturnParameters.size() > 1) {
      status.addFatalError(RefactoringMessages.ExtractMethodInputPage_errorMethodCannotReturnMultipleVariables);
    }

    return status;
  }
View Full Code Here

  }

  @Override
  public RefactoringStatus checkFinalConditions(IProgressMonitor pm)
      throws CoreException, OperationCanceledException {
    RefactoringStatus status = new RefactoringStatus();
   
    if(!Checks.checkMethodName(fMethodName).isOK()) {
      status.addFatalError(Messages.format(RefactoringMessages.ExtractMethodInputPage_errorNoValidMethodName, fMethodName));
    }
   
    for(ParameterInfo parameter : fExtractedMethodParameters)
    {
      if(!Checks.checkTypeName(parameter.getParameterName()).isOK() ) {
        status.addFatalError(Messages.format(RefactoringMessages.ExtractMethodInputPage_errorNoValidParameterName, parameter.getParameterName()));
      }
    }
   
    if(fSelectedCodeContainsReturnStatement) {
      status.addFatalError(RefactoringMessages.ExtractMethodInputPage_errorContainsReturnStatement);
    }
   
    if(fReturnMultipleVariables == false && fExtractedMethodReturnValues.size() > 1) {
      status.addFatalError(RefactoringMessages.ExtractMethodInputPage_errorMultipleReturnValuesNotAllowed);
    }
   
    return status;
  }
View Full Code Here

            } else {
                positions = createPositionList((OtpErlangList) message.getParameters()
                        .get(GenFunReturnParameterName.dupsInFun));
            }
        }
        return new RefactoringStatus();
    }
View Full Code Here

            throws CoreException, OperationCanceledException {
        final IErlSelection sel = GlobalParameters.getWranglerSelection();
        final IRefactoringRpcMessage theMessage = run(sel);
        if (theMessage.isSuccessful()) {
            changedFiles = theMessage.getRefactoringChangeset();
            return new RefactoringStatus();
        }
        return RefactoringStatus.createFatalErrorStatus(theMessage.getMessageString());
    }
View Full Code Here

        if (!message.isSuccessful()) {
            return RefactoringStatus.createFatalErrorStatus(message.getMessageString());
        }
        fieldCount = message.getFieldCount();
        stateFuns = message.getStateFuns();
        return new RefactoringStatus();
    }
View Full Code Here

    @Override
    public RefactoringStatus checkInitialConditions(final IProgressMonitor pm)
            throws CoreException, OperationCanceledException {
        // since any selection contains a module, it can be applied
        return new RefactoringStatus();
    }
View Full Code Here

            public void doRefactoring() {
                final IErlSelection sel = GlobalParameters.getWranglerSelection();
                IRefactoringRpcMessage message = run(sel);
                if (message.isSuccessful()) {
                    changedFiles = message.getRefactoringChangeset();
                    status = new RefactoringStatus();
                } else if (message.getRefactoringState() == RefactoringState.QUESTION) {
                    renameTestMod = ask("Question", message.getMessageString());
                    message = runAlternative(sel);
                    if (message.getRefactoringState() == RefactoringState.OK) {
                        changedFiles = message.getRefactoringChangeset();
                        status = new RefactoringStatus();
                    } else {
                        status = RefactoringStatus.createFatalErrorStatus(message
                                .getMessageString());
                    }
                } else if (message.getRefactoringState() == RefactoringState.WARNING) {
                    renameTestMod = !ask("Warning", message.getMessageString());
                    if (!renameTestMod) {
                        message = runAlternative(sel);
                        if (message.getRefactoringState() == RefactoringState.OK) {
                            changedFiles = message.getRefactoringChangeset();
                            status = new RefactoringStatus();
                        } else {
                            status = RefactoringStatus.createFatalErrorStatus(message
                                    .getMessageString());
                        }
                    } else {
View Full Code Here

            selectedPositions = new ArrayList<IErlRange>();
        } else {
            return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
        }

        return new RefactoringStatus();
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ltk.core.refactoring.RefactoringStatus

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.