Statistics
| Revision:

root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / toc / actions / ReloadLayerTocMenuEntry.java @ 7304

History | View | Annotate | Download (2.55 KB)

1
package com.iver.cit.gvsig.project.documents.view.toc.actions;
2

    
3
import com.iver.andami.PluginServices;
4
import com.iver.cit.gvsig.fmap.layers.FLayer;
5
import com.iver.cit.gvsig.project.documents.table.ProjectTable;
6
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
7
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: ReloadLayerTocMenuEntry.java 7304 2006-09-15 10:44:24Z caballero $
52
 * $Log$
53
 * Revision 1.1  2006-09-15 10:41:30  caballero
54
 * extensibilidad de documentos
55
 *
56
 * Revision 1.1  2006/09/12 15:58:14  jorpiell
57
 * "Sacadas" las opcines del men? de FPopupMenu
58
 *
59
 *
60
 */
61
/**
62
*
63
* @author Jose Manuel Viv? (Chema)
64
*
65
* Entrada de men? para recargar una capa.
66
*/
67
public class ReloadLayerTocMenuEntry extends AbstractTocContextMenuAction{
68
        public String getGroup() {
69
                return "group3"; //FIXME
70
        }
71

    
72
        public int getGroupOrder() {
73
                return 30;
74
        }
75

    
76
        public int getOrder() {
77
                return 1;
78
        }
79

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

    
84
        public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
85
                return !getNodeLayer(item).isAvailable();
86
        }
87

    
88
        public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
89
                if (isTocItemBranch(item)) {
90
                        return true;
91
                }
92
                return false;
93

    
94
        }
95

    
96

    
97
        public void execute(ITocItem item, FLayer[] selectedItems) {
98
                try {
99
                        getNodeLayer(item).reload();
100
                } catch (Exception ex) {
101
                        ex.printStackTrace();
102
                }
103
        }
104
}
105