• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RefactoringChangeDescriptor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor monitor) throws CoreException,
		OperationCanceledException {
	try {
		monitor.beginTask(
				Messages.ConvertConstantsToEnumRefactoring_CreatingChange,
				1);
		final Collection changes = this.changes.values();
		final CompositeChange change = new CompositeChange(this.getName(),
				(Change[]) changes.toArray(new Change[changes.size()])) {
			public ChangeDescriptor getDescriptor() {
				String project = ConvertConstantsToEnumRefactoring.this
						.getJavaProject().getElementName();
				String description = Messages.ConvertConstantsToEnum_Name;
				Map arguments = new HashMap();
				return new RefactoringChangeDescriptor(
						new ConvertConstantsToEnumDescriptor(project,
								description, new String(), arguments));
			}
		};
		return change;
	} finally {
		monitor.done();
	}
}
 
开发者ID:ponder-lab,项目名称:Constants-to-Enum-Eclipse-Plugin,代码行数:25,代码来源:ConvertConstantsToEnumRefactoring.java


示例2: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException {
  pm.beginTask("", fResourcesToMove.length); // $NON-NLS-1$
  try {
    CompositeChange compositeChange = new CompositeChange(getMoveDescription());
    compositeChange.markAsSynthetic();

    RefactoringChangeDescriptor descriptor = new RefactoringChangeDescriptor(createDescriptor());
    for (int i = 0; i < fResourcesToMove.length; i++) {
      MoveResourceChange moveChange = new MoveResourceChange(fResourcesToMove[i], fDestination);
      moveChange.setDescriptor(descriptor);
      compositeChange.add(moveChange);
    }
    return compositeChange;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:MoveResourcesProcessor.java


示例3: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
  pm.beginTask(RefactoringCoreMessages.DeleteResourcesProcessor_create_task, fResources.length);
  try {
    RefactoringChangeDescriptor descriptor = new RefactoringChangeDescriptor(createDescriptor());
    CompositeChange change =
        new CompositeChange(RefactoringCoreMessages.DeleteResourcesProcessor_change_name);
    change.markAsSynthetic();
    for (int i = 0; i < fResources.length; i++) {
      pm.worked(1);
      DeleteResourceChange dc =
          new DeleteResourceChange(fResources[i].getFullPath(), true, fDeleteContents);
      dc.setDescriptor(descriptor);
      change.add(dc);
    }
    return change;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:DeleteResourcesProcessor.java


示例4: getDescriptor

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public final ChangeDescriptor getDescriptor() {
	final Map<String, String> arguments= new HashMap<String, String>();
	final int length= fFiles.length + fFolders.length + fCus.length;
	final String description= length == 1 ? getDescriptionSingular() : getDescriptionPlural();
	final IProject resource= getSingleProject();
	final String project= resource != null ? resource.getName() : null;
	final String header= length == 1 ? Messages.format(getHeaderPatternSingular(), new String[] { getSingleElementName(), getDestinationLabel() }) : Messages.format(
			getHeaderPatternPlural(),
			new String[] { String.valueOf(length), getDestinationLabel() });
	int flags= JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;
	final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(project, this, header);
	arguments.put(ATTRIBUTE_POLICY, getPolicyId());
	arguments.put(ATTRIBUTE_FILES, new Integer(fFiles.length).toString());
	for (int offset= 0; offset < fFiles.length; offset++)
		arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + 1), JavaRefactoringDescriptorUtil.resourceToHandle(project, fFiles[offset]));
	arguments.put(ATTRIBUTE_FOLDERS, new Integer(fFolders.length).toString());
	for (int offset= 0; offset < fFolders.length; offset++)
		arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + fFiles.length + 1), JavaRefactoringDescriptorUtil.resourceToHandle(project, fFolders[offset]));
	arguments.put(ATTRIBUTE_UNITS, new Integer(fCus.length).toString());
	for (int offset= 0; offset < fCus.length; offset++)
		arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + fFolders.length + fFiles.length + 1), JavaRefactoringDescriptorUtil.elementToHandle(project, fCus[offset]));
	arguments.putAll(getRefactoringArguments(project));
	final JavaRefactoringDescriptor descriptor= createRefactoringDescriptor(comment, arguments, description, project, flags);
	return new RefactoringChangeDescriptor(descriptor);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:ReorgPolicyFactory.java


