Statistics
| Revision:

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

History | View | Annotate | Download (2.64 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.view.toc.AbstractTocContextMenuAction;
6
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
7
import com.iver.cit.gvsig.project.documents.view.toc.gui.ChangeName;
8

    
9

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

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

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

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

    
84
        public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
85
                return selectedItems.length == 1;
86
        }
87

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

    
92

    
93
        public void execute(ITocItem item, FLayer[] selectedItems) {
94
                FLayer lyr = getNodeLayer(item);
95
                if (!lyr.isAvailable()) return;
96
                ChangeName chn=new ChangeName(lyr.getName());
97
                PluginServices.getMDIManager().addWindow(chn);
98
                lyr.setName(chn.getName());
99
   }
100
}