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


Java RefactoringParticipant类代码示例

本文整理汇总了Java中org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant的典型用法代码示例。如果您正苦于以下问题:Java RefactoringParticipant类的具体用法?Java RefactoringParticipant怎么用?Java RefactoringParticipant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RefactoringParticipant类属于org.eclipse.ltk.core.refactoring.participants包,在下文中一共展示了RefactoringParticipant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
@Override
public RefactoringParticipant[] loadParticipants(
    RefactoringStatus status,
    RefactoringProcessor owner,
    String[] natures,
    SharableParticipants shared) {
  List<RefactoringParticipant> result = new ArrayList<RefactoringParticipant>();
  for (int i = 0; i < fRename.size(); i++) {
    result.addAll(
        Arrays.asList(
            ParticipantManager.loadRenameParticipants(
                status,
                owner,
                fRename.get(i),
                (RenameArguments) fRenameArguments.get(i),
                fParticipantDescriptorFilter.get(i),
                natures,
                shared)));
  }
  result.addAll(
      Arrays.asList(getResourceModifications().getParticipants(status, owner, natures, shared)));
  return result.toArray(new RefactoringParticipant[result.size()]);
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:RenameModifications.java

示例2: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
@Override
public RefactoringParticipant[] loadParticipants(
    RefactoringStatus status,
    RefactoringProcessor owner,
    String[] natures,
    SharableParticipants shared) {
  List<RefactoringParticipant> result = new ArrayList<RefactoringParticipant>();
  for (int i = 0; i < fMoves.size(); i++) {
    result.addAll(
        Arrays.asList(
            ParticipantManager.loadMoveParticipants(
                status,
                owner,
                fMoves.get(i),
                (MoveArguments) fMoveArguments.get(i),
                fParticipantDescriptorFilter.get(i),
                natures,
                shared)));
  }
  result.addAll(
      Arrays.asList(getResourceModifications().getParticipants(status, owner, natures, shared)));
  return result.toArray(new RefactoringParticipant[result.size()]);
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:MoveModifications.java

示例3: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
@Override
public RefactoringParticipant[] loadParticipants(
    RefactoringStatus status,
    RefactoringProcessor owner,
    String[] natures,
    SharableParticipants shared) {
  List<RefactoringParticipant> result = new ArrayList<RefactoringParticipant>();
  for (int i = 0; i < fCopies.size(); i++) {
    result.addAll(
        Arrays.asList(
            ParticipantManager.loadCopyParticipants(
                status,
                owner,
                fCopies.get(i),
                (CopyArguments) fCopyArguments.get(i),
                fParticipantDescriptorFilter.get(i),
                natures,
                shared)));
  }
  result.addAll(
      Arrays.asList(getResourceModifications().getParticipants(status, owner, natures, shared)));
  return result.toArray(new RefactoringParticipant[result.size()]);
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:CopyModifications.java

示例4: loadChangeMethodSignatureParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
/**
 * Loads the change method signature participants for the given element.
 *
 * @param status a refactoring status to report status if problems occurred while loading the
 *     participants
 * @param processor the processor that will own the participants
 * @param method the method to be changed
 * @param arguments the change method signature arguments describing the change
 * @param filter a participant filter to exclude certain participants, or <code>null</code> if no
 *     filtering is desired
 * @param affectedNatures an array of project natures affected by the refactoring
 * @param shared a list of shared participants
 * @return an array of change method signature participants
 */
public static ChangeMethodSignatureParticipant[] loadChangeMethodSignatureParticipants(
    RefactoringStatus status,
    RefactoringProcessor processor,
    IMethod method,
    ChangeMethodSignatureArguments arguments,
    IParticipantDescriptorFilter filter,
    String[] affectedNatures,
    SharableParticipants shared) {
  RefactoringParticipant[] participants =
      fgMethodSignatureInstance.getParticipants(
          status, processor, method, arguments, filter, affectedNatures, shared);
  ChangeMethodSignatureParticipant[] result =
      new ChangeMethodSignatureParticipant[participants.length];
  System.arraycopy(participants, 0, result, 0, participants.length);
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:31,代码来源:JavaParticipantManager.java

示例5: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public RefactoringParticipant[] loadParticipants(
    RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
  final ArrayList result = new ArrayList();
  if (!isApplicable()) {
    return new RefactoringParticipant[0];
  }

  final String[] affectedNatures = ResourceProcessors.computeAffectedNatures(fResources);
  final DeleteArguments deleteArguments = new DeleteArguments(fDeleteContents);
  for (int i = 0; i < fResources.length; i++) {
    result.addAll(
        Arrays.asList(
            ParticipantManager.loadDeleteParticipants(
                status,
                this,
                fResources[i],
                deleteArguments,
                affectedNatures,
                sharedParticipants)));
  }

  return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:DeleteResourcesProcessor.java

示例6: testCreateChange

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public void testCreateChange() {
  GWTRefactoringSupport support = new DummyGWTRefactoringSupport();
  support.setUpdateReferences(true);

  IType refactorTestType = refactorTestClass.getCompilationUnit().findPrimaryType();
  support.setOldElement(refactorTestType);

  RefactoringParticipant participant = new DummyRefactoringParticipant();
  IRefactoringChangeFactory changeFactory = new DefaultChangeFactory();
  CompositeChange change = support.createChange(participant, changeFactory);

  // Return value should contain one child change
  Change[] changeChildren = change.getChildren();
  assertEquals(1, changeChildren.length);

  // Root edit should contain two child edits, one for each JSNI ref
  TextChange childChange = (TextChange) changeChildren[0];
  TextEdit changeEdit = childChange.getEdit();
  assertEquals(2, changeEdit.getChildrenSize());
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:21,代码来源:GWTRefactoringSupportTest.java

示例7: testCreateChangeWithoutEdits

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public void testCreateChangeWithoutEdits() throws JavaModelException {
  GWTRefactoringSupport support = new DummyGWTRefactoringSupport();
  support.setUpdateReferences(true);

  IType entryPointType = getTestProject().findType(
      AbstractGWTPluginTestCase.TEST_PROJECT_SRC_PACKAGE,
      AbstractGWTPluginTestCase.TEST_PROJECT_ENTRY_POINT);
  support.setOldElement(entryPointType);

  // There are no references to the entry point class, so the Change returned
  // should be null
  RefactoringParticipant participant = new DummyRefactoringParticipant();
  IRefactoringChangeFactory changeFactory = new DefaultChangeFactory();
  CompositeChange change = support.createChange(participant, changeFactory);
  assertNull(change);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:17,代码来源:GWTRefactoringSupportTest.java

示例8: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
@Override
public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants)
		throws CoreException {
	RenameParticipant[] renameParticipants = ParticipantManager.loadRenameParticipants(status, this,
			renameElementContext, new RenameArguments(newName, true),
			new String[] { XtextProjectHelper.NATURE_ID }, sharedParticipants);
	return renameParticipants;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:RenameElementProcessor.java

示例9: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
@Override
public RefactoringParticipant[] loadParticipants(
    RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException {
  String[] affectedNatures = JavaProcessors.computeAffectedNatures(fMethod);
  return JavaParticipantManager.loadChangeMethodSignatureParticipants(
      status,
      this,
      fMethod,
      getParticipantArguments(),
      null,
      affectedNatures,
      sharedParticipants);
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:ChangeSignatureProcessor.java

示例10: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public final RefactoringParticipant[] loadParticipants(
    RefactoringStatus status,
    RefactoringProcessor processor,
    String[] natures,
    SharableParticipants shared)
    throws CoreException {
  RefactoringModifications modifications = getModifications();
  if (modifications != null) {
    return modifications.loadParticipants(status, processor, natures, shared);
  } else {
    return new RefactoringParticipant[0];
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:ReorgPolicyFactory.java

示例11: loadParticipants

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public RefactoringParticipant[] loadParticipants(
    RefactoringStatus status, SharableParticipants shared) throws CoreException {
  String[] affectedNatures = ResourceProcessors.computeAffectedNatures(fResourcesToMove);

  List result = new ArrayList();
  for (int i = 0; i < fResourcesToMove.length; i++) {
    MoveParticipant[] participants =
        ParticipantManager.loadMoveParticipants(
            status, this, fResourcesToMove[i], fMoveArguments, null, affectedNatures, shared);
    result.addAll(Arrays.asList(participants));
  }
  return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:MoveResourcesProcessor.java

示例12: createParticipant

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public RefactoringParticipant createParticipant() throws CoreException {
  //		return (RefactoringParticipant)fConfigurationElement.createExecutableExtension(CLASS);
  if (participant != null) {
    try {
      return participant.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
      e.printStackTrace();
      return null;
    }
  } else {
    return null;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:ParticipantDescriptor.java

示例13: getParticipantsFor

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public static Set<Class<? extends RefactoringParticipant>> getParticipantsFor(String id) {
  Set<Class<? extends RefactoringParticipant>> classes = registry.get(id);
  if (classes == null) {
    classes = new HashSet<>(0);
  }
  return classes;
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:CheRefactoringParticipantsRegistry.java

示例14: testCreateChangeWithoutUpdateReferences

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
public void testCreateChangeWithoutUpdateReferences() {
  GWTRefactoringSupport support = new DummyGWTRefactoringSupport();
  support.setUpdateReferences(false);

  // With update references turned off, Change returned should be null
  RefactoringParticipant participant = new DummyRefactoringParticipant();
  IRefactoringChangeFactory changeFactory = new DefaultChangeFactory();
  Change change = support.createChange(participant, changeFactory);
  assertNull(change);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:11,代码来源:GWTRefactoringSupportTest.java

示例15: mergeParticipantTextChanges

import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant; //导入依赖的package包/类
/**
 * Attempts to merge all the text changes rooted at <code>rootChange</code>
 * into the refactoring's shared text change for each file (via
 * {@link RefactoringParticipant#getTextChange(Object)}). Any text changes
 * that are merged will be removed from their parents.
 * 
 * 
 * @param participant the participant which will be used to get the shared
 *          text change for each file
 * @param rootChange the root of the change tree that will be searched for
 *          text changes to merge into the shared text changes
 * @return true if the entire tree was merged and the root change is no longer
 *         valid
 */
public static boolean mergeParticipantTextChanges(
    final RefactoringParticipant participant, Change rootChange) {
  final List<Change> dupChanges = new ArrayList<Change>();
  ChangeUtilities.acceptOnChange(rootChange, new ChangeVisitor() {
    public void visit(Change change) {
      if (change instanceof TextEditBasedChange) {
        TextEditBasedChange textChange = (TextEditBasedChange) change;
        TextChange existingTextChange = participant.getTextChange(textChange.getModifiedElement());
        if (existingTextChange == null) {
          return;
        }

        // Merge all changes from text change into the existing
        TextEditUtilities.moveTextEditGroupsIntoChange(
            textChange.getChangeGroups(), existingTextChange);

        dupChanges.add(textChange);
      }
    }
  });

  for (Change dupChange : dupChanges) {
    ChangeUtilities.removeChange(dupChange,
        (CompositeChange) dupChange.getParent());
  }

  return dupChanges.contains(rootChange);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:43,代码来源:ChangeUtilities.java


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