Package org.eclipse.ltk.core.refactoring.participants

Examples of org.eclipse.ltk.core.refactoring.participants.RenameArguments


   
  }
 
  private static String computeNewDesignReference(ContentStoreRefactoringInfo info) {
    if (info.getArguments() instanceof RenameArguments) {
      RenameArguments arguments = (RenameArguments) info.getArguments();
      return arguments.getNewName();
    }
    return null;
  }
View Full Code Here


    return null;
  }

  private static IPath computeNewLinkTarget(DirlinkRefactoringInformation info) {
    if (info.getArguments() instanceof RenameArguments) {
      RenameArguments arguments = (RenameArguments) info.getArguments();
      IContainer currentDirLinkTarget = WGADesignStructureHelper.resolveDirLink(info.getFile());
     
      // compute newTargetPath up to renamed resource
      IPath newTarget = info.getElement().getLocation().removeLastSegments(1).append(arguments.getNewName());
     
      // build full target path
      int segments = currentDirLinkTarget.getLocation().matchingFirstSegments(newTarget);
      newTarget = newTarget.append(currentDirLinkTarget.getLocation().removeFirstSegments(segments + 1));
      return newTarget;
View Full Code Here

    private String changeTitle = null;

    @Override
    protected boolean initialize(Object element) {
        IPackageFragment pkgFragment = (IPackageFragment) element;
        RenameArguments args = getArguments();
        pkgFragments.put(pkgFragment, args);

        StringBuilder sb = new StringBuilder(256);
        sb.append("Bndtools: rename package '");
        sb.append(pkgFragment.getElementName());
        sb.append("' ");
        if (((RenamePackageProcessor) this.getProcessor()).getRenameSubpackages())
            sb.append("and subpackages ");
        sb.append("to '");
        sb.append(args.getNewName());
        sb.append("'");
        changeTitle = sb.toString();

        return true;
    }
View Full Code Here

                TextEdit rootEdit = fileChange.getEdit();

                /* loop over all renames to perform */
                for (Map.Entry<IPackageFragment,RenameArguments> entry : pkgFragments.entrySet()) {
                    IPackageFragment pkgFragment = entry.getKey();
                    RenameArguments arguments = entry.getValue();

                    final String oldName = pkgFragment.getElementName();
                    final String newName = arguments.getNewName();

                    Pattern pattern = Pattern.compile(
                    /* match start boundary */"(^|" + grammarSeparator + ")" +
                    /* match itself / package name */"(" + Pattern.quote(oldName) + ")" +
                    /* match end boundary */"(" + grammarSeparator + "|" + Pattern.quote(".*") + "|" + Pattern.quote("\\") + "|$)");
View Full Code Here

   *
   * @param pm
   * @return
   */
  private Change renamePackage(IProgressMonitor pm) {
    RenameArguments args = getArguments();
    final String newName = args.getNewName();
    if (newName.startsWith(CONTROLLERS) && packageName.startsWith(CONTROLLERS)) {
      PlayBuilder.packageRenamingRefactor(new Renaming(packageName, newName));
      // find out the
      String pathName = packageName.substring(CONTROLLERS.length());
      String tfolder = "app/japidviews/" + pathName.replace('.', '/');
View Full Code Here

  @Override
  protected RenameModifications computeRenameModifications()
      throws CoreException {
    RenameModifications result = new RenameModifications();
    if (modelElement instanceof ILocalVariable) {
      result.rename((ILocalVariable)modelElement, new RenameArguments(getNewElementName(), getUpdateReferences()));
    } else if (modelElement instanceof IField) {
      // TODO: add switching method in RenameModifications
      result.rename((IField)modelElement, new RenameArguments(getNewElementName(), getUpdateReferences()));
    }

    return result;
  }
View Full Code Here

  return null;
    }

    @Override
    public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
  RenameArguments args = getArguments();
  return new RenameFolderChangeHandler(orgName, args.getNewName());
    }
View Full Code Here

    }
  }

  @Override
  public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
    RenameArguments arguments = getArguments();
    String newName = arguments.getNewName();
    MultiTextEdit multiEdit = new MultiTextEdit();

    List<Integer> offsets = new ArrayList<Integer>();
    offsets.addAll(typePathVariableSourceRange.getOffsets());
    offsets.addAll(methodPathVariableSourceRange.getOffsets());
View Full Code Here

TOP

Related Classes of org.eclipse.ltk.core.refactoring.participants.RenameArguments

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.