Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / toc / actions / ShowLayerErrorsTocMenuEntry.java @ 9532

History | View | Annotate | Download (2.88 KB)

1
/*
2
 * Created on 20-sep-2006
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
/* CVS MESSAGES:
45
*
46
* $Id: ShowLayerErrorsTocMenuEntry.java 9532 2007-01-04 07:24:32Z caballero $
47
* $Log$
48
* Revision 1.2  2007-01-04 07:24:31  caballero
49
* isModified
50
*
51
* Revision 1.1  2006/09/21 18:26:13  azabala
52
* first version in cvs
53
*
54
*
55
*/
56
package com.iver.cit.gvsig.project.documents.view.toc.actions;
57

    
58
import com.iver.andami.PluginServices;
59
import com.iver.cit.gvsig.ProjectExtension;
60
import com.iver.cit.gvsig.fmap.layers.FLayer;
61
import com.iver.cit.gvsig.project.Project;
62
import com.iver.cit.gvsig.project.documents.view.gui.View;
63
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
64
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
65

    
66
public class ShowLayerErrorsTocMenuEntry extends AbstractTocContextMenuAction{
67

    
68
        public void execute(ITocItem item, FLayer[] selectedItems) {
69
                FLayer layer = getNodeLayer(item);
70
                String introductoryText = "<p>La capa "+
71
                                                                layer.getName()+
72
                                                                " presenta los siguientes errores</p>";
73
                ((View)PluginServices.getMDIManager().getActiveWindow()).
74
                        getMapControl().
75
                        getMapContext().
76
                        reportDriverExceptions(introductoryText, layer.getErrors());
77
                Project project=((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject();
78
                project.setModified(true);
79
        }
80

    
81
        public String getText() {
82
                return PluginServices.getText(this, "ver_error_capa");
83
        }
84

    
85
        public String getGroup() {
86
                return "group3"; //FIXME
87
        }
88

    
89
        public int getGroupOrder() {
90
                return 30;
91
        }
92

    
93
        public int getOrder() {
94
                return 2;
95
        }
96

    
97
        public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
98
                return !getNodeLayer(item).isOk();
99
        }
100

    
101
        public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
102
                if (isTocItemBranch(item)) {
103
                        return true;
104
                }
105
                return false;
106

    
107
        }
108

    
109
}
110