svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / toc / actions / ShowLayerErrorsTocMenuEntry.java @ 40558
History | View | Annotate | Download (2.73 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 |
/* CVS MESSAGES:
|
25 |
*
|
26 |
* $Id: ShowLayerErrorsTocMenuEntry.java 31496 2009-11-04 12:53:20Z jjdelcerro $
|
27 |
* $Log$
|
28 |
* Revision 1.4 2007-03-06 16:37:08 caballero
|
29 |
* Exceptions
|
30 |
*
|
31 |
* Revision 1.3 2007/02/20 15:52:17 caballero
|
32 |
* no modified
|
33 |
*
|
34 |
* Revision 1.2 2007/01/04 07:24:31 caballero
|
35 |
* isModified
|
36 |
*
|
37 |
* Revision 1.1 2006/09/21 18:26:13 azabala
|
38 |
* first version in cvs
|
39 |
*
|
40 |
*
|
41 |
*/
|
42 |
package org.gvsig.app.project.documents.view.toc.actions; |
43 |
|
44 |
import org.gvsig.andami.PluginServices; |
45 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
46 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
47 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
48 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
49 |
|
50 |
|
51 |
public class ShowLayerErrorsTocMenuEntry extends AbstractTocContextMenuAction{ |
52 |
|
53 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
54 |
FLayer layer = getNodeLayer(item); |
55 |
String introductoryText = "<h2 text=\"#000080\">La capa "+ |
56 |
layer.getName()+ |
57 |
" presenta los siguientes errores</h2>";
|
58 |
((DefaultViewPanel)PluginServices.getMDIManager().getActiveWindow()). |
59 |
getMapControl(). |
60 |
getMapContext(). |
61 |
reportDriverExceptions(introductoryText, layer.getErrors()); |
62 |
// Project project=((ProjectExtension)PluginServices.getExtension(ProjectExtension.class)).getProject();
|
63 |
// project.setModified(true);
|
64 |
} |
65 |
|
66 |
public String getText() { |
67 |
return PluginServices.getText(this, "ver_error_capa"); |
68 |
} |
69 |
|
70 |
public String getGroup() { |
71 |
return "group3"; //FIXME |
72 |
} |
73 |
|
74 |
public int getGroupOrder() { |
75 |
return 30; |
76 |
} |
77 |
|
78 |
public int getOrder() { |
79 |
return 2; |
80 |
} |
81 |
|
82 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
83 |
return !getNodeLayer(item).isOk();
|
84 |
} |
85 |
|
86 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
87 |
if (isTocItemBranch(item)) {
|
88 |
return true; |
89 |
} |
90 |
return false; |
91 |
|
92 |
} |
93 |
|
94 |
} |
95 |
|