andrea antonello wrote:
We may have a problem here ... the layers view is not always open is it?
Good observation.
I usually hunt down the Map and try and see what is selected.
Is it possible to ask a layer if it is selected? I couldn't find that...
In the design docs there were a bunch of "bits" that can be thrown per layer to indicate ....isSelected, isVisible and then a whole bunch of extras for "isApplicable" - in order to check if a tool category will work on a given layer (isEditable, isInfoable, etc...)

Checking the code:
- ILayer.isVisible() exists
- ILayer.isApplicable( String ) exists
- Layer.isSelectable()

But I do not see selection; I am going to check where the selection lives hold on a second.... - I see the LayersView listening to the EditManager - and updating its selection to match what is going on; but it looks like the EditManager only records a single layer as selected at any one time

So best advise is to ...
- try the current workbench part and check if its selection has one (or more) layers selected - go through all the workbench parts and one that has one (or more) layers selected

I am pretty sure it is this problem that Vitali was trying to solve - ie a central service that would listen to the workbench and record the "last" Layer/Layers selected. Similar in behavior to the tutorial I mentioned earlier.

This is the downside to Eclipse RCP applications; there is often no central point of control.

I suspect that we should allow the EditManager to record what layers are selected; and then you can hunt down the current Map Editor; because the Current Map is what any view or tool is supposed to be reflecting (not another view that may or may not be around).

Jody
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to