01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.mapgraphic.internal;
16:
17: import net.refractions.udig.catalog.CatalogPlugin;
18: import net.refractions.udig.catalog.ICatalog;
19: import net.refractions.udig.catalog.IService;
20: import net.refractions.udig.ui.ProgressManager;
21:
22: import org.eclipse.ui.IStartup;
23:
24: /**
25: * Adds the MapGraphic Service to the LocalCatalog...
26: *
27: * TODO this should be an extension point that is part of catalog
28: *
29: * @author Jesse
30: * @since 1.1.0
31: */
32: public class AddToCatalog implements IStartup {
33:
34: public void earlyStartup() {
35: ICatalog localCatalog = CatalogPlugin.getDefault()
36: .getLocalCatalog();
37: IService service = localCatalog.getById(IService.class,
38: MapGraphicService.SERVICE_URL, ProgressManager
39: .instance().get());
40: if (service != null)
41: return;
42:
43: service = new MapGraphicService();
44: localCatalog.add(service);
45:
46: }
47:
48: }
|