svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.swing / org.gvsig.fmap.dal.swing.impl / src / main / java / org / gvsig / fmap / dal / swing / impl / DefaultDALSwingLibrary.java @ 44644
History | View | Annotate | Download (5.1 KB)
1 | 42104 | jjdelcerro | /* gvSIG. Desktop Geographic Information System.
|
---|---|---|---|
2 | *
|
||
3 | * Copyright ? 2007-2014 gvSIG Association
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
18 | * MA 02110-1301, USA.
|
||
19 | *
|
||
20 | * For any additional information, do not hesitate to contact us
|
||
21 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
22 | */
|
||
23 | 42112 | jjdelcerro | package org.gvsig.fmap.dal.swing.impl; |
24 | 42104 | jjdelcerro | |
25 | 44531 | omartinez | import org.gvsig.featureform.swing.impl.DefaultJFeaturesForm; |
26 | 44128 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.ImageByteArray.JDynFormFieldImageByteArrayFactory; |
27 | import org.gvsig.featureform.swing.impl.dynformfield.ImageFile.JDynFormFieldImageFileFactory; |
||
28 | 44253 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.ImageURL.JDynFormFieldImageURLFactory; |
29 | 44262 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.features.JDynFormFieldRelatedFeaturesFactory; |
30 | 44128 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.linkedentity.JDynFormFieldFeatureLinkFactory; |
31 | import org.gvsig.featureform.swing.impl.dynformfield.linkedentities.JDynFormFieldFeaturesTableLinkFactory; |
||
32 | 44253 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.linkforeingkey.JDynFormFieldForeingKeyFactory; |
33 | import org.gvsig.featureform.swing.impl.dynformfield.selectableforeingkey.JDynFormFieldSelectableForeingKeyFactory; |
||
34 | 42775 | jjdelcerro | import org.gvsig.fmap.dal.impl.DefaultEditingNotificationManager; |
35 | 42112 | jjdelcerro | import org.gvsig.fmap.dal.swing.DALSwingLibrary; |
36 | import org.gvsig.fmap.dal.swing.DALSwingLocator; |
||
37 | 43208 | jjdelcerro | import org.gvsig.fmap.dal.swing.dataStoreParameters.DataStoreParametersPanelManager; |
38 | import org.gvsig.fmap.dal.swing.impl.dataStoreParameters.DataStoreDynObjectParametersPanelFactory; |
||
39 | import org.gvsig.fmap.dal.swing.impl.dataStoreParameters.DefaultDataStoreParametersPanelManager; |
||
40 | 42776 | jjdelcerro | import org.gvsig.fmap.dal.swing.impl.dynobjectutils.CreateComboModelFromTable; |
41 | 43983 | jjdelcerro | import org.gvsig.fmap.dal.swing.impl.expressionevaluator.FeatureStoreElementFactory; |
42 | 44533 | jjdelcerro | import org.gvsig.fmap.dal.swing.impl.jdbc.JDBCConnectionPickerController; |
43 | 44644 | jjdelcerro | import org.gvsig.fmap.dal.swing.impl.orderpanel.DefaultFeatureStoreOrderPanel; |
44 | 44259 | jjdelcerro | import org.gvsig.fmap.dal.swing.impl.searchpanel.DefaultSearchPanel; |
45 | 42776 | jjdelcerro | import org.gvsig.tools.ToolsLocator; |
46 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
47 | 42104 | jjdelcerro | import org.gvsig.tools.library.AbstractLibrary; |
48 | import org.gvsig.tools.library.LibraryException; |
||
49 | 43983 | jjdelcerro | import org.slf4j.Logger; |
50 | import org.slf4j.LoggerFactory; |
||
51 | 42104 | jjdelcerro | |
52 | |||
53 | /**
|
||
54 | * @author fdiaz
|
||
55 | *
|
||
56 | */
|
||
57 | 42112 | jjdelcerro | public class DefaultDALSwingLibrary extends AbstractLibrary{ |
58 | 42104 | jjdelcerro | |
59 | 43983 | jjdelcerro | private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDALSwingLibrary.class); |
60 | 42104 | jjdelcerro | |
61 | 42775 | jjdelcerro | @Override
|
62 | 42104 | jjdelcerro | public void doRegistration() { |
63 | 42112 | jjdelcerro | registerAsImplementationOf(DALSwingLibrary.class); |
64 | 42104 | jjdelcerro | } |
65 | |||
66 | |||
67 | 42775 | jjdelcerro | @Override
|
68 | 42104 | jjdelcerro | protected void doInitialize() throws LibraryException { |
69 | 42112 | jjdelcerro | DALSwingLocator.registerSwingManager(DefaultDataSwingManager.class); |
70 | 42775 | jjdelcerro | DALSwingLocator.registerEditingNotificationManager(DefaultEditingNotificationManager.class); |
71 | 43208 | jjdelcerro | |
72 | DALSwingLocator.registerDataStoreParametersPanelManager(DefaultDataStoreParametersPanelManager.class); |
||
73 | 42104 | jjdelcerro | } |
74 | |||
75 | |||
76 | 42775 | jjdelcerro | @Override
|
77 | 42104 | jjdelcerro | protected void doPostInitialize() throws LibraryException { |
78 | 43983 | jjdelcerro | try {
|
79 | 44253 | jjdelcerro | JDynFormFieldFeatureLinkFactory.selfRegister(); |
80 | JDynFormFieldFeaturesTableLinkFactory.selfRegister(); |
||
81 | 44259 | jjdelcerro | |
82 | 44253 | jjdelcerro | JDynFormFieldImageByteArrayFactory.selfRegister(); |
83 | JDynFormFieldImageFileFactory.selfRegister(); |
||
84 | JDynFormFieldImageURLFactory.selfRegister(); |
||
85 | JDynFormFieldForeingKeyFactory.selfRegister(); |
||
86 | JDynFormFieldSelectableForeingKeyFactory.selfRegister(); |
||
87 | 44262 | jjdelcerro | JDynFormFieldRelatedFeaturesFactory.selfRegister(); |
88 | 44259 | jjdelcerro | |
89 | 44644 | jjdelcerro | DefaultFeatureStoreOrderPanel.selfRegister(); |
90 | 44259 | jjdelcerro | DefaultSearchPanel.selfRegister(); |
91 | 44533 | jjdelcerro | JDBCConnectionPickerController.selfRegister(); |
92 | 44531 | omartinez | DefaultJFeaturesForm.selfRegister(); |
93 | 44253 | jjdelcerro | |
94 | 43983 | jjdelcerro | DynObjectManager dynObjectmanager = ToolsLocator.getDynObjectManager(); |
95 | dynObjectmanager.registerDynMethod(new CreateComboModelFromTable("DAL.createComboModelFromTable", "XXXXXXXXXXXXXXXXXXXX.")); |
||
96 | |||
97 | DataStoreParametersPanelManager dataStoreParametersPanelManager = DALSwingLocator.getDataStoreParametersPanelManager(); |
||
98 | dataStoreParametersPanelManager.registerFactory(new DataStoreDynObjectParametersPanelFactory());
|
||
99 | } catch(Exception ex) { |
||
100 | LOGGER.warn("Can't register DAL components in DynForms",ex);
|
||
101 | 42775 | jjdelcerro | } |
102 | 43983 | jjdelcerro | try {
|
103 | FeatureStoreElementFactory.selfRegister(); |
||
104 | } catch(Exception ex) { |
||
105 | LOGGER.warn("Can't register DAL components in ExpressionEvaluator",ex);
|
||
106 | } |
||
107 | 42104 | jjdelcerro | } |
108 | |||
109 | } |