? db/derby/arch.xml
Index: ide/golden/deps.txt
===================================================================
RCS file: /cvs/ide/golden/deps.txt,v
retrieving revision 1.315
diff -u -r1.315 deps.txt
--- ide/golden/deps.txt 12 Oct 2006 23:38:47 -0000 1.315
+++ ide/golden/deps.txt 13 Oct 2006 12:50:35 -0000
@@ -522,7 +522,7 @@
REQUIRES org.openide.io (platform)
REQUIRES org.openide.modules (platform)
REQUIRES org.openide.modules.ModuleFormat1
- REQUIRES org.openide.options (platform)
+ REQUIRES org.openide.nodes (platform)
REQUIRES org.openide.util (platform)
REQUIRES org.openide.windows (platform)
MODULE org.netbeans.modules.diff/1 (ide)
Index: ide/launcher/upgrade/src/org/netbeans/upgrade/systemoptions/systemoptionsimport
===================================================================
RCS file: /cvs/ide/launcher/upgrade/src/org/netbeans/upgrade/systemoptions/systemoptionsimport,v
retrieving revision 1.2
diff -u -r1.2 systemoptionsimport
--- ide/launcher/upgrade/src/org/netbeans/upgrade/systemoptions/systemoptionsimport 11 Oct 2006 13:06:14 -0000 1.2
+++ ide/launcher/upgrade/src/org/netbeans/upgrade/systemoptions/systemoptionsimport 13 Oct 2006 12:50:35 -0000
@@ -1 +1,2 @@
-#Services/org-netbeans-core-IDESettings.settings
\ No newline at end of file
+#Services/org-netbeans-core-IDESettings.settings
+Services/org-netbeans-modules-derby-DerbyOptions.settings
\ No newline at end of file
Index: db/derby/nbproject/project.xml
===================================================================
RCS file: /cvs/db/derby/nbproject/project.xml,v
retrieving revision 1.8
diff -u -r1.8 project.xml
--- db/derby/nbproject/project.xml 12 Oct 2006 15:01:19 -0000 1.8
+++ db/derby/nbproject/project.xml 13 Oct 2006 12:50:36 -0000
@@ -57,13 +57,13 @@
- org.openide.options
+ org.openide.nodes
- 6.3
+ 6.9
-
+
org.openide.util
Index: db/derby/src/org/netbeans/modules/derby/DerbyOptions.java
===================================================================
RCS file: /cvs/db/derby/src/org/netbeans/modules/derby/DerbyOptions.java,v
retrieving revision 1.11
diff -u -r1.11 DerbyOptions.java
--- db/derby/src/org/netbeans/modules/derby/DerbyOptions.java 12 Oct 2006 15:01:19 -0000 1.11
+++ db/derby/src/org/netbeans/modules/derby/DerbyOptions.java 13 Oct 2006 12:50:36 -0000
@@ -23,11 +23,13 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import javax.management.IntrospectionException;
import org.netbeans.api.db.explorer.ConnectionManager;
import org.netbeans.api.db.explorer.DatabaseConnection;
import org.netbeans.api.db.explorer.DatabaseException;
import org.netbeans.api.db.explorer.JDBCDriver;
import org.netbeans.api.db.explorer.JDBCDriverManager;
+import org.netbeans.modules.derby.DerbyOptions;
import org.openide.ErrorManager;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
@@ -35,18 +37,16 @@
import org.openide.filesystems.Repository;
import org.openide.filesystems.URLMapper;
import org.openide.modules.InstalledFileLocator;
-import org.openide.options.SystemOption;
+import org.openide.nodes.BeanNode;
import org.openide.util.NbBundle;
-import org.openide.util.SharedClassObject;
+import org.openide.util.NbPreferences;
/**
*
* @author Andrei Badea
*/
-public class DerbyOptions extends SystemOption {
-
- private static final long serialVersionUID = 1101894610105398924L;
-
+public class DerbyOptions {
+ private static DerbyOptions INSTANCE = null;
/**
* This system property allows setting a default value for the Derby system home directory.
* Its value will be returned by the {@link getSystemHome} method if the
@@ -74,9 +74,26 @@
private static final String DRIVER_NAME_EMBEDDED = "apache_derby_embedded"; // NOI18N
public static DerbyOptions getDefault() {
- return (DerbyOptions)SharedClassObject.findObject(DerbyOptions.class, true);
+ if (INSTANCE == null) {
+ INSTANCE = new DerbyOptions();
+ }
+ return INSTANCE;
}
+ protected final String putProperty(String key, String value, boolean notify) {
+ String retval = NbPreferences.forModule(DerbyOptions.class).get(key, null);
+ if (value != null) {
+ NbPreferences.forModule(DerbyOptions.class).put(key, value);
+ } else {
+ NbPreferences.forModule(DerbyOptions.class).remove(key);
+ }
+ return retval;
+ }
+
+ protected final String getProperty(String key) {
+ return NbPreferences.forModule(DerbyOptions.class).get(key, null);
+ }
+
public String displayName() {
return NbBundle.getMessage(DerbyOptions.class, "LBL_DerbyOptions");
}
@@ -126,16 +143,12 @@
}
}
- synchronized (getLock()) {
- if (!isReadExternal()) {
- stopDerbyServer();
- }
+ synchronized (this) {
+ stopDerbyServer();
if (location != null && location.length() <= 0) {
location = getDefaultInstallLocation();
}
- if (!isReadExternal()) {
- registerDrivers(location);
- }
+ registerDrivers(location);
putProperty(PROP_DERBY_LOCATION, location, true);
}
}
@@ -172,10 +185,8 @@
}
}
- synchronized (getLock()) {
- if (!isReadExternal()) {
- stopDerbyServer();
- }
+ synchronized (this) {
+ stopDerbyServer();
putProperty(PROP_DERBY_SYSTEM_HOME, derbySystemHome, true);
}
}
@@ -280,4 +291,8 @@
}
}
}
+
+ public static BeanNode createViewNode() throws java.beans.IntrospectionException {
+ return new BeanNode(DerbyOptions.getDefault());
+ }
}
Index: db/derby/src/org/netbeans/modules/derby/layer.xml
===================================================================
RCS file: /cvs/db/derby/src/org/netbeans/modules/derby/layer.xml,v
retrieving revision 1.10
diff -u -r1.10 layer.xml
--- db/derby/src/org/netbeans/modules/derby/layer.xml 12 Oct 2006 15:01:19 -0000 1.10
+++ db/derby/src/org/netbeans/modules/derby/layer.xml 13 Oct 2006 12:50:36 -0000
@@ -36,17 +36,13 @@
-
-
-
-
-
+
-
-
+
+