Statistics
| Revision:

svn-gvsig-desktop / tags / v2_0_0_Build_2031 / applications / appgvSIG / src / org / gvsig / app / extension / TableEditAttributes.java @ 36052

History | View | Annotate | Download (3.11 KB)

1 6127 fjp
/*
2
 * Created on 02-mar-2004
3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47 29596 jpiera
package org.gvsig.app.extension;
48 6127 fjp
49 29596 jpiera
import org.gvsig.andami.PluginServices;
50 34231 jpiera
import org.gvsig.andami.messages.NotificationManager;
51 29596 jpiera
import org.gvsig.andami.plugins.Extension;
52
import org.gvsig.andami.ui.mdiManager.IWindow;
53 31496 jjdelcerro
import org.gvsig.app.project.documents.table.TableDocument;
54 29596 jpiera
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel;
55
import org.gvsig.app.project.documents.table.gui.FeatureTypeEditingPanel;
56 34231 jpiera
import org.gvsig.fmap.dal.exception.DataException;
57 24759 jmvivo
import org.gvsig.fmap.dal.feature.FeatureStore;
58 20994 jmvivo
59 6127 fjp
60
61
/**
62 26020 vcaballero
 * Extensi?n que abre la ventana para cambiar la configuraci?n de la estructura de la tabla.
63 6127 fjp
 *
64
 * @author Vicente Caballero Navarro
65
 */
66 26053 vcaballero
public class TableEditAttributes extends Extension {
67
        private FeatureTableDocumentPanel table = null;
68 6127 fjp
69
        /**
70
         * @see com.iver.mdiApp.plugins.IExtension#updateUI(java.lang.String)
71
         */
72
        public void execute(String s) {
73 31496 jjdelcerro
                TableDocument pt = table.getModel();
74 25999 vcaballero
            FeatureStore fs = pt.getStore();
75 34231 jpiera
                   FeatureTypeEditingPanel dlg;
76
        try {
77
            PluginServices.getMDIManager().addWindow(new FeatureTypeEditingPanel(fs));
78
        } catch (DataException e) {
79
            NotificationManager.addError(PluginServices.getText(this,
80
            "create_editabletype"), e);
81
        }
82 6127 fjp
        }
83
84
        /**
85 29596 jpiera
         * @see org.gvsig.andami.plugins.IExtension#initialize()
86 6127 fjp
         */
87
        public void initialize() {
88
        }
89 21354 vcaballero
90 6127 fjp
    public boolean isEnabled() {
91 26053 vcaballero
                FeatureStore fs = table.getModel().getStore();
92 26020 vcaballero
            return fs.isEditing();
93
        }
94 6127 fjp
95
    /**
96 29596 jpiera
     * @see org.gvsig.andami.plugins.IExtension#isVisible()
97 6127 fjp
     */
98
    public boolean isVisible() {
99 26053 vcaballero
                IWindow v = PluginServices.getMDIManager().getActiveWindow();
100
                if (v !=null && v instanceof FeatureTableDocumentPanel) {
101
                    table=(FeatureTableDocumentPanel)v;
102
                        return true;
103 6127 fjp
                }
104
                return false;
105
    }
106
107
}