[udig-devel] Custom Create Project tool
Richard Gould
rgould at refractions.net
Tue Jun 12 10:22:18 PDT 2007
Hi Angus,
Here is the code I use to create a project:
ProjectRegistry registry =
ProjectPlugin.getPlugin().getProjectRegistry();
String path = new File(Platform.getLocation().toString() +
File.separatorChar + "someProject.udig").getAbsolutePath();
Project project = registry.getProject(path);
It's not obvious, but "getting" a project that does not exist will
create it automatically.
Cheers
Richard
On Sun, 2007-06-10 at 16:05 +1000, Gus MacAulay wrote:
> Hi List,
>
> I've been working on some custom plugins for udig at my work which use
> a specific data set. I would like to be able to make a create project
> tool which automatically sets the user up with the required dataset.
> My problem is, how do I create a new project and add it to the
> project/map tree programmatically(I have managed to figure out how to
> add layers to maps from shapefiles allready)? It might help if I
> someone could point me to the source for the existing "create new
> project" tool.
>
> Regards
> Angus MacAulay
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
More information about the udig-devel
mailing list