[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-users] (no subject)
|
Morning Sachin: Do you have access to the training materials that go
with that code example (or are you a student?). The training materials
go through the construction of the code example and explain how the
peices fit together.
The classes Service and GeoResource are placeholders or handles in the
catalog for real content. When you go to use them you will need a data
access API; in this case CSVReader is used; but you can add new
interfaces and libraraies yourself if you like.
Your question however; on wanting to do something when a CSV file is
opened is actually a bit more difficult to answer. There is no
workflow where CSV files are "opened". They are opened as needed each
and every time they are used.
If you can go through the workbench selection tutorial (which is public):
- http://udig.refractions.net/confluence/display/DEV/4+Workbench+Tutorial
I think we can find a different way to solve this; the idea is to have
your view waiting for any workbench that can resolve to a CSVReader. I
am going to take a wild guess and suspect you are trying to make a
table view so people can edit CSV files. If I am not right it will at
least be a good example.
So the moment the workbench selection can resolve to a CSVReader your
view can leap into action and suck out all the content into a table
view (or perform some stats or whatever it does). It can continue
showing this content (ie the last CSV file known). If you want an
eclipse example that opperates this way the "javadoc" view is a good
example; it lies in wait and shows you the javadoc for any selection
you make that can be transformed into a java element (class, method,
etc...).
Another way to do this is to add an operation (ie an IOp) class which
will show up in the right click context menu; you can set your
operation to only work when the target resolves to a CSVReader; and
your implementation can open up your view and load it with content.
The CSVService does go through a connected/disconnected lifecycle; the
CSVService will be considered "connected" the first time it is used by
any code anywhere. While we could try making your view open in
response to this change I do not think the result would be what you
expect.
Examples:
- the first time you create a CSVService the catalog will try
connecting in order to determine a good title; and bounds for the
CSVGeoResource
- After being connected once the catalog will remember the title and
bounds and will not really try connecting until the data is displayed
(or otherwise used).
Jody
On Tue, Apr 14, 2009 at 12:57 AM, sachin pathare
<sachin_p@xxxxxxxxxxxxxxxx> wrote:
> Hi,
>
>
>
> I am beginner in uDIG development.
>
>
>
> My senior developed a component which is almost same as CSVReader and
> renderer example, I am facing hard time to understand how it works.
> Basically I am not understanding the flow of code, how its being executed. I
> have a task to open a new view when CSV is loaded. So like in RCP we can
> perform something on click of some widget by using listener
> patters(addListender), can I do something like this? Or else can somebody
> suggest me better approach. My view plugin is ready, I am confused how I
> should invoke it.
>
>
>
> Kindly Help.
>
> _______________________________________________
> udig-users mailing list
> udig-users@xxxxxxxxxxxxxxxxxxxxx
> http://lists.refractions.net/mailman/listinfo/udig-users
>
>