Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.exportto.app / org.gvsig.exportto.app.mainplugin / src / main / java / org / gvsig / export / app / extension / ExportTableExtension.java @ 44263

History | View | Annotate | Download (2.67 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.export.app.extension;
25

    
26
import javax.swing.Action;
27
import org.gvsig.andami.IconThemeHelper;
28
import org.gvsig.andami.plugins.Extension;
29
import org.gvsig.app.ApplicationLocator;
30
import org.gvsig.app.ApplicationManager;
31
import org.gvsig.app.project.documents.table.TableDocument;
32
import org.gvsig.app.project.documents.table.TableManager;
33
import org.gvsig.export.app.extension.FeatureStoreSearchExportAction.FeatureStoreSearchExportActionFactory;
34
import org.gvsig.fmap.dal.swing.DALSwingLocator;
35
import org.gvsig.fmap.dal.swing.DataSwingManager;
36
import org.gvsig.fmap.dal.swing.searchpanel.FeatureStoreSearchPanel;
37

    
38
/**
39
 * @author gvSIG Team
40
 * @version $Id$
41
 * 
42
 */
43
public class ExportTableExtension extends Extension {
44

    
45
    @Override
46
    public void initialize() {
47
        IconThemeHelper.registerIcon("action", "table-export", this);
48
    }
49

    
50
    @Override
51
    public void postInitialize() {
52
        super.postInitialize();
53
        FeatureStoreSearchExportActionFactory.selfRegister();
54
    }
55
    
56
    @Override
57
    public void execute(String actionCommand) {
58
        ApplicationManager application = ApplicationLocator.getManager();
59
        TableDocument tableDoc = (TableDocument) application.getActiveDocument(TableManager.TYPENAME);
60
        if( tableDoc == null ) {
61
            return;
62
        }
63
        ExportTable exportTable = new ExportTable();
64
        exportTable.showExport(tableDoc.getStore(), null);
65
    }
66

    
67
    @Override
68
    public boolean isEnabled() {
69
        return true;
70
    }
71

    
72
    @Override
73
    public boolean isVisible() {
74
        ApplicationManager application = ApplicationLocator.getManager();
75
        TableDocument tableDoc = (TableDocument) application.getActiveDocument(TableManager.TYPENAME);
76
        return tableDoc != null;
77
    }
78
}