use of org.eclipse.jface.text.contentassist.CompletionProposal in project jbosstools-hibernate by jbosstools.
the class TableNameHandler method attributeCompletionProposals.
public ICompletionProposal[] attributeCompletionProposals(IJavaProject javaProject, Node node, String attributeName, String start, int offset) {
List tables = new ArrayList();
HibernateNature nature = HibernateNature.getHibernateNature(javaProject);
if (nature != null) {
tables = nature.getMatchingTables(start);
}
List proposals = new ArrayList();
for (Iterator iter = tables.iterator(); iter.hasNext(); ) {
ITable element = (ITable) iter.next();
proposals.add(new CompletionProposal(element.getName(), offset, start.length(), element.getName().length(), null, null, null, null));
}
return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
}
Aggregations