This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 87097
Collapse All | Expand All

(-)ide/golden/deps.txt (-1 / +1 lines)
Lines 522-528 Link Here
522
  REQUIRES org.openide.io (platform)
522
  REQUIRES org.openide.io (platform)
523
  REQUIRES org.openide.modules (platform)
523
  REQUIRES org.openide.modules (platform)
524
  REQUIRES org.openide.modules.ModuleFormat1
524
  REQUIRES org.openide.modules.ModuleFormat1
525
  REQUIRES org.openide.options (platform)
525
  REQUIRES org.openide.nodes (platform)
526
  REQUIRES org.openide.util (platform)
526
  REQUIRES org.openide.util (platform)
527
  REQUIRES org.openide.windows (platform)
527
  REQUIRES org.openide.windows (platform)
528
MODULE org.netbeans.modules.diff/1 (ide)
528
MODULE org.netbeans.modules.diff/1 (ide)
(-)ide/launcher/upgrade/src/org/netbeans/upgrade/systemoptions/systemoptionsimport (-1 / +2 lines)
Line 1 Link Here
1
#Services/org-netbeans-core-IDESettings.settings
1
#Services/org-netbeans-core-IDESettings.settings
2
Services/org-netbeans-modules-derby-DerbyOptions.settings
(-)db/derby/nbproject/project.xml (-3 / +3 lines)
Lines 57-69 Link Here
57
                    </run-dependency>
57
                    </run-dependency>
58
                </dependency>
58
                </dependency>
59
                <dependency>
59
                <dependency>
60
                    <code-name-base>org.openide.options</code-name-base>
60
                    <code-name-base>org.openide.nodes</code-name-base>
61
                    <build-prerequisite/>
61
                    <build-prerequisite/>
62
                    <compile-dependency/>
62
                    <compile-dependency/>
63
                    <run-dependency>
63
                    <run-dependency>
64
                        <specification-version>6.3</specification-version>
64
                        <specification-version>6.9</specification-version>
65
                    </run-dependency>
65
                    </run-dependency>
66
                </dependency>
66
                </dependency>                
67
                <dependency>
67
                <dependency>
68
                    <code-name-base>org.openide.util</code-name-base>
68
                    <code-name-base>org.openide.util</code-name-base>
69
                    <build-prerequisite/>
69
                    <build-prerequisite/>
(-)db/derby/src/org/netbeans/modules/derby/DerbyOptions.java (-18 / +33 lines)
Lines 23-33 Link Here
23
import java.io.IOException;
23
import java.io.IOException;
24
import java.net.MalformedURLException;
24
import java.net.MalformedURLException;
25
import java.net.URL;
25
import java.net.URL;
26
import javax.management.IntrospectionException;
26
import org.netbeans.api.db.explorer.ConnectionManager;
27
import org.netbeans.api.db.explorer.ConnectionManager;
27
import org.netbeans.api.db.explorer.DatabaseConnection;
28
import org.netbeans.api.db.explorer.DatabaseConnection;
28
import org.netbeans.api.db.explorer.DatabaseException;
29
import org.netbeans.api.db.explorer.DatabaseException;
29
import org.netbeans.api.db.explorer.JDBCDriver;
30
import org.netbeans.api.db.explorer.JDBCDriver;
30
import org.netbeans.api.db.explorer.JDBCDriverManager;
31
import org.netbeans.api.db.explorer.JDBCDriverManager;
32
import org.netbeans.modules.derby.DerbyOptions;
31
import org.openide.ErrorManager;
33
import org.openide.ErrorManager;
32
import org.openide.filesystems.FileObject;
34
import org.openide.filesystems.FileObject;
33
import org.openide.filesystems.FileSystem;
35
import org.openide.filesystems.FileSystem;
Lines 35-52 Link Here
35
import org.openide.filesystems.Repository;
37
import org.openide.filesystems.Repository;
36
import org.openide.filesystems.URLMapper;
38
import org.openide.filesystems.URLMapper;
37
import org.openide.modules.InstalledFileLocator;
39
import org.openide.modules.InstalledFileLocator;
38
import org.openide.options.SystemOption;
40
import org.openide.nodes.BeanNode;
39
import org.openide.util.NbBundle;
41
import org.openide.util.NbBundle;
40
import org.openide.util.SharedClassObject;
42
import org.openide.util.NbPreferences;
41
43
42
/**
44
/**
43
 *
45
 *
44
 * @author Andrei Badea
46
 * @author Andrei Badea
45
 */
47
 */
