public AddTypeParameterProposal(ICompilationUnit targetCU, IBinding binding, CompilationUnit astRoot, String name, ITypeBinding[] bounds, int relevance) { super("", targetCU, null, relevance, JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC)); //$NON-NLS-1$ Assert.isTrue(binding != null && Bindings.isDeclarationBinding(binding)); Assert.isTrue(binding instanceof IMethodBinding || binding instanceof ITypeBinding); fBinding= binding; fAstRoot= astRoot; fTypeParamName= name; fBounds= bounds; if (binding instanceof IMethodBinding) { boolean isSameCU= fAstRoot.findDeclaringNode(binding) != null; String[] args= { fTypeParamName, ASTResolving.getMethodSignature((IMethodBinding) binding, isSameCU) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_method_label, args)); } else { String[] args= { fTypeParamName, ASTResolving.getTypeSignature((ITypeBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_type_label, args)); } }
public AddTypeParameterProposal(ICompilationUnit targetCU, IBinding binding, CompilationUnit astRoot, String name, ITypeBinding[] bounds, int relevance) { super("", targetCU, null, relevance, JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC)); //$NON-NLS-1$ Assert.isTrue(binding != null && Bindings.isDeclarationBinding(binding)); Assert.isTrue(binding instanceof IMethodBinding || binding instanceof ITypeBinding); fBinding= binding; fAstRoot= astRoot; fTypeParamName= name; fBounds= bounds; if (binding instanceof IMethodBinding) { String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), ASTResolving.getMethodSignature((IMethodBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_method_label, args)); } else { String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), ASTResolving.getTypeSignature((ITypeBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_type_label, args)); } }
String[] arg= new String[] { ASTResolving.getMethodSignature(methodBinding, false) }; String label; if (diff == 1) { changedTypes[i]= declParameterTypes[idx]; String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl, !cu.equals(targetCU)), getTypeNames(changedTypes) }; String label; if (methodDecl.isConstructor()) {
public AddTypeParameterProposal(ICompilationUnit targetCU, IBinding binding, CompilationUnit astRoot, String name, ITypeBinding[] bounds, int relevance) { super("", targetCU, null, relevance, JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC)); //$NON-NLS-1$ Assert.isTrue(binding != null && Bindings.isDeclarationBinding(binding)); Assert.isTrue(binding instanceof IMethodBinding || binding instanceof ITypeBinding); fBinding= binding; fAstRoot= astRoot; fTypeParamName= name; fBounds= bounds; if (binding instanceof IMethodBinding) { String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature((IMethodBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_method_label, args)); } else { String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature((ITypeBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_type_label, args)); } }
String[] arg= new String[] { ASTResolving.getMethodSignature(methodBinding, false) }; String label; if (diff == 1) { changedTypes[i]= declParameterTypes[idx]; String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl, !cu.equals(targetCU)), getTypeNames(changedTypes) }; String label; if (methodDecl.isConstructor()) {
String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodBinding) }; String label; if (diff == 1) { changedTypes[i]= declParameterTypes[idx]; String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl), getTypeNames(changedTypes) }; String label; if (methodDecl.isConstructor()) {
rewrite.remove((Expression) arguments.get(indexSkipped[i]), null); String[] arg= new String[] { ASTResolving.getMethodSignature(methodRef, false) }; String label; if (diff == 1) { changeTypes[i]= newType; String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl, isDifferentCU), getTypeNames(changeTypes) }; String label; if (methodDecl.isConstructor()) {
String[] arg= new String[] { ASTResolving.getMethodSignature(methodBinding) }; String label; if (diff == 1) { changedTypes[i]= declParameterTypes[idx]; String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl), getTypeNames(changedTypes) }; String label; if (methodDecl.isConstructor()) {
rewrite.remove((Expression) arguments.get(indexSkipped[i]), null); String[] arg= new String[] { ASTResolving.getMethodSignature(methodRef, false) }; String label; if (diff == 1) { changeTypes[i]= newType; String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl, isDifferentCU), getTypeNames(changeTypes) }; String label; if (methodDecl.isConstructor()) {
ITypeBinding[] parameterTypes= getParameterTypes(arguments); if (parameterTypes != null) { String sig= ASTResolving.getMethodSignature(methodName, parameterTypes, false);
rewrite.remove(arguments.get(indexSkipped[i]), null); String[] arg= new String[] { ASTResolving.getMethodSignature(methodRef) }; String label; if (diff == 1) { changeTypes[i]= newType; String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl), getTypeNames(changeTypes) }; String label; if (methodDecl.isConstructor()) {
rewrite.remove(arguments.get(indexSkipped[i]), null); String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodRef) }; String label; if (diff == 1) { changeTypes[i]= newType; String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl), getTypeNames(changeTypes) }; String label; if (methodDecl.isConstructor()) {
ITypeBinding[] parameterTypes= getParameterTypes(arguments); if (parameterTypes != null) { String sig= ASTResolving.getMethodSignature(methodName, parameterTypes, false);
String[] args= new String[] { ASTResolving.getMethodSignature( ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) }; String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconstructor_description, args); Image image= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
String[] args= new String[] { ASTResolving.getMethodSignature( ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) }; String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconstructor_description, args); Image image= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
String[] args= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature( org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) }; String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconstructor_description, args); Image image= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
String[] args= new String[] { ASTResolving.getMethodSignature( ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) }; String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconstructor_description, args); Image image= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
ITypeBinding[] parameterTypes= getParameterTypes(arguments); if (parameterTypes != null) { String sig= ASTResolving.getMethodSignature(methodName, parameterTypes, false); boolean is18OrHigher= JavaModelUtil.is18OrHigher(targetCU.getJavaProject());
ITypeBinding[] parameterTypes= getParameterTypes(arguments); if (parameterTypes != null) { String sig= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodName, parameterTypes, false); boolean is18OrHigher= JavaModelUtil.is18OrHigher(targetCU.getJavaProject()); boolean isSenderTypeAbstractClass = (senderDeclBinding.getModifiers() & Modifier.ABSTRACT) > 0;
AST ast= astRoot.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast); String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetomethod_description, ASTResolving.getMethodSignature(curr, false)); Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE); LinkedCorrectionProposal proposal= new LinkedCorrectionProposal(label, cu, rewrite, 8, image);