KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > eclipse > mapper > editors > CFGXMLContentAssistProcessor


1 package org.hibernate.eclipse.mapper.editors;
2
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.Iterator JavaDoc;
6 import java.util.List JavaDoc;
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 JavaDoc[] propertyNames;
18     
19     public CFGXMLContentAssistProcessor(IJavaProject project) {
20         super(project);
21     
22         extractor = new HBMInfoExtractor();
23         
24     }
25
26     
27     protected List JavaDoc getAttributeValueProposals(String JavaDoc attributeName, String JavaDoc matchString, int offset, ContentAssistRequest contentAssistRequest) {
28         List JavaDoc types = this.extractor.findMatchingPropertyTypes(matchString);
29         
30         List JavaDoc proposals = new ArrayList JavaDoc(types.size());
31         for (Iterator JavaDoc iter = types.iterator(); iter.hasNext();) {
32             String JavaDoc element = (String JavaDoc) 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