Select to view content in your preferred language

JEditToolsPicker problem

931
1
05-23-2012 03:36 PM
KevinNetherton
Emerging Contributor
I'm trying to build an application that allows users to edit data in a file geodatabase.  I've created a map package with the layers that I want to be able to edit. I've figured out how to set the layers to be editable when they are added to the map.

After browsing the javadoc for the toolkit I found a widget (JEditToolsPicker) which looks like it has much of the functionality I want to allow me to edit features.  It works fine when set to "All Layers" however when I change to "Selected Layers" the pulldown menu that is suppose to allow me to select individual layers does not seem to work.  Been working it over in the debugger and haven't managed to figure out what's wrong.  I suspect its not picking up the layers in the Map properly.  Any hints advice on how to use this widget so that it allows me to work with a subset of the layers that might be displayed on the map would be fantastic!

Thanks

Kevin
0 Kudos
1 Reply
KevinNetherton
Emerging Contributor
I think I figured out what the problem was.  Has to do with the filtering of feature classes.  In my application I want to be able to edit ArcGISLocalFeatureLayer objects or layers or whatever you want to call them! The filter that is getting set up by the JEditToolsPicker on line 522 is for objects of type ArcGISFeatureLayerArcGISLocalFeatureLayer are subclasses of ArcGISFeatureLayer so in my mind they should not get filtered out, but unfortunately that is exactly what is happening. 

I've managed to deduce that the filtering takes place in the class SelectLayersAction and specifically in the method handleMapReady

I've changed this methods if statement from:

if ((_filterClass == null) || curLayer.getClass().equals(_filterClass)) {

to

if ((_filterClass == null) ||  ( curLayer.getClass().equals(_filterClass) || curLayer.getClass().getSuperclass().equals(_filterClass))) {

and now objects of type ArcGISFeatureLayer are included in the "selected layer list" as well as any classes that subclasses of that class like ArcGISLocalFeatureLayer.

Would be great to get some feedback on whether this is bug, or whether the widget was intentionally designed to only allow editing of ArcGISFeatureLayer objects.

Cheers, hope this helps someone!

Kevin
0 Kudos