PropertyDescriptor[] pds = bi.getPropertyDescriptors();
for (int i=0; i<pds.length; i++) {
PropertyDescriptor pd = pds[i];
String propertyName = pd.getName();
if (!propertyName.equals("class") && propertyName.toUpperCase().startsWith(pUpper)) { //$NON-NLS-1$
proposals.add(new CompletionProposal(
propertyName,
offset - subOffset + 1,
getContent().length()-1,
propertyName.length(),
null, propertyName + " - " + pd.getReadMethod().getReturnType().getName(), null, null)); //$NON-NLS-1$
}
}
for (int i=0; i<parentClass.getMethods().length; i++) {
Method m = parentClass.getMethods()[i];
String mName = m.getName();
if (m.getParameterTypes().length > 0 && mName.startsWith("get") && mName.toUpperCase().startsWith(pUpper)) { //$NON-NLS-1$
StringBuilder display = new StringBuilder();
display.append(mName);
display.append(LexicalConstants.LEFT_PARENTHESIS);
for (int j=0; j<m.getParameterTypes().length; j++) {
if (j > 0) display.append(", "); //$NON-NLS-1$
display.append(m.getParameterTypes()[j].getName());
}
display.append(") - ").append(m.getReturnType().getName()); //$NON-NLS-1$
String actual = mName + "()"; //$NON-NLS-1$
int tLength = actual.length();
if (m.getParameterTypes().length > 0) {
tLength--;
}
proposals.add(new CompletionProposal(actual,
offset - subOffset + 1, getContent().length()-1, tLength,
null, display.toString(), null, null));
}
}
return completionProposals(proposals);