本文整理汇总了Java中com.intellij.codeInsight.intention.impl.ParameterClassMember类的典型用法代码示例。如果您正苦于以下问题:Java ParameterClassMember类的具体用法?Java ParameterClassMember怎么用?Java ParameterClassMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterClassMember类属于com.intellij.codeInsight.intention.impl包,在下文中一共展示了ParameterClassMember类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParams
import com.intellij.codeInsight.intention.impl.ParameterClassMember; //导入依赖的package包/类
@Nullable
@Override
protected PsiParameter[] getParams(PsiElement element) {
final PsiMethod method = PsiTreeUtil.getParentOfType(element, PsiMethod.class);
final PsiParameter[] parameters = method.getParameterList().getParameters();
final ParameterClassMember[] members = new ParameterClassMember[parameters.length];
for (int i = 0; i < members.length; i++) {
members[i] = new ParameterClassMember(parameters[i]);
}
final MemberChooser<ParameterClassMember> chooser = new MemberChooser<ParameterClassMember>(members, false, true, element.getProject());
chooser.selectElements(members);
chooser.setTitle("Choose " + (method.isConstructor() ? "Constructor" : "Method") + " Parameters");
chooser.show();
if (chooser.isOK()) {
final List<ParameterClassMember> elements = chooser.getSelectedElements();
if (elements != null) {
PsiParameter[] params = new PsiParameter[elements.size()];
for (int i = 0; i < params.length; i++) {
params[i] = elements.get(i).getParameter();
}
return params;
}
}
return null;
}