1 package org.hibernate.eclipse.mapper.editors; 2 3 4 import java.util.ArrayList ; 5 import java.util.Iterator ; 6 import java.util.List ; 7 8 import org.eclipse.jdt.core.IJavaProject; 9 import org.eclipse.jface.text.contentassist.CompletionProposal; 10 import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest; 11 import org.hibernate.eclipse.mapper.extractor.HBMInfoExtractor; 12 13 public class CFGXMLContentAssistProcessor extends HibernateContentAssistProcessor { 14 15 HBMInfoExtractor extractor; 16 17 static String [] propertyNames; 18 19 public CFGXMLContentAssistProcessor(IJavaProject project) { 20 super(project); 21 22 extractor = new HBMInfoExtractor(); 23 24 } 25 26 27 protected List getAttributeValueProposals(String attributeName, String matchString, int offset, ContentAssistRequest contentAssistRequest) { 28 List types = this.extractor.findMatchingPropertyTypes(matchString); 29 30 List proposals = new ArrayList (types.size()); 31 for (Iterator iter = types.iterator(); iter.hasNext();) { 32 String element = (String ) iter.next(); 33 proposals.add(new CompletionProposal(element, offset, matchString.length(), element.length(), null, null, null, null)); 34 } 35 return proposals; 36 } 37 38 39 } 40 | Popular Tags |