root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / ApplicationLibrary.java @ 38605
History | View | Annotate | Download (2.01 KB)
1 | 26919 | jmvivo | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | 30580 | cordinyana | *
|
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | 26919 | jmvivo | |
23 | /*
|
||
24 | 30580 | cordinyana | * AUTHORS (In addition to CIT):
|
25 | * 2009 IVER T.I {{Task}}
|
||
26 | */
|
||
27 | 26919 | jmvivo | |
28 | /**
|
||
29 | *
|
||
30 | */
|
||
31 | 29596 | jpiera | package org.gvsig.app; |
32 | 26919 | jmvivo | |
33 | 31586 | jjdelcerro | import org.gvsig.app.project.DefaultProject; |
34 | 33032 | jjdelcerro | import org.gvsig.fmap.mapcontrol.MapControl; |
35 | 37163 | jjdelcerro | import org.gvsig.installer.lib.api.InstallerLibrary; |
36 | 30633 | cordinyana | import org.gvsig.tools.library.AbstractLibrary; |
37 | 30580 | cordinyana | import org.gvsig.tools.library.LibraryException; |
38 | 26919 | jmvivo | import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
39 | |||
40 | /**
|
||
41 | 31586 | jjdelcerro | * @author 2008-2009 jmvivo
|
42 | * @author 2009- jjdelcerro
|
||
43 | 30580 | cordinyana | *
|
44 | 26919 | jmvivo | */
|
45 | 31496 | jjdelcerro | public class ApplicationLibrary extends AbstractLibrary { |
46 | 26919 | jmvivo | |
47 | 35142 | cordinyana | @Override
|
48 | public void doRegistration() { |
||
49 | registerAsAPI(ApplicationLibrary.class); |
||
50 | require(MapControl.class); |
||
51 | 37163 | jjdelcerro | require(InstallerLibrary.class); |
52 | 35142 | cordinyana | } |
53 | 33032 | jjdelcerro | |
54 | 26919 | jmvivo | @Override
|
55 | 30580 | cordinyana | protected void doInitialize() throws LibraryException { |
56 | 31586 | jjdelcerro | // Do nothing
|
57 | 26919 | jmvivo | } |
58 | |||
59 | @Override
|
||
60 | 30580 | cordinyana | protected void doPostInitialize() throws LibraryException { |
61 | 31496 | jjdelcerro | ApplicationManager manager = ApplicationLocator.getManager(); |
62 | 30580 | cordinyana | if (manager == null) { |
63 | throw new ReferenceNotRegisteredException( |
||
64 | 31496 | jjdelcerro | ApplicationLocator.APPGVSIG_MANAGER_NAME, ApplicationLocator |
65 | 30580 | cordinyana | .getInstance()); |
66 | } |
||
67 | 31586 | jjdelcerro | DefaultProject.registerPersistent(); |
68 | 33400 | cmartin | |
69 | 26919 | jmvivo | } |
70 | 30580 | cordinyana | } |