Ok I've updated the page to include a discussion of what objects are
passed to the op method and have a few code snippets and xml snippets
of the extension declarations.
Jesse
On 27-Mar-06, at 10:03 PM, Adrian Custer wrote:
Hey Jesse,
That's a good page! Since I'm about to start wondering about this it's
also timely, thanks.
Would it be possible for you to give some example snipets of the
plugin.xml target line and the initial cast in the
IOp(...Object target...)
for the different types of target. For example, if a user selects a
bunch of features either in the "Selection/Table" view or on the map,
what's the target in the plugin.xml? The cast will be from Object to
Feature [] or to something similar but the plugin.xml doesn't have
a way
of saying 'feature array', does it?
Example layout:
--------------
Layer selection:
<operation
...
targetClass="net.refractions.udig.project.ILayer"
...
/>
if (Object instanceOf ILayer)
myILayer = (ILayer) target;
Acutally, I've also been wondering what the correct check is here. By
default we would imagine that Eclipse has 'done the right thing'
but it
would presumably be a good idea to check. I'm not sure what type of
check (e.g. assertion) is reasonable before performing this cast.
cheers,
adrian
On Mon, 2006-03-27 at 18:22 -0800, Jesse Eichar wrote:
Hi,
I wrote a little page on how the _target_ of an operation is
determined and what object can be expected from the different
standard views. You can look at it here:
http://udig.refractions.net/confluence/display/DEV/Targets
Cheers,
Jesse
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel