当前位置: 首页>>代码示例>>Java>>正文


Java RefactoringCore.getHistoryService方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:liaoziyang,项目名称:ContentAssist,代码行数:12,代码来源:RefactoringExecutionManager.java

示例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);
    }
}
 
开发者ID:liaoziyang,项目名称:ContentAssist,代码行数:12,代码来源:RefactoringExecutionManager.java

示例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()]));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:46,代码来源:JarPackageReader.java


注:本文中的org.eclipse.ltk.core.refactoring.RefactoringCore.getHistoryService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。