Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extGPE-gvSIG / src / org / gvsig / gpe / GPELibraryExtension.java @ 27499

History | View | Annotate | Download (2.53 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
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

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.gpe;
29

    
30
import java.io.File;
31
import java.io.FileNotFoundException;
32

    
33
import org.gvsig.fmap.dal.store.gpe.GPELibrary;
34

    
35
import com.iver.andami.messages.NotificationManager;
36
import com.iver.andami.plugins.Extension;
37

    
38
/**
39
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
40
 */
41
public class GPELibraryExtension extends Extension{
42
        private GPELibrary lib = null;
43
        private String parsersFile = "gvSIG" + File.separatorChar + "extensiones" + File.separatorChar + 
44
        "org.gvsig.gpe" + File.separatorChar + "parser.properties";
45
        
46
        /* (non-Javadoc)
47
         * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
48
         */
49
        public void execute(String actionCommand) {
50
                // TODO Auto-generated method stub
51
                
52
        }
53

    
54
        /* (non-Javadoc)
55
         * @see com.iver.andami.plugins.IExtension#initialize()
56
         */
57
        public void initialize() {
58
                File file = new File(parsersFile);
59
                if (!file.exists()){
60
                        NotificationManager.addWarning("File not found",
61
                                        new FileNotFoundException());
62
                        return;
63
                }
64
                try {
65
                        GPERegister.addParsersFile(file);
66
                } catch (Exception e) {
67
                        NotificationManager.addWarning("GPE parsers file not found",
68
                                        new FileNotFoundException());
69
                }
70
                
71
                lib = new GPELibrary();
72
                lib.initialize();                
73
        }        
74

    
75
        /* (non-Javadoc)
76
         * @see com.iver.andami.plugins.Extension#postInitialize()
77
         */
78
        public void postInitialize() {
79
                lib.postInitialize();                
80
        }
81

    
82
        /* (non-Javadoc)
83
         * @see com.iver.andami.plugins.IExtension#isEnabled()
84
         */
85
        public boolean isEnabled() {
86
                return false;
87
        }
88

    
89
        /* (non-Javadoc)
90
         * @see com.iver.andami.plugins.IExtension#isVisible()
91
         */
92
        public boolean isVisible() {
93
                return false;
94
        }
95

    
96
}
97