Package org.eclipse.ltk.core.refactoring

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


        return new DeleteResourceChange(path, true);
    }

    @Override
    public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
        RefactoringStatus result = new RefactoringStatus();
        IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);

        URI location = file.getLocationURI();
        if (location == null) {
            result.addFatalError(String.format("The location for file %s is unknown", path));
            return result;
        }

        IFileInfo jFile = EFS.getStore(location).fetchInfo();
        if (jFile.exists()) {
            result.addFatalError(String.format("File %s already exists", path));
            return result;
        }
        return result;
    }
View Full Code Here


        // TODO
    }

    @Override
    public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
        RefactoringStatus status = new RefactoringStatus();
        // TODO
        return status;
    }
View Full Code Here

    private String className;
    private Pattern classPattern;
   
    @Override
    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
        RefactoringStatus status = new RefactoringStatus();
        if (file==null || file.isReadOnly())
            status.addFatalError("File don't exists or is read only");
        return status;
    }
View Full Code Here

    private String newName;
    private String currentName;

    @Override
    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
        RefactoringStatus status = new RefactoringStatus();
        if (file==null || file.isReadOnly())
            status.addFatalError("File don't exists or is read only");
        return status;
    }
View Full Code Here

    private String newName;
    private String currentName;

    @Override
    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
        RefactoringStatus status = new RefactoringStatus();
        try {
            IFile file = getSourceFieldIFile();
            if (file==null || file.isReadOnly())
                return status;
            drlFiles = drlProjectDetector.detect(file.getProject());
            String content = null;
            // if at least one file have a reference to the renamed field => apply refactoring
            for (IFile drlFile : drlFiles) {

                if ((content = readFile(drlFile))==null)
                    return null;

                Pattern pattern = Pattern.compile("(?<=:\\s)" + currentName + "|" + currentName + "(?=\\s=)");
                matcher = pattern.matcher(content);

                if (matcher.find()) {
                    RenameFieldProcessor renameFieldProcessor = (RenameFieldProcessor)processor;
                    if (!renameFieldProcessor.getRenameGetter())
                        status.addInfo("The getter must be also updated to refactor the DRL files.");
                    return status;
                }

            }
        } catch (CoreException e) {
View Full Code Here

    private String className;

    @Override
    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
        RefactoringStatus status = new RefactoringStatus();
        if (file==null || file.isReadOnly())
            status.addFatalError("File don't exists or is read only");
        return status;
    }
View Full Code Here

        this.replacement = replacement;
    }

    @Override
    public RefactoringStatus checkInitialConditions(IProgressMonitor pm) {
        RefactoringStatus result = new RefactoringStatus();
        try {
            if (cache.size() == 0) {
                IFolder folder = (IFolder) definitionFile.getParent();
   
                List<FormNode> formNodes = definition.getChildren(FormNode.class);
                for (FormNode formNode : formNodes) {
                    cache.add(new FormNodePresentation(folder, formNode, variableName, replacement));
                }
               
                List<State> stateNodes = definition.getChildren(State.class);
                for (State stateNode : stateNodes) {
                    cache.add(new TimedPresentation(stateNode, variableName, replacement));
                }
                List<WaitState> waitStateNodes = definition.getChildren(WaitState.class);
                for (WaitState waitStateNode : waitStateNodes) {
                    cache.add(new TimedPresentation(waitStateNode, variableName, replacement));
                }
   
                List<Action> actions = definition.getChildrenRecursive(Action.class);
                for (Action action : actions) {
                    cache.add(new DelegablePresentation(action, action.getDisplayName(), variableName, replacement));
                }
                List<Decision> decisions = definition.getChildrenRecursive(Decision.class);
                for (Decision decision : decisions) {
                    cache.add(new DelegablePresentation(decision, decision.getName(), variableName, replacement));
                }
                List<Subprocess> subprocesses = definition.getChildrenRecursive(Subprocess.class);
                for (Subprocess subprocess : subprocesses) {
                    cache.add(new SubprocessPresentation(subprocess, variableName, replacement));
                }
            }
        } catch (Exception e) {
            DesignerLogger.logErrorWithoutDialog(e.getMessage(), e);
            result.addFatalError(Messages.getString("UnhandledException"));
        }
        return result;
    }
View Full Code Here

        return result;
    }

    @Override
    public RefactoringStatus checkFinalConditions(IProgressMonitor pm) {
        return new RefactoringStatus();
    }
View Full Code Here

   * checkConditions(org.eclipse.core.runtime.IProgressMonitor,
   * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
   */
  @Override
  public RefactoringStatus checkConditions(final IProgressMonitor paramIProgressMonitor, final CheckConditionsContext paramCheckConditionsContext) throws OperationCanceledException {
    return new RefactoringStatus();
  }
View Full Code Here

   * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant# checkConditions(org.eclipse.core.runtime.IProgressMonitor,
   * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
   */
  @Override
  public RefactoringStatus checkConditions(final IProgressMonitor paramIProgressMonitor, final CheckConditionsContext paramCheckConditionsContext) throws OperationCanceledException {
    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.