本文整理匯總了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;
}