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 / ReloadLayerTocMenuEntry.java @ 40558
History | View | Annotate | Download (3.55 KB)
1 | 40558 | jjdelcerro | /**
|
---|---|---|---|
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 | 40435 | jjdelcerro | package org.gvsig.app.project.documents.view.toc.actions; |
25 | |||
26 | import org.gvsig.andami.PluginServices; |
||
27 | import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
||
28 | import org.gvsig.app.project.documents.view.toc.ITocItem; |
||
29 | import org.gvsig.fmap.mapcontext.layers.FLayer; |
||
30 | |||
31 | |||
32 | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
||
33 | *
|
||
34 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
35 | *
|
||
36 | * This program is free software; you can redistribute it and/or
|
||
37 | * modify it under the terms of the GNU General Public License
|
||
38 | * as published by the Free Software Foundation; either version 2
|
||
39 | * of the License, or (at your option) any later version.
|
||
40 | *
|
||
41 | * This program is distributed in the hope that it will be useful,
|
||
42 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
43 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
44 | * GNU General Public License for more details.
|
||
45 | *
|
||
46 | * You should have received a copy of the GNU General Public License
|
||
47 | * along with this program; if not, write to the Free Software
|
||
48 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
49 | *
|
||
50 | * For more information, contact:
|
||
51 | *
|
||
52 | * Generalitat Valenciana
|
||
53 | * Conselleria d'Infraestructures i Transport
|
||
54 | * Av. Blasco Ib??ez, 50
|
||
55 | * 46010 VALENCIA
|
||
56 | * SPAIN
|
||
57 | *
|
||
58 | * +34 963862235
|
||
59 | * gvsig@gva.es
|
||
60 | * www.gvsig.gva.es
|
||
61 | *
|
||
62 | * or
|
||
63 | *
|
||
64 | * IVER T.I. S.A
|
||
65 | * Salamanca 50
|
||
66 | * 46005 Valencia
|
||
67 | * Spain
|
||
68 | *
|
||
69 | * +34 963163400
|
||
70 | * dac@iver.es
|
||
71 | */
|
||
72 | /* CVS MESSAGES:
|
||
73 | *
|
||
74 | * $Id: ReloadLayerTocMenuEntry.java 29598 2009-06-29 16:09:14Z jpiera $
|
||
75 | * $Log$
|
||
76 | * Revision 1.2 2006-10-02 13:52:34 jaume
|
||
77 | * organize impots
|
||
78 | *
|
||
79 | * Revision 1.1 2006/09/15 10:41:30 caballero
|
||
80 | * extensibilidad de documentos
|
||
81 | *
|
||
82 | * Revision 1.1 2006/09/12 15:58:14 jorpiell
|
||
83 | * "Sacadas" las opcines del men? de FPopupMenu
|
||
84 | *
|
||
85 | *
|
||
86 | */
|
||
87 | /**
|
||
88 | *
|
||
89 | * @author Jose Manuel Viv? (Chema)
|
||
90 | *
|
||
91 | * Entrada de men? para recargar una capa.
|
||
92 | */
|
||
93 | public class ReloadLayerTocMenuEntry extends AbstractTocContextMenuAction{ |
||
94 | public String getGroup() { |
||
95 | return "group3"; //FIXME |
||
96 | } |
||
97 | |||
98 | public int getGroupOrder() { |
||
99 | return 30; |
||
100 | } |
||
101 | |||
102 | public int getOrder() { |
||
103 | return 1; |
||
104 | } |
||
105 | |||
106 | public String getText() { |
||
107 | return PluginServices.getText(this, "recargar"); |
||
108 | } |
||
109 | |||
110 | public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
||
111 | return !getNodeLayer(item).isAvailable();
|
||
112 | } |
||
113 | |||
114 | public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
||
115 | if (isTocItemBranch(item)) {
|
||
116 | return true; |
||
117 | } |
||
118 | return false; |
||
119 | |||
120 | } |
||
121 | |||
122 | |||
123 | public void execute(ITocItem item, FLayer[] selectedItems) { |
||
124 | try {
|
||
125 | getNodeLayer(item).reload(); |
||
126 | } catch (Exception ex) { |
||
127 | ex.printStackTrace(); |
||
128 | } |
||
129 | } |
||
130 | } |