Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Three coding questions

Adrian Custer wrote:
Hey all,

Three questions that have come up in coding uDig


1) Java: can object instances be retyped dynamically?

Consider 'InterfaceA', and 'InterfaceB extends IA' where this simply
adds a method. Is it possible to take an instance of A and somehow add a
definintion of the required method to promote Ainstance to Binstance?
Sorry, I'm sure there is terminology for this but I don't know it.
You can do this using a "Dynamic Proxy", but it is not that pretty. For a much nicer solution see the IResource class in eclipse where this ideas is promoted up to a first object oriented solution. This is the same approach we use for IGeoResource, although we have not yet added in the extension point
yet so it is mostly hard coded.
2) Eclipse: Can Views be created in a Dialog and then embedded?

Views can be 'torn-off' from eclipse in their own window. I wan the
opposite. I'd like to create a view which is presented in a dialog by
default. This would require that it has a "Run Operation" button.
However, I want the essentials of the content to be in a view so that
power users could simply embed the view in their uDig GUI to be able to
run several operations one after the other. Is this possible? Does this
require having an apply 'check mark' like in the 'Style' view? Anyone
know of docs to get started?
This kind of thing is more supported in Eclipse 3.2 where they are giving us a more consistent API between View and Editor. You will find we have implemented some of this work ourself for the StyleConfigurator
and the the pages in the Style Dialog.

You can implement this carefully yourself, making your own "view part" api, and then taking control of the DnD system. But I would not recommend it. Also if you go down this route Adobe will sue you as this is how their products work, the way in which eclipse now operates (where you can tear a view off the window) is already way to close for comfort.

Jody



Back to the top