Revision 24962 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/ClearSelectionExtension.java

View differences:

ClearSelectionExtension.java
48 48

  
49 49
import org.gvsig.fmap.dal.exception.DataException;
50 50
import org.gvsig.fmap.dal.exception.ReadException;
51
import org.gvsig.fmap.dal.feature.FeatureSelection;
51 52
import org.gvsig.fmap.dal.feature.FeatureStore;
52 53
import org.gvsig.fmap.mapcontext.MapContext;
53 54
import org.gvsig.fmap.mapcontext.layers.FLayer;
54 55
import org.gvsig.fmap.mapcontext.layers.FLayers;
55 56
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
56 57
import org.gvsig.fmap.mapcontrol.MapControl;
58
import org.gvsig.project.document.table.FeatureTableDocument;
59
import org.gvsig.project.document.table.gui.FeatureTableDocumentPanel;
57 60

  
58 61
import com.iver.andami.PluginServices;
59 62
import com.iver.andami.messages.NotificationManager;
60 63
import com.iver.andami.plugins.Extension;
61 64
import com.iver.cit.gvsig.project.documents.ProjectDocument;
62
import com.iver.cit.gvsig.project.documents.table.ProjectTable;
63
import com.iver.cit.gvsig.project.documents.table.gui.Table;
64 65
import com.iver.cit.gvsig.project.documents.view.IProjectView;
65 66
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
66 67

  
......
91 92
//					mapCtrl.drawMap(false);
92 93
//				}
93 94
				((ProjectDocument)vista.getModel()).setModified(true);
94
			}else if (view instanceof Table){
95
				Table table = (Table) view;
96
				ProjectTable model = table.getModel();
95
			}else if (view instanceof FeatureTableDocumentPanel){
96
				FeatureTableDocumentPanel table = (FeatureTableDocumentPanel) view;
97
				FeatureTableDocument model = table.getModel();
97 98
				FeatureStore featureStore=null;
98 99
//				try {
99
					featureStore = model.getModel();
100
					featureStore = model.getStore();
100 101
//				} catch (ReadException e) {
101 102
//					e.printStackTrace();
102 103
//				}
......
161 162
			MapContext mapa = ((BaseView) view).getModel().getMapContext();
162 163
			return mapa.getLayers().getLayersCount() > 0;
163 164
		}
164
		if (view instanceof Table) {
165
		if (view instanceof FeatureTableDocumentPanel) {
165 166
			return true;
166 167
		}
167 168

  
......
180 181
			MapContext mapa = ((BaseView) view).getMapControl().getMapContext();
181 182
			return hasVectorLayersWithSelection(mapa.getLayers());
182 183
		}
183
		if (view instanceof Table){
184
			return ((Table)view).getSelectedRowIndices().length>0;
184
		if (view instanceof FeatureTableDocumentPanel){
185
			try {
186
				return !((FeatureSelection)((FeatureTableDocumentPanel)view).getModel().getStore().getSelection()).isEmpty();
187
			} catch (DataException e) {
188
				e.printStackTrace();
189
			}
185 190
		}
186 191
		return false;
187 192
	}

Also available in: Unified diff