01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package net.refractions.udig.catalog.internal.oracle.ui;
18:
19: import java.net.URL;
20:
21: import net.refractions.udig.catalog.oracle.internal.Messages;
22: import net.refractions.udig.catalog.ui.preferences.AbstractProprietaryJarPreferencePage;
23:
24: import org.eclipse.core.runtime.Platform;
25: import org.eclipse.jface.resource.ImageDescriptor;
26: import org.eclipse.ui.IWorkbenchPreferencePage;
27: import org.geotools.data.oracle.OracleDataStoreFactory;
28:
29: /**
30: * @author jones
31: */
32: public class OracleSpatialPreferences extends
33: AbstractProprietaryJarPreferencePage implements
34: IWorkbenchPreferencePage {
35: /**
36: * @param title
37: * @param image
38: */
39: public OracleSpatialPreferences() {
40: super (Messages.OraclePreferences_title);
41: }
42:
43: public OracleSpatialPreferences(String file) {
44: super (file);
45: }
46:
47: public OracleSpatialPreferences(String file, ImageDescriptor desc) {
48: super (file, desc);
49: }
50:
51: protected String getDriverLabel(int index) {
52: return Messages.OraclePreferences_driverLabel;
53: }
54:
55: @Override
56: protected String getDefaultJarName(int index) {
57: return "oracle-driver.jar"; //$NON-NLS-1$
58: }
59:
60: @Override
61: protected boolean installed() {
62: return isInstalled();
63: }
64:
65: public static boolean isInstalled() {
66: OracleDataStoreFactory factory = new OracleDataStoreFactory();
67: return factory.isAvailable();
68: }
69:
70: @Override
71: protected int getRequiredJarsCount() {
72: return 1;
73: }
74:
75: @Override
76: protected URL getLibsURL() {
77: return Platform
78: .getBundle("net.refractions.udig.libs.oracle").getEntry("/libs"); //$NON-NLS-1$ //$NON-NLS-2$
79: }
80:
81: }
|