/** * Creates a new refactoring descriptor for the specified input data. * * @param id * the unique id of the refactoring * @param project * the project name, or <code>null</code> * @param description * a description * @param comment * the comment, or <code>null</code> * @param arguments * the argument map * @param flags * the flags * @return the refactoring descriptor */ public RefactoringDescriptor createDescriptor(final String id, final String project, final String description, final String comment, final Map arguments, final int flags) { Assert.isNotNull(id); Assert.isNotNull(description); Assert.isNotNull(arguments); Assert.isLegal(flags >= RefactoringDescriptor.NONE); final RefactoringContribution contribution= getRefactoringContribution(id); if (contribution != null) return contribution.createDescriptor(id, project, description, comment, arguments, flags); return new DefaultRefactoringDescriptor(id, project, description, comment, arguments, flags); }
/** * Creates a new refactoring descriptor for the specified input data. * * @param id * the unique id of the refactoring * @param project * the project name, or <code>null</code> * @param description * a description * @param comment * the comment, or <code>null</code> * @param arguments * the argument map * @param flags * the flags * @return the refactoring descriptor * @throws IllegalArgumentException if the argument map contains invalid keys/values */ public RefactoringDescriptor createDescriptor(final String id, final String project, final String description, final String comment, final Map<String, String> arguments, final int flags) throws IllegalArgumentException { Assert.isNotNull(id); Assert.isNotNull(description); Assert.isNotNull(arguments); Assert.isLegal(flags >= RefactoringDescriptor.NONE); final RefactoringContribution contribution= getRefactoringContribution(id); if (contribution != null) return contribution.createDescriptor(id, project, description, comment, arguments, flags); return new DefaultRefactoringDescriptor(id, project, description, comment, arguments, flags); }
/** * Creates a new refactoring descriptor for the specified input data. * * @param id * the unique id of the refactoring * @param project * the project name, or <code>null</code> * @param description * a description * @param comment * the comment, or <code>null</code> * @param arguments * the argument map * @param flags * the flags * @return the refactoring descriptor * @throws IllegalArgumentException if the argument map contains invalid keys/values */ public RefactoringDescriptor createDescriptor(final String id, final String project, final String description, final String comment, final Map<String, String> arguments, final int flags) throws IllegalArgumentException { Assert.isNotNull(id); Assert.isNotNull(description); Assert.isNotNull(arguments); Assert.isLegal(flags >= RefactoringDescriptor.NONE); final RefactoringContribution contribution= getRefactoringContribution(id); if (contribution != null) return contribution.createDescriptor(id, project, description, comment, arguments, flags); return new DefaultRefactoringDescriptor(id, project, description, comment, arguments, flags); }
descriptor= contribution.createDescriptor(descriptor.getID(), name, descriptor.getDescription(), descriptor.getComment(), map, descriptor.getFlags()); } catch (IllegalArgumentException e) { status.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InitializableRefactoring_inacceptable_arguments));
descriptor= contribution.createDescriptor(descriptor.getID(), name, descriptor.getDescription(), descriptor.getComment(), map, descriptor.getFlags()); } catch (IllegalArgumentException e) { status.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InitializableRefactoring_inacceptable_arguments));
@Override public Refactoring createRefactoring(JavaRefactoringDescriptor javaDescriptor, RefactoringStatus status) throws CoreException { if (javaDescriptor instanceof RenameResourceDescriptor) { RenameResourceDescriptor descriptor= (RenameResourceDescriptor) javaDescriptor; // use the LTK RenameResourceDescriptor to create the refactoring RefactoringContribution newContribution= RefactoringCore.getRefactoringContribution(org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor.ID); if (newContribution != null) { RefactoringDescriptor ltkDescriptor= newContribution.createDescriptor(); if (ltkDescriptor instanceof org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor) { ((org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor) ltkDescriptor).setNewName(descriptor.getNewName()); ((org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor) ltkDescriptor).setResourcePath(descriptor.getResourcePath()); return ltkDescriptor.createRefactoring(status); } } status.addFatalError(DescriptorMessages.RenameResourceRefactoringContribution_error_cannot_access); } return null; }
RefactoringContribution contribution = RefactoringCore .getRefactoringContribution(MoveResourcesDescriptor.ID); MoveResourcesDescriptor descriptor = (MoveResourcesDescriptor) contribution.createDescriptor(); descriptor.setResourcesToMove(sources); descriptor.setDestination(target);
RenameJavaElementDescriptor descriptor= (RenameJavaElementDescriptor) RefactoringCore.getRefactoringContribution(contributionId).createDescriptor(); descriptor.setJavaElement(javaElement); descriptor.setNewName(newName);
RenameJavaElementDescriptor descriptor= (RenameJavaElementDescriptor) RefactoringCore.getRefactoringContribution(contributionId).createDescriptor(); descriptor.setJavaElement(javaElement); descriptor.setNewName(newName);
RenameJavaElementDescriptor descriptor= (RenameJavaElementDescriptor) RefactoringCore.getRefactoringContribution(contributionId).createDescriptor(); descriptor.setJavaElement(javaElement); descriptor.setNewName(newName);
final int flags= RefactoringDescriptor.STRUCTURAL_CHANGE; final RenameResourceDescriptor descriptor= (RenameResourceDescriptor) RefactoringCore.getRefactoringContribution(RenameResourceDescriptor.ID).createDescriptor(); descriptor.setProject(name); descriptor.setDescription(description);
final int flags= RefactoringDescriptor.STRUCTURAL_CHANGE; final RenameResourceDescriptor descriptor= (RenameResourceDescriptor) RefactoringCore.getRefactoringContribution(RenameResourceDescriptor.ID).createDescriptor(); descriptor.setProject(name); descriptor.setDescription(description);
final int flags= RefactoringDescriptor.STRUCTURAL_CHANGE; final RenameResourceDescriptor descriptor= (RenameResourceDescriptor) RefactoringCore.getRefactoringContribution(RenameResourceDescriptor.ID).createDescriptor(); descriptor.setProject(name); descriptor.setDescription(description);