KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > schema > completion > DocumentationQuery


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /*
21  * DocumentationQuery.java
22  *
23  * Created on June 8, 2006, 9:56 PM
24  *
25  * To change this template, choose Tools | Template Manager
26  * and open the template in the editor.
27  */

28
29 package org.netbeans.modules.xml.schema.completion;
30
31 import java.net.URL JavaDoc;
32 import javax.swing.Action JavaDoc;
33 import javax.swing.text.Document JavaDoc;
34 import javax.swing.text.html.HTML JavaDoc;
35 import org.netbeans.modules.xml.axi.AXIComponent;
36 import org.netbeans.modules.xml.axi.AbstractAttribute;
37 import org.netbeans.modules.xml.axi.AbstractElement;
38 import org.netbeans.modules.xml.axi.Attribute;
39 import org.netbeans.spi.editor.completion.CompletionDocumentation;
40 import org.netbeans.spi.editor.completion.CompletionResultSet;
41 import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery;
42 import org.openide.util.NbBundle;
43 import org.netbeans.modules.xml.axi.Element;
44
45 /**
46  *
47  * @author Samaresh
48  */

49 public class DocumentationQuery extends AsyncCompletionQuery {
50     
51     private CompletionResultItem completionItem;
52     
53     DocumentationQuery(CompletionResultItem item) {
54         this.completionItem = item;
55     }
56     
57     protected void query(CompletionResultSet resultSet,
58             Document JavaDoc doc, int caretOffset) {
59         resultSet.setDocumentation(DocumentationItem.
60                 createDocumentationItem(completionItem));
61         resultSet.finish();
62     }
63         
64 }
65
Popular Tags