46
public class DerbyOptions extends SystemOption {
48
public class DerbyOptions {
47
    
49
    private static DerbyOptions INSTANCE = null;    
48
    private static final long serialVersionUID = 1101894610105398924L;
49
    
50
    /**
50
    /**
51
     * This system property allows setting a default value for the Derby system home directory.
51
     * This system property allows setting a default value for the Derby system home directory.
52
     * Its value will be returned by the {@link getSystemHome} method if the
52
     * Its value will be returned by the {@link getSystemHome} method if the
Lines 74-82 Link Here
74
    private static final String DRIVER_NAME_EMBEDDED = "apache_derby_embedded"; // NOI18N
74
    private static final String DRIVER_NAME_EMBEDDED = "apache_derby_embedded"; // NOI18N
75
    
75
    
76
    public static DerbyOptions getDefault() {
76
    public static DerbyOptions getDefault() {
77
        return (DerbyOptions)SharedClassObject.findObject(DerbyOptions.class, true);
77
        if (INSTANCE == null) {
78
            INSTANCE = new DerbyOptions();
79
        }
80
        return INSTANCE;
78
    }
81
    }
79
    
82
    
83
    protected final String putProperty(String key, String value, boolean notify) {
84
        String retval = NbPreferences.forModule(DerbyOptions.class).get(key, null);
85
        if (value != null) {
86
            NbPreferences.forModule(DerbyOptions.class).put(key, value);
87
        } else {
88
            NbPreferences.forModule(DerbyOptions.class).remove(key);
89
        }
90
        return retval;
91
    }
92
93
    protected final String getProperty(String key) {
94
        return NbPreferences.forModule(DerbyOptions.class).get(key, null);
95
    }    
96
    
80
    public String displayName() {
97
    public String displayName() {
81
        return NbBundle.getMessage(DerbyOptions.class, "LBL_DerbyOptions");
98
        return NbBundle.getMessage(DerbyOptions.class, "LBL_DerbyOptions");
82
    }
99
    }
Lines 126-141 Link Here
126
            }
143
            }
127
        }
144
        }
128
        
145
        
129
        synchronized (getLock()) {
146
        synchronized (this) {
130
            if (!isReadExternal()) {
147
            stopDerbyServer();
131
                stopDerbyServer();
132
            }
133
            if (location != null && location.length() <= 0) {
148
            if (location != null && location.length() <= 0) {
134
                location = getDefaultInstallLocation();
149
                location = getDefaultInstallLocation();
135
            }
150
            }
136
            if (!isReadExternal()) {
151
            registerDrivers(location);
137
                registerDrivers(location);
138
            }
139
            putProperty(PROP_DERBY_LOCATION, location, true);
152
            putProperty(PROP_DERBY_LOCATION, location, true);
140
        }
153
        }
141
    }
154
    }
Lines 172-181 Link Here
172
            }
185
            }
173
        }
186
        }
174
        
187
        
175
        synchronized (getLock()) {
188
        synchronized (this) {
176
            if (!isReadExternal()) {
189
            stopDerbyServer();
177
                stopDerbyServer();
178
            }
179
            putProperty(PROP_DERBY_SYSTEM_HOME, derbySystemHome, true);
190
            putProperty(PROP_DERBY_SYSTEM_HOME, derbySystemHome, true);
180
        }
191
        }
181
    }
192
    }
Lines 280-283 Link Here
280
            }
291
            }
281
        }
292
        }
282
    }
293
    }
294
    
295
    public static BeanNode createViewNode() throws java.beans.IntrospectionException {
296
        return new BeanNode(DerbyOptions.getDefault());
297
    }     
283
}
298
}
(-)db/derby/src/org/netbeans/modules/derby/layer.xml (-7 / +3 lines)
Lines 36-52 Link Here
36
            <attr name="DerbyDatabaseAction.instance/javadoc-Search-Doc-Action.instance" boolvalue="true"/>
36
            <attr name="DerbyDatabaseAction.instance/javadoc-Search-Doc-Action.instance" boolvalue="true"/>
37
        </folder>
37
        </folder>
38
    </folder>
38
    </folder>
39
    
39
        
40
    <folder name="Services">
41
        <file name="org-netbeans-modules-derby-DerbyOptions.settings" url="DerbyOptions.settings"/>
42
    </folder>
43
    
44
    <folder name="UI">
40
    <folder name="UI">
45
        <folder name="Services">
41
        <folder name="Services">
46
            <folder name="IDEConfiguration">
42
            <folder name="IDEConfiguration">
47
                <folder name="ServerAndExternalToolSettings">
43
                <folder name="ServerAndExternalToolSettings">
48
                    <file name="org-netbeans-modules-derby-DerbyOptions.shadow">
44
                    <file name="DerbyOptionsNode.instance">
49
                        <attr name="originalFile" stringvalue="Services/org-netbeans-modules-derby-DerbyOptions.settings"/>
45
                        <attr name="instanceCreate" methodvalue="org.netbeans.modules.derby.DerbyOptions.createViewNode"/>
50
                    </file>
46
                    </file>
51
                </folder>
47
                </folder>
52
            </folder>
48
            </folder>

Return to bug 87097