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 @ 44259
History | View | Annotate | Download (4.8 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 | 44128 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.ImageByteArray.JDynFormFieldImageByteArrayFactory; |
26 | import org.gvsig.featureform.swing.impl.dynformfield.ImageFile.JDynFormFieldImageFileFactory; |
||
27 | 44253 | jjdelcerro | import org.gvsig.featureform.swing.impl.dynformfield.ImageURL.JDynFormFieldImageURL; |
28 | import org.gvsig.featureform.swing.impl.dynformfield.ImageURL.JDynFormFieldImageURLFactory; |
||
29 | import org.gvsig.featureform.swing.impl.dynformfield.features.JDynFormFieldFeaturesFactory; |
||
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 | 44259 | jjdelcerro | import org.gvsig.fmap.dal.swing.impl.searchpanel.DefaultSearchPanel; |
43 | 42776 | jjdelcerro | import org.gvsig.tools.ToolsLocator; |
44 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
45 | 42104 | jjdelcerro | import org.gvsig.tools.library.AbstractLibrary; |
46 | import org.gvsig.tools.library.LibraryException; |
||
47 | 43983 | jjdelcerro | import org.slf4j.Logger; |
48 | import org.slf4j.LoggerFactory; |
||
49 | 42104 | jjdelcerro | |
50 | |||
51 | /**
|
||
52 | * @author fdiaz
|
||
53 | *
|
||
54 | */
|
||
55 | 42112 | jjdelcerro | public class DefaultDALSwingLibrary extends AbstractLibrary{ |
56 | 42104 | jjdelcerro | |
57 | 43983 | jjdelcerro | private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDALSwingLibrary.class); |
58 | 42104 | jjdelcerro | |
59 | 42775 | jjdelcerro | @Override
|
60 | 42104 | jjdelcerro | public void doRegistration() { |
61 | 42112 | jjdelcerro | registerAsImplementationOf(DALSwingLibrary.class); |
62 | 42104 | jjdelcerro | } |
63 | |||
64 | |||
65 | 42775 | jjdelcerro | @Override
|
66 | 42104 | jjdelcerro | protected void doInitialize() throws LibraryException { |
67 | 42112 | jjdelcerro | DALSwingLocator.registerSwingManager(DefaultDataSwingManager.class); |
68 | 42775 | jjdelcerro | DALSwingLocator.registerEditingNotificationManager(DefaultEditingNotificationManager.class); |
69 | 43208 | jjdelcerro | |
70 | DALSwingLocator.registerDataStoreParametersPanelManager(DefaultDataStoreParametersPanelManager.class); |
||
71 | 42104 | jjdelcerro | } |
72 | |||
73 | |||
74 | 42775 | jjdelcerro | @Override
|
75 | 42104 | jjdelcerro | protected void doPostInitialize() throws LibraryException { |
76 | 43983 | jjdelcerro | try {
|
77 | 44253 | jjdelcerro | JDynFormFieldFeatureLinkFactory.selfRegister(); |
78 | JDynFormFieldFeaturesTableLinkFactory.selfRegister(); |
||
79 | 44259 | jjdelcerro | |
80 | 44253 | jjdelcerro | JDynFormFieldImageByteArrayFactory.selfRegister(); |
81 | JDynFormFieldImageFileFactory.selfRegister(); |
||
82 | JDynFormFieldImageURLFactory.selfRegister(); |
||
83 | JDynFormFieldForeingKeyFactory.selfRegister(); |
||
84 | JDynFormFieldSelectableForeingKeyFactory.selfRegister(); |
||
85 | JDynFormFieldFeaturesFactory.selfRegister(); |
||
86 | 44259 | jjdelcerro | |
87 | DefaultSearchPanel.selfRegister(); |
||
88 | 44253 | jjdelcerro | |
89 | 43983 | jjdelcerro | DynObjectManager dynObjectmanager = ToolsLocator.getDynObjectManager(); |
90 | dynObjectmanager.registerDynMethod(new CreateComboModelFromTable("DAL.createComboModelFromTable", "XXXXXXXXXXXXXXXXXXXX.")); |
||
91 | |||
92 | DataStoreParametersPanelManager dataStoreParametersPanelManager = DALSwingLocator.getDataStoreParametersPanelManager(); |
||
93 | dataStoreParametersPanelManager.registerFactory(new DataStoreDynObjectParametersPanelFactory());
|
||
94 | } catch(Exception ex) { |
||
95 | LOGGER.warn("Can't register DAL components in DynForms",ex);
|
||
96 | 42775 | jjdelcerro | } |
97 | 43983 | jjdelcerro | try {
|
98 | FeatureStoreElementFactory.selfRegister(); |
||
99 | } catch(Exception ex) { |
||
100 | LOGGER.warn("Can't register DAL components in ExpressionEvaluator",ex);
|
||
101 | } |
||
102 | 42104 | jjdelcerro | } |
103 | |||
104 | } |