Revision 31403
trunk/extensions/extCAD/src/com/iver/cit/gvsig/StartEditing.java | ||
---|---|---|
9 | 9 |
import com.iver.andami.PluginServices; |
10 | 10 |
import com.iver.andami.messages.NotificationManager; |
11 | 11 |
import com.iver.andami.plugins.Extension; |
12 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
12 | 13 |
import com.iver.cit.gvsig.exceptions.layers.StartEditionLayerException; |
13 | 14 |
import com.iver.cit.gvsig.fmap.MapControl; |
14 | 15 |
import com.iver.cit.gvsig.fmap.core.FShape; |
... | ... | |
242 | 243 |
FLayer[] selected = f.getModel().getMapContext().getLayers() |
243 | 244 |
.getActives(); |
244 | 245 |
if (selected.length == 1 && selected[0].isAvailable() && selected[0] instanceof FLyrVect) { |
245 |
if (selected[0].isEditing()) |
|
246 |
return false; |
|
247 | 246 |
if (((FLyrVect)selected[0]).isJoined()){ |
248 | 247 |
return false; |
249 | 248 |
} |
... | ... | |
256 | 255 |
* @see com.iver.andami.plugins.IExtension#isVisible() |
257 | 256 |
*/ |
258 | 257 |
public boolean isVisible() { |
259 |
com.iver.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager() |
|
260 |
.getActiveWindow(); |
|
258 |
IWindow f = (View) PluginServices.getMDIManager().getActiveWindow(); |
|
261 | 259 |
|
262 | 260 |
if (f == null) { |
263 | 261 |
return false; |
264 | 262 |
} |
265 |
|
|
266 |
if (f instanceof View) |
|
267 |
return true; |
|
263 |
if (f instanceof View){ |
|
264 |
View view=(View)f; |
|
265 |
FLayer[] selected = view.getModel().getMapContext().getLayers() |
|
266 |
.getActives(); |
|
267 |
if (selected.length == 1 && selected[0].isAvailable() && selected[0] instanceof FLyrVect) { |
|
268 |
if (selected[0].isEditing()) |
|
269 |
return false; |
|
270 |
return true; |
|
271 |
} |
|
272 |
} |
|
268 | 273 |
return false; |
269 | 274 |
} |
270 | 275 |
} |
Also available in: Unified diff