/** * Creates and returns a parameter list of the given method or type proposal * suitable for display. The list does not include parentheses. The lower * bound of parameter types is returned. * <p> * Examples: * <pre> * "void method(int i, Strings)" -> "int i, String s" * "? extends Number method(java.lang.String s, ? super Number n)" -> "String s, Number n" * </pre> * </p> * * @param proposal the proposal to create the parameter list * for. Must be of kind {@link CompletionProposal#METHOD_REF} or * {@link CompletionProposal#TYPE_REF}. * @return the list of comma-separated parameters suitable for display */ public String createParameterList(CompletionProposal proposal) { int kind= proposal.getKind(); switch (kind) { case CompletionProposal.METHOD_REF: return appendUnboundedParameterList(new StringBuffer(), proposal).toString(); case CompletionProposal.TYPE_REF: return appendTypeParameterList(new StringBuffer(), proposal).toString(); default: Assert.isLegal(false); return null; // dummy } }
case CompletionProposal.TYPE_REF: case CompletionProposal.JAVADOC_TYPE_REF: paramList= appendTypeParameterList(new StyledString(), proposal).getString(); return org.eclipse.jdt.internal.core.manipulation.util.Strings.markJavaElementLabelLTR(paramList); case CompletionProposal.ANONYMOUS_CLASS_DECLARATION:
case CompletionProposal.TYPE_REF: case CompletionProposal.JAVADOC_TYPE_REF: paramList= appendTypeParameterList(new StyledString(), proposal).getString(); return Strings.markJavaElementLabelLTR(paramList); case CompletionProposal.ANONYMOUS_CLASS_DECLARATION: