本文整理汇总了Java中org.eclipse.ltk.core.refactoring.RefactoringCore.getHistoryService方法的典型用法代码示例。如果您正苦于以下问题:Java RefactoringCore.getHistoryService方法的具体用法?Java RefactoringCore.getHistoryService怎么用?Java RefactoringCore.getHistoryService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ltk.core.refactoring.RefactoringCore
的用法示例。
在下文中一共展示了RefactoringCore.getHistoryService方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import org.eclipse.ltk.core.refactoring.RefactoringCore; //导入方法依赖的package包/类
/**
* Registers a refactoring execution manager with the refactoring history service.
* @param rm the refactoring execution manager
*/
public static void register(RefactoringExecutionManager rm) {
IRefactoringHistoryService rs = RefactoringCore.getHistoryService();
if (rs != null) {
rs.addExecutionListener(rm);
// rs.addHistoryListener(rm);
}
}
示例2: unregister
import org.eclipse.ltk.core.refactoring.RefactoringCore; //导入方法依赖的package包/类
/**
* Unregisters a refactoring execution manager with the refactoring history service.
* @param rm the refactoring execution manager
*/
public static void unregister(RefactoringExecutionManager rm) {
IRefactoringHistoryService rs = RefactoringCore.getHistoryService();
if (rs != null) {
rs.removeExecutionListener(rm);
// rs.removeHistoryListener(rm);
}
}
示例3: xmlReadRefactoring
import org.eclipse.ltk.core.refactoring.RefactoringCore; //导入方法依赖的package包/类
private void xmlReadRefactoring(JarPackageData jarPackage, Element element) throws java.io.IOException {
if (element.getNodeName().equals("storedRefactorings")) { //$NON-NLS-1$
jarPackage.setExportStructuralOnly(getBooleanAttribute(element, "structuralOnly", jarPackage.isExportStructuralOnly())); //$NON-NLS-1$
jarPackage.setDeprecationAware(getBooleanAttribute(element, "deprecationInfo", jarPackage.isDeprecationAware())); //$NON-NLS-1$
List<IAdaptable> elements= new ArrayList<IAdaptable>();
int count= 1;
String value= element.getAttribute("project" + count); //$NON-NLS-1$
while (value != null && !"".equals(value)) { //$NON-NLS-1$
final IProject project= ResourcesPlugin.getWorkspace().getRoot().getProject(value);
if (project.exists())
elements.add(project);
count++;
value= element.getAttribute("project" + count); //$NON-NLS-1$
}
jarPackage.setRefactoringProjects(elements.toArray(new IProject[elements.size()]));
elements.clear();
count= 1;
IRefactoringHistoryService service= RefactoringCore.getHistoryService();
try {
service.connect();
value= element.getAttribute("refactoring" + count); //$NON-NLS-1$
while (value != null && !"".equals(value)) { //$NON-NLS-1$
final ByteArrayInputStream stream= new ByteArrayInputStream(value.getBytes("UTF-8")); //$NON-NLS-1$
try {
final RefactoringHistory history= service.readRefactoringHistory(stream, RefactoringDescriptor.NONE);
if (history != null) {
final RefactoringDescriptorProxy[] descriptors= history.getDescriptors();
if (descriptors.length > 0) {
for (int index= 0; index < descriptors.length; index++) {
elements.add(descriptors[index]);
}
}
}
} catch (CoreException exception) {
JavaPlugin.log(exception);
}
count++;
value= element.getAttribute("refactoring" + count); //$NON-NLS-1$
}
} finally {
service.disconnect();
}
jarPackage.setRefactoringDescriptors(elements.toArray(new RefactoringDescriptorProxy[elements.size()]));
}
}