use of org.talend.sqlbuilder.dbstructure.nodes.TableFolderNode in project tdi-studio-se by Talend.
the class SQLCompletionProcessor method getProposalsByNode2.
/**
* DOC dev Comment method "getProposalsByNode2".
*
* @param documentOffset
* @param lastPart
* @param node
* @return
*/
//$NON-NLS-1$
@SuppressWarnings("unchecked")
private ICompletionProposal[] getProposalsByNode2(int documentOffset, String lastPart, INode node) {
String[] proposalsString = dictionary.matchTablePrefix(lastPart.toLowerCase());
ArrayList propList = new ArrayList();
for (int i = 0; i < proposalsString.length; i++) {
ArrayList ls = dictionary.getTableObjectList(proposalsString[i]);
for (int j = 0; j < ls.size(); j++) {
TableNode tbNode = (TableNode) ls.get(j);
Image tmpImage = null;
TableFolderNode totn = (TableFolderNode) tbNode.getParent();
INode catSchema = (INode) totn.getParent();
if (catSchema == node) {
if (tbNode.isView()) {
tmpImage = viewImage;
} else if (tbNode.isTable()) {
tmpImage = tableImage;
}
ICompletionProposal cmp = new ExtendedCompletionProposal(proposalsString[i], documentOffset - lastPart.length(), lastPart.length(), proposalsString[i].length(), tmpImage, proposalsString[i], tbNode);
propList.add(cmp);
}
}
}
ICompletionProposal[] res = new ICompletionProposal[propList.size()];
System.arraycopy(propList.toArray(), 0, res, 0, propList.size());
return res;
}
Aggregations