示例5: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor monitor) throws CoreException {
  try {
    monitor.beginTask(RefactoringCoreMessages.RenameTypeProcessor_creating_changes, 1);

    RenameJavaElementDescriptor descriptor = createRefactoringDescriptor();
    fChange.setDescriptor(new RefactoringChangeDescriptor(descriptor));
    return fChange;
  } finally {
    monitor.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:RenameLocalVariableProcessor.java


示例6: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException {
  pm.beginTask("", 1); // $NON-NLS-1$
  try {
    if (fFieldName.length() == 0) {
      fFieldName = getInitialFieldName();
    }

    ASTRewrite rewrite = ASTRewrite.create(fCompilationUnitNode.getAST());
    if (fInitializeIn == INITIALIZE_IN_METHOD && tempHasInitializer())
      addLocalDeclarationSplit(rewrite);
    else addLocalDeclarationRemoval(rewrite);
    if (fInitializeIn == INITIALIZE_IN_CONSTRUCTOR) addInitializersToConstructors(rewrite);
    addTempRenames(rewrite);
    addFieldDeclaration(rewrite);

    CompilationUnitChange result =
        new CompilationUnitChange(
            RefactoringCoreMessages.PromoteTempToFieldRefactoring_name, fCu);
    result.setDescriptor(new RefactoringChangeDescriptor(getRefactoringDescriptor()));
    TextEdit resultingEdits = rewrite.rewriteAST();
    TextChangeCompatibility.addTextEdit(
        result, RefactoringCoreMessages.PromoteTempToFieldRefactoring_editName, resultingEdits);
    return result;

  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:PromoteTempToFieldRefactoring.java


示例7: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException {
  try {
    pm.beginTask(RefactoringCoreMessages.ExtractTempRefactoring_checking_preconditions, 1);

    ExtractLocalDescriptor descriptor = createRefactoringDescriptor();
    fChange.setDescriptor(new RefactoringChangeDescriptor(descriptor));
    return fChange;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:ExtractTempRefactoring.java


示例8: getDescriptor

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public final ChangeDescriptor getDescriptor() {
  final Map<String, String> arguments = new HashMap<String, String>();
  final int length = fPackageFragmentRoots.length;
  final String description = length == 1 ? getDescriptionSingular() : getDescriptionPlural();
  final IProject resource = getSingleProject();
  final String project = resource != null ? resource.getName() : null;
  final String header =
      length == 1
          ? Messages.format(
              getHeaderPatternSingular(),
              new String[] {fPackageFragmentRoots[0].getElementName(), getDestinationLabel()})
          : Messages.format(
              getHeaderPatternPlural(),
              new String[] {String.valueOf(length), getDestinationLabel()});
  int flags = RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;
  final JDTRefactoringDescriptorComment comment =
      new JDTRefactoringDescriptorComment(project, this, header);
  arguments.put(ATTRIBUTE_POLICY, getPolicyId());
  arguments.put(ATTRIBUTE_ROOTS, new Integer(fPackageFragmentRoots.length).toString());
  for (int offset = 0; offset < fPackageFragmentRoots.length; offset++)
    arguments.put(
        JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + 1),
        JavaRefactoringDescriptorUtil.elementToHandle(project, fPackageFragmentRoots[offset]));
  arguments.putAll(getRefactoringArguments(project));
  final JavaRefactoringDescriptor descriptor =
      createRefactoringDescriptor(comment, arguments, description, project, flags);
  return new RefactoringChangeDescriptor(descriptor);
}
 
开发者ID:eclipse,项目名称:che,代码行数:29,代码来源:ReorgPolicyFactory.java


示例9: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException {
  pm.beginTask("", 1); // $NON-NLS-1$
  try {
    RenameResourceChange change =
        new RenameResourceChange(fResource.getFullPath(), getNewResourceName());
    change.setDescriptor(new RefactoringChangeDescriptor(createDescriptor()));
    return change;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:RenameResourceProcessor.java


示例10: getRefactoringDescriptor

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
private RefactoringDescriptor getRefactoringDescriptor(IUndoableOperation operation) {
  if (operation instanceof TriggeredOperations) {
    operation = ((TriggeredOperations) operation).getTriggeringOperation();
  }
  if (operation instanceof UndoableOperation2ChangeAdapter) {
    ChangeDescriptor changeDescriptor =
        ((UndoableOperation2ChangeAdapter) operation).getChangeDescriptor();
    if (changeDescriptor instanceof RefactoringChangeDescriptor) {
      return ((RefactoringChangeDescriptor) changeDescriptor).getRefactoringDescriptor();
    }
  }
  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:RefactoringHistoryService.java


示例11: getDescriptor

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public final ChangeDescriptor getDescriptor() {
  final ChangeDescriptor descriptor = super.getDescriptor();
  if (descriptor == null) {
    return new RefactoringChangeDescriptor(
        new UnknownRefactoringDescriptor(getChildren()[0].getName()));
  }
  return descriptor;
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:RefactoringDescriptorChange.java


示例12: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException {
    pm.beginTask("", 1); //$NON-NLS-1$
    try {
        RenameKeyChange change = new RenameKeyChange(fMessageBundleGroup,
                getNewKeyTreeNode(), fNewResourceName, fRenameChildKeys);
        change.setDescriptor(new RefactoringChangeDescriptor(
                createDescriptor()));
        return change;
    } finally {
        pm.done();
    }
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:RenameKeyProcessor.java


示例13: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException {
	pm.beginTask("", 1); //$NON-NLS-1$
	try {
		RenameKeyChange change = new RenameKeyChange(fMessageBundleGroup, getNewKeyTreeNode(), fNewResourceName, fRenameChildKeys);
		change.setDescriptor(new RefactoringChangeDescriptor(createDescriptor()));
		return change;
	} finally {
		pm.done();
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:11,代码来源:RenameKeyProcessor.java


示例14: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
	pm.beginTask("", 1); //$NON-NLS-1$
	try {
		DynamicValidationStateChange result= new DynamicValidationStateChange(RefactoringCoreMessages.InferTypeArgumentsRefactoring_name, fChangeManager.getAllChanges()) {

			@Override
			public final ChangeDescriptor getDescriptor() {
				final Map<String, String> arguments= new HashMap<String, String>();
				final IJavaProject project= getSingleProject();
				final String description= RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description;
				final String header= project != null ? Messages.format(RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description_project, BasicElementLabels.getJavaElementName(project.getElementName())) : RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description;
				final String name= project != null ? project.getElementName() : null;
				final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(name, this, header);
				final String[] settings= new String[fElements.length];
				for (int index= 0; index < settings.length; index++)
					settings[index]= JavaElementLabels.getTextLabel(fElements[index], JavaElementLabels.ALL_FULLY_QUALIFIED);
				comment.addSetting(JDTRefactoringDescriptorComment.createCompositeSetting(RefactoringCoreMessages.InferTypeArgumentsRefactoring_original_elements, settings));
				if (fAssumeCloneReturnsSameType)
					comment.addSetting(RefactoringCoreMessages.InferTypeArgumentsRefactoring_assume_clone);
				if (fLeaveUnconstrainedRaw)
					comment.addSetting(RefactoringCoreMessages.InferTypeArgumentsRefactoring_leave_unconstrained);
				final InferTypeArgumentsDescriptor descriptor= RefactoringSignatureDescriptorFactory.createInferTypeArgumentsDescriptor(name, description, comment.asString(), arguments, RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
				for (int index= 0; index < fElements.length; index++)
					arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1), JavaRefactoringDescriptorUtil.elementToHandle(name, fElements[index]));
				arguments.put(ATTRIBUTE_CLONE, Boolean.valueOf(fAssumeCloneReturnsSameType).toString());
				arguments.put(ATTRIBUTE_LEAVE, Boolean.valueOf(fLeaveUnconstrainedRaw).toString());
				return new RefactoringChangeDescriptor(descriptor);
			}
		};
		return result;
	} finally {
		pm.done();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:36,代码来源:InferTypeArgumentsRefactoring.java


示例15: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor monitor) throws CoreException {
	try {
		monitor.beginTask(RefactoringCoreMessages.RenameTypeProcessor_creating_changes, 1);

		RenameJavaElementDescriptor descriptor= createRefactoringDescriptor();
		fChange.setDescriptor(new RefactoringChangeDescriptor(descriptor));
		return fChange;
	} finally {
		monitor.done();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:RenameLocalVariableProcessor.java


示例16: createRefactoringDescriptor

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
private RefactoringChangeDescriptor createRefactoringDescriptor() {
	final ITypeBinding binding= fAnonymousInnerClassNode.resolveBinding();
	final String[] labels= new String[] { BindingLabelProvider.getBindingLabel(binding, JavaElementLabels.ALL_FULLY_QUALIFIED), BindingLabelProvider.getBindingLabel(binding.getDeclaringMethod(), JavaElementLabels.ALL_FULLY_QUALIFIED)};
	final Map<String, String> arguments= new HashMap<String, String>();
	final String projectName= fCu.getJavaProject().getElementName();
	final int flags= RefactoringDescriptor.STRUCTURAL_CHANGE | JavaRefactoringDescriptor.JAR_REFACTORING | JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;
	final String description= RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_descriptor_description_short;
	final String header= Messages.format(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_descriptor_description, labels);
	final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(projectName, this, header);
	comment.addSetting(Messages.format(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_original_pattern, BindingLabelProvider.getBindingLabel(binding, JavaElementLabels.ALL_FULLY_QUALIFIED)));
	comment.addSetting(Messages.format(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_class_name_pattern, BasicElementLabels.getJavaElementName(fClassName)));
	String visibility= JdtFlags.getVisibilityString(fVisibility);
	if (visibility.length() == 0)
		visibility= RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_default_visibility;
	comment.addSetting(Messages.format(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_visibility_pattern, visibility));
	if (fDeclareFinal && fDeclareStatic)
		comment.addSetting(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_declare_final_static);
	else if (fDeclareFinal)
		comment.addSetting(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_declare_final);
	else if (fDeclareStatic)
		comment.addSetting(RefactoringCoreMessages.ConvertAnonymousToNestedRefactoring_declare_static);
	arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT, JavaRefactoringDescriptorUtil.elementToHandle(projectName, fCu));
	arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME, fClassName);
	arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION, new Integer(fSelectionStart).toString() + ' ' + new Integer(fSelectionLength).toString());
	arguments.put(ATTRIBUTE_FINAL, Boolean.valueOf(fDeclareFinal).toString());
	arguments.put(ATTRIBUTE_STATIC, Boolean.valueOf(fDeclareStatic).toString());
	arguments.put(ATTRIBUTE_VISIBILITY, new Integer(fVisibility).toString());

	ConvertAnonymousDescriptor descriptor= RefactoringSignatureDescriptorFactory.createConvertAnonymousDescriptor(projectName, description, comment.asString(), arguments, flags);
	return new RefactoringChangeDescriptor(descriptor);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:ConvertAnonymousToNestedRefactoring.java


示例17: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException {
	try {
		pm.beginTask(RefactoringCoreMessages.InlineTempRefactoring_preview, 2);
		final Map<String, String> arguments= new HashMap<String, String>();
		String project= null;
		IJavaProject javaProject= fCu.getJavaProject();
		if (javaProject != null)
			project= javaProject.getElementName();

		final IVariableBinding binding= getVariableDeclaration().resolveBinding();
		String text= null;
		final IMethodBinding method= binding.getDeclaringMethod();
		if (method != null)
			text= BindingLabelProvider.getBindingLabel(method, JavaElementLabels.ALL_FULLY_QUALIFIED);
		else
			text= BasicElementLabels.getJavaElementName('{' + JavaElementLabels.ELLIPSIS_STRING + '}');
		final String description= Messages.format(RefactoringCoreMessages.InlineTempRefactoring_descriptor_description_short, BasicElementLabels.getJavaElementName(binding.getName()));
		final String header= Messages.format(RefactoringCoreMessages.InlineTempRefactoring_descriptor_description, new String[] { BindingLabelProvider.getBindingLabel(binding, JavaElementLabels.ALL_FULLY_QUALIFIED), text});
		final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(project, this, header);
		comment.addSetting(Messages.format(RefactoringCoreMessages.InlineTempRefactoring_original_pattern, BindingLabelProvider.getBindingLabel(binding, JavaElementLabels.ALL_FULLY_QUALIFIED)));
		final InlineLocalVariableDescriptor descriptor= RefactoringSignatureDescriptorFactory.createInlineLocalVariableDescriptor(project, description, comment.asString(), arguments, RefactoringDescriptor.NONE);
		arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT, JavaRefactoringDescriptorUtil.elementToHandle(project, fCu));
		arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION, String.valueOf(fSelectionStart) + ' ' + String.valueOf(fSelectionLength));

		CompilationUnitRewrite cuRewrite= new CompilationUnitRewrite(fCu, fASTRoot);

		inlineTemp(cuRewrite);
		removeTemp(cuRewrite);

		final CompilationUnitChange result= cuRewrite.createChange(RefactoringCoreMessages.InlineTempRefactoring_inline, false, new SubProgressMonitor(pm, 1));
		result.setDescriptor(new RefactoringChangeDescriptor(descriptor));
		return result;
	} finally {
		pm.done();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:38,代码来源:InlineTempRefactoring.java


示例18: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException {
   	pm.beginTask("", 1); //$NON-NLS-1$
   	try {
   		if (fFieldName.length() == 0) {
   			fFieldName= getInitialFieldName();
   		}

   		ASTRewrite rewrite= ASTRewrite.create(fCompilationUnitNode.getAST());
   		if (fInitializeIn == INITIALIZE_IN_METHOD && tempHasInitializer())
   			addLocalDeclarationSplit(rewrite);
		else
			addLocalDeclarationRemoval(rewrite);
   		if (fInitializeIn == INITIALIZE_IN_CONSTRUCTOR)
   			addInitializersToConstructors(rewrite);
  			addTempRenames(rewrite);
   		addFieldDeclaration(rewrite);

		CompilationUnitChange result= new CompilationUnitChange(RefactoringCoreMessages.PromoteTempToFieldRefactoring_name, fCu);
		result.setDescriptor(new RefactoringChangeDescriptor(getRefactoringDescriptor()));
		TextEdit resultingEdits= rewrite.rewriteAST();
		TextChangeCompatibility.addTextEdit(result, RefactoringCoreMessages.PromoteTempToFieldRefactoring_editName, resultingEdits);
		return result;

   	} finally {
   		pm.done();
   	}
   }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:PromoteTempToFieldRefactoring.java


示例19: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException {
	try {
		pm.beginTask(RefactoringCoreMessages.ExtractTempRefactoring_checking_preconditions, 1);

		ExtractLocalDescriptor descriptor= createRefactoringDescriptor();
		fChange.setDescriptor(new RefactoringChangeDescriptor(descriptor));
		return fChange;
	} finally {
		pm.done();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:ExtractTempRefactoring.java


示例20: createChange

import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
  pm.beginTask("", 1); // $NON-NLS-1$
  try {
    DynamicValidationStateChange result =
        new DynamicValidationStateChange(
            RefactoringCoreMessages.InferTypeArgumentsRefactoring_name,
            fChangeManager.getAllChanges()) {

          @Override
          public final ChangeDescriptor getDescriptor() {
            final Map<String, String> arguments = new HashMap<String, String>();
            final IJavaProject project = getSingleProject();
            final String description =
                RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description;
            final String header =
                project != null
                    ? Messages.format(
                        RefactoringCoreMessages
                            .InferTypeArgumentsRefactoring_descriptor_description_project,
                        BasicElementLabels.getJavaElementName(project.getElementName()))
                    : RefactoringCoreMessages
                        .InferTypeArgumentsRefactoring_descriptor_description;
            final String name = project != null ? project.getElementName() : null;
            final JDTRefactoringDescriptorComment comment =
                new JDTRefactoringDescriptorComment(name, this, header);
            final String[] settings = new String[fElements.length];
            for (int index = 0; index < settings.length; index++)
              settings[index] =
                  JavaElementLabels.getTextLabel(
                      fElements[index], JavaElementLabels.ALL_FULLY_QUALIFIED);
            comment.addSetting(
                JDTRefactoringDescriptorComment.createCompositeSetting(
                    RefactoringCoreMessages.InferTypeArgumentsRefactoring_original_elements,
                    settings));
            if (fAssumeCloneReturnsSameType)
              comment.addSetting(
                  RefactoringCoreMessages.InferTypeArgumentsRefactoring_assume_clone);
            if (fLeaveUnconstrainedRaw)
              comment.addSetting(
                  RefactoringCoreMessages.InferTypeArgumentsRefactoring_leave_unconstrained);
            final InferTypeArgumentsDescriptor descriptor =
                RefactoringSignatureDescriptorFactory.createInferTypeArgumentsDescriptor(
                    name,
                    description,
                    comment.asString(),
                    arguments,
                    RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
            for (int index = 0; index < fElements.length; index++)
              arguments.put(
                  JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1),
                  JavaRefactoringDescriptorUtil.elementToHandle(name, fElements[index]));
            arguments.put(
                ATTRIBUTE_CLONE, Boolean.valueOf(fAssumeCloneReturnsSameType).toString());
            arguments.put(ATTRIBUTE_LEAVE, Boolean.valueOf(fLeaveUnconstrainedRaw).toString());
            return new RefactoringChangeDescriptor(descriptor);
          }
        };
    return result;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:64,代码来源:InferTypeArgumentsRefactoring.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CommandGatewayFactoryBean类代码示例发布时间:2022-05-23
下一篇:
Java KeyValueSource类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap