Revision 40485 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/AddLayer.java
AddLayer.java | ||
---|---|---|
29 | 29 |
import org.gvsig.andami.IconThemeHelper; |
30 | 30 |
import org.gvsig.andami.PluginServices; |
31 | 31 |
import org.gvsig.andami.plugins.Extension; |
32 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
33 |
import org.gvsig.app.ApplicationLocator; |
|
32 | 34 |
import org.gvsig.app.addlayer.AddLayerDialog; |
33 | 35 |
import org.gvsig.app.gui.WizardPanel; |
34 | 36 |
import org.gvsig.app.project.documents.AbstractDocument; |
... | ... | |
84 | 86 |
* @see com.iver.mdiApp.plugins.IExtension#isVisible() |
85 | 87 |
*/ |
86 | 88 |
public boolean isVisible() { |
87 |
org.gvsig.andami.ui.mdiManager.IWindow window = PluginServices.getMDIManager() |
|
88 |
.getActiveWindow(); |
|
89 |
|
|
90 |
if (window == null) { |
|
91 |
return false; |
|
92 |
} |
|
93 |
|
|
94 |
// Any view derived from BaseView should have AddLayer available |
|
95 |
|
|
96 |
IView view; |
|
97 |
try { |
|
98 |
view = (IView)window; |
|
99 |
} |
|
100 |
catch (ClassCastException e) { |
|
101 |
return false; |
|
102 |
} |
|
103 |
|
|
104 |
if (view == null) { |
|
105 |
return false; |
|
106 |
} |
|
107 |
|
|
108 |
AbstractViewPanel baseView = (AbstractViewPanel)view; |
|
109 |
return (baseView != null); |
|
89 |
|
|
90 |
IWindow iw = ApplicationLocator.getManager().getActiveWindow(); |
|
91 |
return (iw instanceof IView); |
|
110 | 92 |
} |
111 | 93 |
|
94 |
|
|
112 | 95 |
/** |
113 | 96 |
* @see org.gvsig.andami.plugins.IExtension#postInitialize() |
114 | 97 |
*/ |
Also available in: Unified diff