Revision 37838

View differences:

branches/v2_0_0_prep/extensions/org.gvsig.geometrymeasurement.app/org.gvsig.geometrymeasurement.app.extension/src/main/java/org/gvsig/geometrymeasurement/app/extension/AbstractGeometryMeasurementExtension.java
77 77

  
78 78
    public boolean isEnabled() {
79 79
        TableDocument tableDocument;
80
        String name = "unknow";
80 81
        try {
81 82
            tableDocument = getActiveTableDocument();
82
            return (tableDocument != null && tableDocument.getStore().allowWrite());
83
        } catch (DataException e) {
84
            LOG.error("Error getting the table document", e);
83
            if (tableDocument != null) {
84
                name = tableDocument.getName();
85
            	return (tableDocument != null && tableDocument.getStore().allowWrite());
86
            }
87
        } catch (Throwable e) {
88
            LOG.error("Error accesing to the table document ("+name+")", e);
85 89
        }
86 90
        return false;
87 91
    }
88 92

  
89 93
    public final boolean isVisible() {
90 94
        TableDocument tableDocument;
95
        String name = "unknow";
91 96
        try {
92 97
            tableDocument = getActiveTableDocument();
93 98
            if (tableDocument != null) {
99
                name = tableDocument.getName();
94 100
                return isVisibleForTable(tableDocument);
95 101
            }
96
        } catch (DataException e) {
97
            LOG.error("Error getting the table document", e);
102
        } catch (Throwable e) {
103
            LOG.error("Error accesing to the table document ("+name+")", e);
98 104
        }       
99 105
        return false;
100 106
    }

Also available in: Unified diff