use of org.eclipse.ltk.core.refactoring.participants.RenameRefactoring in project mdw-designer by CenturyLinkCloud.
the class WorkflowProjectManager method renameRemoteProject.
public static void renameRemoteProject(WorkflowProject workflowProject, String newName) {
if (!workflowProject.isRemote())
throw new RuntimeException("Can only rename remote projects");
try {
deRegisterProject(workflowProject);
IProject workflowSourceProject = workflowProject.getSourceProject();
if (workflowSourceProject != null && workflowSourceProject.exists()) {
RenameResourceProcessor renameProc = new RenameResourceProcessor(workflowSourceProject);
renameProc.setNewResourceName(newName);
RenameRefactoring refactoring = new RenameRefactoring(renameProc);
refactoring.checkAllConditions(new NullProgressMonitor());
Change change = refactoring.createChange(new NullProgressMonitor());
change.perform(new NullProgressMonitor());
}
workflowProject.setSourceProjectName(newName);
registerProject(workflowProject);
} catch (CoreException ex) {
// fail silently since older remote projects don't have physical
// counterparts
PluginMessages.log(ex);
}
}
Aggregations