KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > data > HQLFieldsProvider


1 /*
2  * Copyright (C) 2006 JasperSoft http://www.jaspersoft.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed WITHOUT ANY WARRANTY; and without the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
15  * or write to:
16  *
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330,
19  * Boston, MA USA 02111-1307
20  *
21  *
22  * SQLFieldsProvider.java
23  *
24  * Created on December 7, 2006, 9:22 AM
25  *
26  * To change this template, choose Tools | Template Manager
27  * and open the template in the editor.
28  */

29
30 package it.businesslogic.ireport.data;
31
32 import it.businesslogic.ireport.FieldsProvider;
33 import it.businesslogic.ireport.FieldsProviderEditor;
34 import it.businesslogic.ireport.IReportConnection;
35 import it.businesslogic.ireport.gui.MainFrame;
36 import it.businesslogic.ireport.gui.ReportQueryDialog;
37 import java.awt.Component JavaDoc;
38 import java.util.Map JavaDoc;
39 import net.sf.jasperreports.engine.JRDataset;
40 import net.sf.jasperreports.engine.JRException;
41 import net.sf.jasperreports.engine.JRField;
42
43 /**
44  *
45  * @author gtoffoli
46  */

47 public class HQLFieldsProvider implements FieldsProvider {
48     
49     private BeanInspectorPanel bip = null;
50     
51     /** Creates a new instance of SQLFieldsProvider */
52     public HQLFieldsProvider() {
53     }
54
55     /**
56      * Returns true if the provider supports the {@link #getFields(IReportConnection,JRDataset,Map) getFields}
57      * operation. By returning true in this method the data source provider indicates
58      * that it is able to introspect the data source and discover the available fields.
59      *
60      * @return true if the getFields() operation is supported.
61      */

62     public boolean supportsGetFieldsOperation() {
63         return false;
64     }
65     
66     public JRField[] getFields(IReportConnection con, JRDataset reportDataset, Map JavaDoc parameters) throws JRException, UnsupportedOperationException JavaDoc {
67         return null;
68     }
69
70     public boolean supportsAutomaticQueryExecution() {
71         return true;
72     }
73
74     public boolean hasQueryDesigner() {
75         return false;
76     }
77
78     public boolean hasEditorComponent() {
79         return true;
80     }
81
82     public String JavaDoc designQuery(IReportConnection con, String JavaDoc query, ReportQueryDialog reportQueryDialog) throws JRException, UnsupportedOperationException JavaDoc {
83         return null;
84     }
85
86     public FieldsProviderEditor getEditorComponent(ReportQueryDialog reportQueryDialog) {
87         
88         if (bip == null)
89         {
90             bip = new BeanInspectorPanel();
91             bip.setReportQueryDialog(reportQueryDialog);
92             if (reportQueryDialog != null)
93             {
94                 bip.setJTableFields( reportQueryDialog.getFieldsTable() );
95             }
96         }
97         return bip;
98     }
99     
100 }
101
Popular Tags