I think it has to do with the order the plugins are loaded in, perhaps if you
make your plugin depend on the plugin that is responsible for legend it will be
loaded second.
Finally you may be able to set up your map in a background job, and then add it
to your MapViewer when the job is completed.
--
Jody Garnett
On Wednesday, 26 September 2012 at 12:56 AM, thomas dolley wrote:
> Hello,
>
> I have build one view, this view display a map and add some decoration
> like the legend ( programmaticly ).
> I have added a menu to udig to open this view ( My Tool> Open My View).
> It works fines at the first start, but if I close udig and restart
> when displaying my view then I have an error(NullPointerException).
>
> I use the following code in the createPartControl method of my view
>
> ........................................
>
> //find georessource corresponding to the Legend
>
> IRepository local = CatalogPlugin.getDefault().getLocal();
> final ID LEGEND = new ID("mapgraphic:/localhost/mapgraphic#legend",null);
> IGeoResource legendRessource = local.getById(IGeoResource.class, LEGEND,
> new NullProgressMonitor());
>
> ........................................
>
> legendRessource is null after restarting due to the fact that
> IRepository local has no MapgraphicService.
> Do you have any idea why we have this problem ?
>
>
> Best regards
> Thomas
>
> --
> Thomas DOLLEY
>
> _______________________________________________
> 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