Revision 34410
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/FiltroExtension.java | ||
---|---|---|
106 | 106 |
|
107 | 107 |
if (v instanceof Table) { |
108 | 108 |
vista = (Table) v; |
109 |
|
|
110 | 109 |
dataSource = vista.getModel().getModelo().getRecordset(); |
111 | 110 |
filterTitle = vista.getModel().getName(); |
112 | 111 |
vista.getModel().setModified(true); |
113 | 112 |
} else if (v instanceof com.iver.cit.gvsig.project.documents.view.gui.View) { |
114 |
IProjectView pv = ((com.iver.cit.gvsig.project.documents.view.gui.View) v).getModel(); |
|
115 |
filterTitle = ((com.iver.cit.gvsig.project.documents.view.gui.View) v).getModel().getName();
|
|
116 |
FLayer layer = pv.getMapContext()
|
|
117 |
.getLayers().getActives()[0];
|
|
113 |
IProjectView pv = ((com.iver.cit.gvsig.project.documents.view.gui.View) v).getModel();
|
|
114 |
FLayer layer = pv.getMapContext().getLayers().getActives()[0];
|
|
115 |
//filterTitle = ((com.iver.cit.gvsig.project.documents.view.gui.View) v).getModel().getName();
|
|
116 |
filterTitle = layer.getName();
|
|
118 | 117 |
dataSource = pv.getProject().getDataSourceByLayer(layer); |
119 | 118 |
((ProjectDocument)pv).setModified(true); |
120 | 119 |
} |
... | ... | |
124 | 123 |
|
125 | 124 |
doExecute(); |
126 | 125 |
} |
126 |
if ("FILTER_DATASOURCE".equals(actionCommand)) { |
|
127 |
// It should be set before using setDatasource(SelectableDataSource ds) method. |
|
128 |
if (dataSource != null){ |
|
129 |
doExecute(); |
|
130 |
} |
|
131 |
} |
|
132 |
|
|
127 | 133 |
} |
128 |
|
|
134 |
|
|
135 |
/** |
|
136 |
* Set a SelectableDataSource to apply the filter. If this method are not used, the filter extension |
|
137 |
* will get one from the ActiveWindow. |
|
138 |
* |
|
139 |
* @param ds SelectableDataSource to filter |
|
140 |
*/ |
|
141 |
public void setDatasource(SelectableDataSource ds, String dsName){ |
|
142 |
dataSource = ds; |
|
143 |
if (dsName == null){ |
|
144 |
dsName = ""; |
|
145 |
} |
|
146 |
filterTitle = dsName; |
|
147 |
} |
|
148 |
|
|
129 | 149 |
/** |
130 | 150 |
* "execute" method action. |
131 | 151 |
* |
Also available in: Unified diff