Revision 25068 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableRowsOperations.java

View differences:

TableRowsOperations.java
2 2

  
3 3
import org.gvsig.fmap.dal.exception.DataException;
4 4
import org.gvsig.fmap.dal.feature.FeatureStore;
5
import org.gvsig.project.document.table.gui.FeatureTableDocumentPanel;
5 6

  
6 7
import com.iver.andami.PluginServices;
7 8
import com.iver.andami.messages.NotificationManager;
8 9
import com.iver.andami.plugins.Extension;
9 10
import com.iver.andami.ui.mdiManager.IWindow;
10
import com.iver.cit.gvsig.project.documents.table.gui.Table;
11 11

  
12 12

  
13 13
/**
......
44 44
        IWindow v = PluginServices.getMDIManager().getActiveWindow();
45 45

  
46 46
        if (v != null) {
47
            if (v.getClass() == Table.class) {
48
                Table table = (Table) v;
47
            if (v.getClass() == FeatureTableDocumentPanel.class) {
48
            	FeatureTableDocumentPanel table = (FeatureTableDocumentPanel) v;
49 49
                if (actionCommand.compareTo("SELECTIONUP") == 0) {
50 50
					showsSelectedRows(table);
51 51
				}
......
61 61
     * Flip the selection (inverts selection)
62 62
     * @param table
63 63
     */
64
    private void invertSelection(Table table) {
64
    private void invertSelection(FeatureTableDocumentPanel table) {
65 65
    	try {
66
    		FeatureStore fs = table.getModel().getModel();
66
    		FeatureStore fs = table.getModel().getStore();
67 67
    		fs.getFeatureSelection().reverse();
68 68
    	} catch (DataException e) {
69 69
			e.printStackTrace();
......
71 71
		}
72 72
    }
73 73

  
74
	private void showsSelectedRows(Table table) {
74
	private void showsSelectedRows(FeatureTableDocumentPanel table) {
75 75
//    	long[] mapping=null;
76 76
//		try {
77 77
//			FeatureStore fs=table.getModel().getModel();
......
111 111
            return false;
112 112
        }
113 113

  
114
        if (v.getClass() == Table.class) {
115
            Table table = (Table) v;
114
        if (v.getClass() == FeatureTableDocumentPanel.class) {
115
        	FeatureTableDocumentPanel table = (FeatureTableDocumentPanel) v;
116 116

  
117 117
            try {
118
				return !table.getModel().getModel().getFeatureSelection().isEmpty();
118
				return !table.getModel().getStore().getFeatureSelection().isEmpty();
119 119
			} catch (DataException e) {
120 120
				NotificationManager.addError(e);
121 121
			}
......
162 162
            return false;
163 163
        }
164 164

  
165
        if (v instanceof Table) {
165
        if (v instanceof FeatureTableDocumentPanel) {
166 166
            return true;
167 167
        }
168 168

  

Also available in: Unified diff