本文整理汇总了Java中org.eclipse.jdt.core.refactoring.descriptors.ChangeMethodSignatureDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ChangeMethodSignatureDescriptor类的具体用法?Java ChangeMethodSignatureDescriptor怎么用?Java ChangeMethodSignatureDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChangeMethodSignatureDescriptor类属于org.eclipse.jdt.core.refactoring.descriptors包,在下文中一共展示了ChangeMethodSignatureDescriptor类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRefactoringDescriptor
import org.eclipse.jdt.core.refactoring.descriptors.ChangeMethodSignatureDescriptor; //导入依赖的package包/类
private IntroduceParameterDescriptor getRefactoringDescriptor() {
ChangeMethodSignatureDescriptor extended= (ChangeMethodSignatureDescriptor) fChangeSignatureProcessor.createDescriptor();
RefactoringContribution contribution= RefactoringCore.getRefactoringContribution(IJavaRefactorings.CHANGE_METHOD_SIGNATURE);
Map<String, String> argumentsMap= contribution.retrieveArgumentMap(extended);
final Map<String, String> arguments= new HashMap<String, String>();
arguments.put(ATTRIBUTE_ARGUMENT, fParameter.getNewName());
arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_SELECTION, new Integer(fSelectionStart).toString() + " " + new Integer(fSelectionLength).toString()); //$NON-NLS-1$
arguments.putAll(argumentsMap);
String signature= fChangeSignatureProcessor.getMethodName();
try {
signature= fChangeSignatureProcessor.getOldMethodSignature();
} catch (JavaModelException exception) {
JavaPlugin.log(exception);
}
final String description= Messages.format(RefactoringCoreMessages.IntroduceParameterRefactoring_descriptor_description_short, BasicElementLabels.getJavaElementName(fChangeSignatureProcessor.getMethod().getElementName()));
final String header= Messages.format(RefactoringCoreMessages.IntroduceParameterRefactoring_descriptor_description, new String[] { BasicElementLabels.getJavaElementName(fParameter.getNewName()), signature, BasicElementLabels.getJavaCodeString(ASTNodes.asString(fSelectedExpression))});
final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(extended.getProject(), this, header);
comment.addSetting(Messages.format(RefactoringCoreMessages.IntroduceParameterRefactoring_original_pattern, JavaElementLabels.getTextLabel(fChangeSignatureProcessor.getMethod(),
JavaElementLabels.ALL_FULLY_QUALIFIED)));
comment.addSetting(Messages.format(RefactoringCoreMessages.IntroduceParameterRefactoring_expression_pattern, BasicElementLabels.getJavaCodeString(ASTNodes.asString(fSelectedExpression))));
comment.addSetting(Messages.format(RefactoringCoreMessages.IntroduceParameterRefactoring_parameter_pattern, BasicElementLabels.getJavaElementName(getAddedParameterInfo().getNewName())));
return RefactoringSignatureDescriptorFactory.createIntroduceParameterDescriptor(extended.getProject(), description, comment.asString(), arguments, extended.getFlags());
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:IntroduceParameterRefactoring.java
示例2: createChangeMethodSignatureDescriptor
import org.eclipse.jdt.core.refactoring.descriptors.ChangeMethodSignatureDescriptor; //导入依赖的package包/类
public static ChangeMethodSignatureDescriptor createChangeMethodSignatureDescriptor() {
return new ChangeMethodSignatureDescriptor();
}