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.catalog.internal.arcsde.ui;
16:
17: import java.net.URL;
18:
19: import net.refractions.udig.catalog.arcsde.internal.Messages;
20: import net.refractions.udig.catalog.ui.preferences.AbstractProprietaryJarPreferencePage;
21:
22: import org.eclipse.core.runtime.Platform;
23: import org.eclipse.jface.resource.ImageDescriptor;
24: import org.eclipse.ui.IWorkbenchPreferencePage;
25: import org.geotools.data.arcsde.ArcSDEDataStoreFactory;
26:
27: /**
28: *
29: * @author Jesse
30: * @since 1.1.0
31: */
32: public class ArcSDEPreferences extends
33: AbstractProprietaryJarPreferencePage implements
34: IWorkbenchPreferencePage {
35:
36: /**
37: *
38: */
39: public ArcSDEPreferences() {
40: }
41:
42: /**
43: * @param title
44: */
45: public ArcSDEPreferences(String title) {
46: super (title);
47: }
48:
49: /**
50: * @param title
51: * @param desc
52: */
53: public ArcSDEPreferences(String title, ImageDescriptor desc) {
54: super (title, desc);
55: }
56:
57: @Override
58: protected String getDefaultJarName(int jarIndex) {
59: if (jarIndex == 0) {
60: return "jsde_sdk-XX.jar"; //$NON-NLS-1$
61: } else {
62: return "jsde-jpe-XX.jar"; //$NON-NLS-1$
63: }
64: }
65:
66: @Override
67: protected String getDriverLabel(int jarIndex) {
68: if (jarIndex == 0) {
69: return Messages.ArcSDEPreferences_jdbc_drivers;
70: } else {
71: return "Projection Engine"; //$NON-NLS-1$
72: }
73: }
74:
75: @Override
76: protected int getRequiredJarsCount() {
77: return 2;
78: }
79:
80: @Override
81: protected boolean installed() {
82: return isInstalled();
83: }
84:
85: public static boolean isInstalled() {
86: ArcSDEDataStoreFactory factory = new ArcSDEDataStoreFactory();
87: return factory.isAvailable();
88: }
89:
90: @Override
91: protected URL getLibsURL() {
92: return Platform
93: .getBundle("net.refractions.udig.catalog.arcsde").getEntry("/lib"); //$NON-NLS-1$ //$NON-NLS-2$;
94: }
95:
96: }
|