Statistics
| Revision:

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 @ 42811

History | View | Annotate | Download (2.71 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 modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
/* CVS MESSAGES:
24
 *
25
 * $Id: ShowLayerErrorsTocMenuEntry.java 31496 2009-11-04 12:53:20Z jjdelcerro $
26
 * $Log$
27
 * Revision 1.4  2007-03-06 16:37:08  caballero
28
 * Exceptions
29
 *
30
 * Revision 1.3  2007/02/20 15:52:17  caballero
31
 * no modified
32
 *
33
 * Revision 1.2  2007/01/04 07:24:31  caballero
34
 * isModified
35
 *
36
 * Revision 1.1  2006/09/21 18:26:13  azabala
37
 * first version in cvs
38
 *
39
 *
40
 */
41
package org.gvsig.app.project.documents.view.toc.actions;
42

    
43
import org.gvsig.andami.PluginServices;
44
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
45
import org.gvsig.app.project.documents.view.toc.ITocItem;
46
import org.gvsig.fmap.mapcontext.layers.FLayer;
47
import org.gvsig.tools.swing.api.ToolsSwingLocator;
48
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
49

    
50
public class ShowLayerErrorsTocMenuEntry extends AbstractTocContextMenuAction {
51

    
52
    @Override
53
    public void execute(ITocItem item, FLayer[] selectedItems) {
54
        FLayer layer = getNodeLayer(item);
55
        LayerErrorsPanel panel = new LayerErrorsPanel(layer);
56
        WindowManager wm = ToolsSwingLocator.getWindowManager();
57
        wm.showWindow(panel, "Errors in layer '"+layer.getName()+"'", WindowManager.MODE.WINDOW);
58
    }
59

    
60
    @Override
61
    public String getText() {
62
        return PluginServices.getText(this, "ver_error_capa");
63
    }
64

    
65
    @Override
66
    public String getGroup() {
67
        return "group3"; //FIXME
68
    }
69

    
70
    @Override
71
    public int getGroupOrder() {
72
        return 30;
73
    }
74

    
75
    @Override
76
    public int getOrder() {
77
        return 2;
78
    }
79

    
80
    @Override
81
    public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
82
        return !getNodeLayer(item).isOk();
83
    }
84

    
85
    @Override
86
    public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
87
        return isTocItemBranch(item);
88

    
89
    }
90
}