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


Java ResourceUtil.getFiles方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil.getFiles方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceUtil.getFiles方法的具体用法?Java ResourceUtil.getFiles怎么用?Java ResourceUtil.getFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil的用法示例。


在下文中一共展示了ResourceUtil.getFiles方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkInitialConditions

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
/**
 * Checks if the refactoring can be activated. Activation typically means, if a corresponding menu
 * entry can be added to the UI.
 *
 * @param pm a progress monitor to report progress during activation checking.
 * @return the refactoring status describing the result of the activation check.
 * @throws CoreException if checking fails
 */
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
  RefactoringStatus result = new RefactoringStatus();
  pm.beginTask("", 100); // $NON-NLS-1$

  if (fSelectionStart < 0 || fSelectionLength == 0) return mergeTextSelectionStatus(result);

  IFile[] changedFiles = ResourceUtil.getFiles(new ICompilationUnit[] {fCUnit});
  result.merge(Checks.validateModifiesFiles(changedFiles, getValidationContext()));
  if (result.hasFatalError()) return result;
  result.merge(
      ResourceChangeChecker.checkFilesToBeChanged(changedFiles, new SubProgressMonitor(pm, 1)));

  if (fRoot == null) {
    fRoot =
        RefactoringASTParser.parseWithASTProvider(fCUnit, true, new SubProgressMonitor(pm, 99));
  }
  fImportRewriter = StubUtility.createImportRewrite(fRoot, true);

  fAST = fRoot.getAST();
  fRoot.accept(createVisitor());

  fSelectionStart = fAnalyzer.getSelection().getOffset();
  fSelectionLength = fAnalyzer.getSelection().getLength();

  result.merge(fAnalyzer.checkInitialConditions(fImportRewriter));
  if (result.hasFatalError()) return result;
  if (fVisibility == -1) {
    setVisibility(Modifier.PRIVATE);
  }
  initializeParameterInfos();
  initializeUsedNames();
  initializeDuplicates();
  initializeDestinations();
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:45,代码来源:ExtractMethodRefactoring.java

示例2: checkInitialConditions

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
/**
 * Checks if the refactoring can be activated. Activation typically means, if a
 * corresponding menu entry can be added to the UI.
 *
 * @param pm a progress monitor to report progress during activation checking.
 * @return the refactoring status describing the result of the activation check.
 * @throws CoreException if checking fails
 */
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
	RefactoringStatus result= new RefactoringStatus();
	pm.beginTask("", 100); //$NON-NLS-1$

	if (fSelectionStart < 0 || fSelectionLength == 0)
		return mergeTextSelectionStatus(result);

	IFile[] changedFiles= ResourceUtil.getFiles(new ICompilationUnit[]{fCUnit});
	result.merge(Checks.validateModifiesFiles(changedFiles, getValidationContext()));
	if (result.hasFatalError())
		return result;
	result.merge(ResourceChangeChecker.checkFilesToBeChanged(changedFiles, new SubProgressMonitor(pm, 1)));

	if (fRoot == null) {
		fRoot= RefactoringASTParser.parseWithASTProvider(fCUnit, true, new SubProgressMonitor(pm, 99));
	}
	fImportRewriter= StubUtility.createImportRewrite(fRoot, true);

	fAST= fRoot.getAST();
	fRoot.accept(createVisitor());

	fSelectionStart= fAnalyzer.getSelection().getOffset();
	fSelectionLength= fAnalyzer.getSelection().getLength();

	result.merge(fAnalyzer.checkInitialConditions(fImportRewriter));
	if (result.hasFatalError())
		return result;
	if (fVisibility == -1) {
		setVisibility(Modifier.PRIVATE);
	}
	initializeParameterInfos();
	initializeUsedNames();
	initializeDuplicates();
	initializeDestinations();
	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:46,代码来源:ExtractMethodRefactoring.java

示例3: checkFinalConditions

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
@Override
public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException {
	pm.beginTask(RefactoringCoreMessages.DeleteRefactoring_1, 1);
	try{
		fWasCanceled= false;
		RefactoringStatus result= new RefactoringStatus();

		recalculateElementsToDelete();

		checkDirtyCompilationUnits(result);
		checkDirtyResources(result);
		fDeleteModifications= new DeleteModifications();
		fDeleteModifications.delete(fResources);
		fDeleteModifications.delete(fJavaElements);
		List<IResource> packageDeletes= fDeleteModifications.postProcess();

		TextChangeManager manager= new TextChangeManager();
		fDeleteChange= DeleteChangeCreator.createDeleteChange(manager, fResources, fJavaElements, getProcessorName(), packageDeletes);

		ResourceChangeChecker checker= (ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class);
		IResourceChangeDescriptionFactory deltaFactory= checker.getDeltaFactory();
		fDeleteModifications.buildDelta(deltaFactory);
		IFile[] files= ResourceUtil.getFiles(manager.getAllCompilationUnits());
		for (int i= 0; i < files.length; i++) {
			deltaFactory.change(files[i]);
		}
		return result;
	} catch (OperationCanceledException e) {
		fWasCanceled= true;
		throw e;
	} finally{
		pm.done();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:35,代码来源:JavaDeleteProcessor.java

示例4: getAllFilesToModify

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
private IFile[] getAllFilesToModify() {
  return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits());
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:ChangeSignatureProcessor.java

示例5: getChangedFiles

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
@Override
protected IFile[] getChangedFiles() {
  return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits());
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:RenameFieldProcessor.java

示例6: getChangedFiles

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
@Override
protected IFile[] getChangedFiles() throws CoreException {
  return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits());
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:RenameMethodProcessor.java

示例7: getAllFilesToModify

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
private IFile[] getAllFilesToModify() {
  List<ICompilationUnit> cus = new ArrayList<ICompilationUnit>();
  cus.addAll(Arrays.asList(fTextChangeManager.getAllCompilationUnits()));
  return ResourceUtil.getFiles(cus.toArray(new ICompilationUnit[cus.size()]));
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:IntroduceIndirectionRefactoring.java

示例8: getAllFilesToModify

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
private IFile[] getAllFilesToModify(){
	return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:ChangeSignatureProcessor.java

示例9: getChangedFiles

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
@Override
protected IFile[] getChangedFiles() {
	return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:RenameFieldProcessor.java

示例10: getChangedFiles

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
@Override
protected IFile[] getChangedFiles() throws CoreException {
	return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:RenameMethodProcessor.java

示例11: getAllFilesToModify

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
private IFile[] getAllFilesToModify() {
	List<ICompilationUnit> cus= new ArrayList<ICompilationUnit>();
	cus.addAll(Arrays.asList(fTextChangeManager.getAllCompilationUnits()));
	return ResourceUtil.getFiles(cus.toArray(new ICompilationUnit[cus.size()]));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:6,代码来源:IntroduceIndirectionRefactoring.java

示例12: computeModifiedFiles

import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; //导入方法依赖的package包/类
/**
 * Computes the files that are being modified by this refactoring.
 *
 * @param source
 *            the source compilation unit
 * @param target
 *            the target compilation unit
 * @return the modified files
 */
protected IFile[] computeModifiedFiles(final ICompilationUnit source, final ICompilationUnit target) {
	Assert.isNotNull(source);
	Assert.isNotNull(target);
	if (source.equals(target))
		return ResourceUtil.getFiles(new ICompilationUnit[] { source });
	return ResourceUtil.getFiles(new ICompilationUnit[] { source, target });
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:MoveInstanceMethodProcessor.java


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