Package org.eclipse.ltk.core.refactoring.resource

Examples of org.eclipse.ltk.core.refactoring.resource.RenameResourceChange


    try {
      DynamicValidationRefactoringChange result = new DynamicValidationRefactoringChange(createRefactoringDescriptor(), getProcessorName(), changeManager.getAllChanges());
      IResource resource = modelElement.getResource();
      if (resource instanceof IFile && willRenameCU((IFile) resource)) {
        result.add(
          new RenameResourceChange(
            resource.getFullPath(),
            resource.getFileExtension().isEmpty() ? getNewElementName() : getNewElementName() + "." + resource.getFileExtension() //$NON-NLS-1$
          )
        );
      }
View Full Code Here


        for (final ChangedFile f : changedFiles) {
            if (f.isNameChanged()) {
                final IPath p = f.getPath();
                final String s = f.getNewName();
                final RenameResourceChange rch = new RenameResourceChange(p, s);

                c.add(rch);
            }
        }
View Full Code Here

        apiTextFileChange.setTextType("xml");
        String javaFileName = getCompilationUnit().getElementName();
        String apiContent = apiTextFileChange.getCurrentContent(null);
        apiTextFileChange.setEdit(new ReplaceEdit(apiContent.indexOf(javaFileName), javaFileName.length(), getNewName() + ".java"));
        compositeChange.add(apiTextFileChange);
        compositeChange.add(new RenameResourceChange(oldApiFile.getFullPath(), getNewName() + ".api"));
      }
      for (int i = 0; i < oldWoFolders.length; i++) {
        IFolder oldWoFolder = oldWoFolders[i];
        if (oldWoFolder == null) {
          continue;
        }
        CompositeChange renameWoFolderChange = new CompositeChange("Rename " + oldWoFolder.getName());

        String[] renameExtensions = { ".html", ".wod", ".woo", ".xml", ".xhtml" };
        for (int j = 0; j < renameExtensions.length; j++) {
          IFile woFile = oldWoFolder.getFile(getOldName() + renameExtensions[j]);
          if (woFile.exists()) {
            renameWoFolderChange.add(new RenameResourceChange(woFile.getFullPath(), getNewName() + renameExtensions[j]));
          }
        }
        renameWoFolderChange.add(new RenameResourceChange(oldWoFolder.getFullPath(), getNewName() + ".wo"));
        compositeChange.add(renameWoFolderChange);

      }
      add(compositeChange);
      if (_renameClass) {
View Full Code Here

      String path = renamedElement.getProjectRelativePath().toString();
      String correspondingOldFXMLPath = path.substring( 0, path.length() - "fxgraph".length() ) + "fxml";
      IResource correspondingOldFXML = renamedElement.getProject().findMember( correspondingOldFXMLPath );
      if ( correspondingOldFXML.exists() ) {
        String newName = getArguments().getNewName().substring( 0, getArguments().getNewName().length() - "fxgraph".length() ) + "fxml";
        return new RenameResourceChange( correspondingOldFXML.getFullPath(), newName );
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ltk.core.refactoring.resource.RenameResourceChange

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.