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

View differences:

ShowLayerErrorsTocMenuEntry.java
3 3
 *
4 4
 * Copyright (C) 2007-2013 gvSIG Association.
5 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.
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 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.
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 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.
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.
20 19
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
23 22
 */
24 23
/* 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
*/
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
 */
42 41
package org.gvsig.app.project.documents.view.toc.actions;
43 42

  
44 43
import org.gvsig.andami.PluginServices;
45
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel;
46 44
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
47 45
import org.gvsig.app.project.documents.view.toc.ITocItem;
48 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 49

  
50
public class ShowLayerErrorsTocMenuEntry extends AbstractTocContextMenuAction {
50 51

  
51
public class ShowLayerErrorsTocMenuEntry extends AbstractTocContextMenuAction{
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
    }
52 59

  
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
	}
60
    @Override
61
    public String getText() {
62
        return PluginServices.getText(this, "ver_error_capa");
63
    }
65 64

  
66
	public String getText() {
67
		return PluginServices.getText(this, "ver_error_capa");
68
	}
65
    @Override
66
    public String getGroup() {
67
        return "group3"; //FIXME
68
    }
69 69

  
70
	public String getGroup() {
71
		return "group3"; //FIXME
72
	}
70
    @Override
71
    public int getGroupOrder() {
72
        return 30;
73
    }
73 74

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

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

  
82
	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
83
		return !getNodeLayer(item).isOk();
84
	}
85
    @Override
86
    public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
87
        return isTocItemBranch(item);
85 88

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

  
92
	}
93

  
89
    }
94 90
}
95

  

Also available in: Unified diff