svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / toc / actions / ShowLayerErrorsTocMenuEntry.java @ 10626
History | View | Annotate | Download (2.94 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 10626 2007-03-06 16:55:54Z caballero $
|
47 |
* $Log$
|
48 |
* Revision 1.4 2007-03-06 16:37:08 caballero
|
49 |
* Exceptions
|
50 |
*
|
51 |
* Revision 1.3 2007/02/20 15:52:17 caballero
|
52 |
* no modified
|
53 |
*
|
54 |
* Revision 1.2 2007/01/04 07:24:31 caballero
|
55 |
* isModified
|
56 |
*
|
57 |
* Revision 1.1 2006/09/21 18:26:13 azabala
|
58 |
* first version in cvs
|
59 |
*
|
60 |
*
|
61 |
*/
|
62 |
package com.iver.cit.gvsig.project.documents.view.toc.actions; |
63 |
|
64 |
import com.iver.andami.PluginServices; |
65 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
66 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
67 |
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction; |
68 |
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem; |
69 |
|
70 |
public class ShowLayerErrorsTocMenuEntry extends AbstractTocContextMenuAction{ |
71 |
|
72 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
73 |
FLayer layer = getNodeLayer(item); |
74 |
String introductoryText = "<h2 text=\"#000080\">La capa "+ |
75 |
layer.getName()+ |
76 |
" presenta los siguientes errores</h2>";
|
77 |
((View)PluginServices.getMDIManager().getActiveWindow()).
|
78 |
getMapControl(). |
79 |
getMapContext(). |
80 |
reportDriverExceptions(introductoryText, layer.getErrors()); |
81 |
// Project project=((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject();
|
82 |
// project.setModified(true);
|
83 |
} |
84 |
|
85 |
public String getText() { |
86 |
return PluginServices.getText(this, "ver_error_capa"); |
87 |
} |
88 |
|
89 |
public String getGroup() { |
90 |
return "group3"; //FIXME |
91 |
} |
92 |
|
93 |
public int getGroupOrder() { |
94 |
return 30; |
95 |
} |
96 |
|
97 |
public int getOrder() { |
98 |
return 2; |
99 |
} |
100 |
|
101 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
102 |
return !getNodeLayer(item).isOk();
|
103 |
} |
104 |
|
105 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
106 |
if (isTocItemBranch(item)) {
|
107 |
return true; |
108 |
} |
109 |
return false; |
110 |
|
111 |
} |
112 |
|
113 |
} |
114 |
|