Revision 10627 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/DataLoadingFromActiveView.java
DataLoadingFromActiveView.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.gui.panels; |
2 | 2 |
|
3 | 3 |
import com.hardcode.driverManager.DriverLoadException; |
4 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
4 | 5 |
import com.iver.andami.PluginServices; |
5 | 6 |
import com.iver.andami.messages.NotificationManager; |
6 | 7 |
import com.iver.andami.ui.mdiManager.IWindow; |
7 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
8 | 8 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
9 | 9 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
10 | 10 |
import com.iver.cit.gvsig.gui.filter.DefaultExpressionDataSource; |
... | ... | |
55 | 55 |
|
56 | 56 |
/** |
57 | 57 |
* This class has specific code for "WFSFilterPanel" extracted from "FiltroExension" that should be in "WFSFilterPanel" but that has a conflict in the "DriverException" class |
58 |
* (because there are 2 classes with the same name "DriverException" but with different code: one in "libFMap" and another in "libGDBMS").
|
|
59 |
*
|
|
58 |
* (because there are 2 classes with the same name "DriverException" but with different code: one in "libFMap" and another in "libGDBMS"). |
|
59 |
* |
|
60 | 60 |
* @author Pablo Piqueras Bartolom? (p_queras@hotmail.com) |
61 | 61 |
*/ |
62 | 62 |
public class DataLoadingFromActiveView { |
63 |
|
|
63 |
|
|
64 | 64 |
/** |
65 |
* This method returns data of the active Window or null if there is no active window or the active window isn't
|
|
65 |
* This method returns data of the active Window or null if there is no active window or the active window isn't |
|
66 | 66 |
* @return |
67 | 67 |
*/ |
68 | 68 |
public static DataReturnedOfDataLoadingFromActiveView getDefaultExpressionDataSource() { |
... | ... | |
75 | 75 |
return null; |
76 | 76 |
} |
77 | 77 |
else { |
78 |
|
|
78 |
|
|
79 | 79 |
// Tryes to acces to the ActivedWindow and get the data from its selected layer |
80 | 80 |
try { |
81 |
|
|
81 |
|
|
82 | 82 |
if (window instanceof Table) { |
83 | 83 |
Table vista = (Table) window; |
84 |
|
|
84 |
|
|
85 | 85 |
dataSource = (SelectableDataSource)vista.getModel().getModelo().getRecordset(); |
86 |
|
|
86 |
|
|
87 | 87 |
} else if (window instanceof com.iver.cit.gvsig.project.documents.view.gui.View) { |
88 | 88 |
IProjectView pv = ((com.iver.cit.gvsig.project.documents.view.gui.View) window).getModel(); |
89 | 89 |
filterTitle = ((com.iver.cit.gvsig.project.documents.view.gui.View) window).getModel().getName(); |
90 | 90 |
FLayer layer = pv.getMapContext().getLayers().getActives()[0]; |
91 | 91 |
if (layer == null) |
92 | 92 |
return null; |
93 |
|
|
93 |
|
|
94 | 94 |
dataSource = pv.getProject().getDataSourceByLayer(layer); |
95 | 95 |
|
96 | 96 |
} |
97 |
} catch (DriverException de) { |
|
97 |
} catch (ReadDriverException de) {
|
|
98 | 98 |
NotificationManager.addError("Error filtrando", de); |
99 | 99 |
return null; |
100 | 100 |
} |
101 |
|
|
101 |
|
|
102 | 102 |
// Load values for return them |
103 | 103 |
try { |
104 | 104 |
ds = new DefaultExpressionDataSource(); |
... | ... | |
107 | 107 |
e.printStackTrace(); |
108 | 108 |
} |
109 | 109 |
} |
110 |
|
|
110 |
|
|
111 | 111 |
return new DataReturnedOfDataLoadingFromActiveView(ds, filterTitle); |
112 | 112 |
} |
113 | 113 |
} |
Also available in: Unified diff