Revision 31946 branches/v2_0_0_prep/extensions/extGeocoding/src/org/gvsig/geocoding/extension/RelateGeocodingResultsExtension.java
RelateGeocodingResultsExtension.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
package org.gvsig.geocoding.extension; |
29 | 29 |
|
30 |
import java.util.ArrayList; |
|
30 |
|
|
31 | 31 |
import java.util.List; |
32 | 32 |
|
33 |
import javax.swing.DefaultComboBoxModel; |
|
34 |
|
|
35 | 33 |
import org.gvsig.andami.PluginServices; |
36 | 34 |
import org.gvsig.andami.plugins.Extension; |
37 | 35 |
import org.gvsig.andami.preferences.IPreference; |
38 | 36 |
import org.gvsig.andami.preferences.IPreferenceExtension; |
39 | 37 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
40 |
import org.gvsig.app.project.documents.table.FeatureTableDocument; |
|
41 |
import org.gvsig.app.project.documents.view.gui.View; |
|
38 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
39 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
|
40 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
42 | 41 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
43 | 42 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
44 | 43 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
... | ... | |
114 | 113 |
public boolean isEnabled() { |
115 | 114 |
|
116 | 115 |
IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
117 |
if (window instanceof View) { |
|
118 |
View vi = (View) window;
|
|
116 |
if (window instanceof IView) {
|
|
117 |
DefaultViewPanel vi = (DefaultViewPanel) window;
|
|
119 | 118 |
FLayers lyrs = vi.getMapControl().getMapContext().getLayers(); |
120 | 119 |
if (lyrs != null && lyrs.getLayersCount() > 0) { |
121 | 120 |
if (lyrs.getActives().length > 0) { |
122 | 121 |
FLayer lyr = lyrs.getActives()[0]; |
123 | 122 |
if (lyr instanceof FLyrVect) { |
124 | 123 |
FLyrVect ly = (FLyrVect) lyr; |
125 |
List<FeatureTableDocument> tables = control.getListgvSIGTables();
|
|
124 |
List<TableDocument> tables = control.getListgvSIGTables(); |
|
126 | 125 |
Object obj = ly.getProperty(GeocodingExtTags.GEOCODINGPROPERTY); |
127 |
if (obj instanceof FeatureTableDocument
|
|
126 |
if (obj instanceof TableDocument |
|
128 | 127 |
&& tables.size() > 0) { |
129 | 128 |
return true; |
130 | 129 |
} |
... | ... | |
143 | 142 |
public boolean isVisible() { |
144 | 143 |
IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
145 | 144 |
// Visible when there are views in the window |
146 |
if (window instanceof View) { |
|
145 |
if (window instanceof IView) {
|
|
147 | 146 |
return true; |
148 | 147 |
} |
149 | 148 |
return false; |
Also available in: Unified diff