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 197408
Collapse All | Expand All

(-)db/libsrc/org/netbeans/lib/ddl/DBConnection.java (+4 lines)
Lines 45-50 Link Here
45
package org.netbeans.lib.ddl;
45
package org.netbeans.lib.ddl;
46
46
47
import java.sql.Connection;
47
import java.sql.Connection;
48
import java.util.Properties;
48
49
49
/**
50
/**
50
* Connection information.
51
* Connection information.
Lines 143-146 Link Here
143
    * driver or database does not exist or is inaccessible.
144
    * driver or database does not exist or is inaccessible.
144
    */
145
    */
145
    public Connection createJDBCConnection() throws DDLException;
146
    public Connection createJDBCConnection() throws DDLException;
147
    
148
    public void setConnectionProperties(Properties connectionProperties);
149
    public Properties getConnectionProperties();
146
}
150
}
(-)db/src/org/netbeans/api/db/explorer/node/BaseNode.java (-3 / +8 lines)
Lines 57-63 Link Here
57
import org.openide.nodes.AbstractNode;
57
import org.openide.nodes.AbstractNode;
58
import org.openide.nodes.Children;
58
import org.openide.nodes.Children;
59
import org.openide.nodes.Node;
59
import org.openide.nodes.Node;
60
import org.openide.nodes.PropertySupport;
61
import org.openide.nodes.Sheet;
60
import org.openide.nodes.Sheet;
62
import org.openide.util.NbBundle;
61
import org.openide.util.NbBundle;
63
import org.openide.util.RequestProcessor;
62
import org.openide.util.RequestProcessor;
Lines 117-122 Link Here
117
    protected static final String FKREFERREDTABLEDESC = "ReferredFKTable"; // NOI18N
116
    protected static final String FKREFERREDTABLEDESC = "ReferredFKTable"; // NOI18N
118
    protected static final String FKREFERREDCOLUMN = "ReferredFKColumn"; // NOI18N
117
    protected static final String FKREFERREDCOLUMN = "ReferredFKColumn"; // NOI18N
119
    protected static final String FKREFERREDCOLUMNDESC = "ReferredFKColumn"; // NOI18N
118
    protected static final String FKREFERREDCOLUMNDESC = "ReferredFKColumn"; // NOI18N
119
    protected static final String CONNECTIONPROPERTIES = "ConnectionProperties";
120
    protected static final String CONNECTIONPROPERTIESDESC = "ConnectionPropertiesDescription";
120
121
121
    private final NodeDataLookup dataLookup;
122
    private final NodeDataLookup dataLookup;
122
    private final ActionRegistry actionRegistry;
123
    private final ActionRegistry actionRegistry;
Lines 281-287 Link Here
281
        getSheet().get(Sheet.PROPERTIES).put(nps);
282
        getSheet().get(Sheet.PROPERTIES).put(nps);
282
    }
283
    }
283
284
284
    protected void addProperty(String name, String desc, Class clazz, boolean writeable, Object value) {
285
    protected NodePropertySupport addProperty(String name, String desc, Class clazz, boolean writeable, Object value) {
285
        String propName = NbBundle.getMessage (BaseNode.class, name);
286
        String propName = NbBundle.getMessage (BaseNode.class, name);
286
287
287
        String propDesc;
288
        String propDesc;
Lines 290-300 Link Here
290
        } else {
291
        } else {
291
            propDesc = NbBundle.getMessage (BaseNode.class, desc);
292
            propDesc = NbBundle.getMessage (BaseNode.class, desc);
292
        }
293
        }
293
        PropertySupport ps = new NodePropertySupport(this, name, clazz, propName, propDesc, writeable);
294
295
        NodePropertySupport ps = new NodePropertySupport(this, name, clazz, propName, propDesc, writeable);
296
294
        props.add(ps);
297
        props.add(ps);
295
        propMap.put(ps.getName(), value);
298
        propMap.put(ps.getName(), value);
296
299
297
        getSheet().get(Sheet.PROPERTIES).put(ps);
300
        getSheet().get(Sheet.PROPERTIES).put(ps);
301
        
302
        return ps;
298
    }
303
    }
299
304
300
    public void setPropertyValue(Property nps, Object val) {
305
    public void setPropertyValue(Property nps, Object val) {
(-)db/src/org/netbeans/api/db/explorer/node/Bundle.properties (+2 lines)
Lines 138-143 Link Here
138
ForeignColumnDescription=Column
138
ForeignColumnDescription=Column
139
KeySeq=Keyseq
139
KeySeq=Keyseq
140
KeySeqDescription=Keyseq
140
KeySeqDescription=Keyseq
141
ConnectionProperties=Connection properties
142
ConnectionPropertiesDescription=Connection properties
141
143
142
# Booleans
144
# Booleans
143
145
(-)db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java (-10 / +61 lines)
Lines 174-179 Link Here
174
     */
174
     */
175
    private MetadataModel metadataModel = null;
175
    private MetadataModel metadataModel = null;
176
176
177
    /** Properties for connection
178
     */
179
    private Properties connectionProperties = new Properties();
180
177
    /**
181
    /**
178
     * The API DatabaseConnection (delegates to this instance)
182
     * The API DatabaseConnection (delegates to this instance)
179
     */
183
     */
Lines 191-196 Link Here
191
    public static final String PROP_DRIVERNAME = "drivername"; //NOI18N
195
    public static final String PROP_DRIVERNAME = "drivername"; //NOI18N
192
    public static final String PROP_NAME = "name"; //NOI18N
196
    public static final String PROP_NAME = "name"; //NOI18N
193
    public static final String PROP_DISPLAY_NAME = "displayName"; //NOI18N
197
    public static final String PROP_DISPLAY_NAME = "displayName"; //NOI18N
198
    public static final String PROP_CONNECTIONPROPERTIES = "connectionProperties";
194
    public static final String DRIVER_CLASS_NET = "org.apache.derby.jdbc.ClientDriver"; // NOI18N
199
    public static final String DRIVER_CLASS_NET = "org.apache.derby.jdbc.ClientDriver"; // NOI18N
195
    public static final int DERBY_UNICODE_ERROR_CODE = 20000;
200
    public static final int DERBY_UNICODE_ERROR_CODE = 20000;
196
    private OpenConnectionInterface openConnection = null;
201
    private OpenConnectionInterface openConnection = null;
Lines 227-248 Link Here
227
     * @param password User password
232
     * @param password User password
228
     */
233
     */
229
    public DatabaseConnection(String driver, String database, String user, String password) {
234
    public DatabaseConnection(String driver, String database, String user, String password) {
230
        this(driver, null, database, null, user, password, null);
235
        this(driver, null, database, null, user, password, null, null);
231
    }
236
    }
232
237
233
    public DatabaseConnection(String driver, String driverName, String database,
238
    public DatabaseConnection(String driver, String driverName, String database,
234
            String theschema, String user, String password) {
239
            String theschema, String user, String password) {
235
        this(driver, driverName, database, theschema, user, password, null);
240
        this(driver, driverName, database, theschema, user, password, null, null);
236
    }
241
    }
237
242
238
    public DatabaseConnection(String driver, String driverName, String database, 
243
    public DatabaseConnection(String driver, String driverName, String database, 
239
            String theschema, String user) {
244
            String theschema, String user) {
240
        this(driver, driverName, database, theschema, user, null, null);
245
        this(driver, driverName, database, theschema, user, null, null, null);
241
    }
246
    }
242
247
243
    public DatabaseConnection(String driver, String driverName, String database,
248
    public DatabaseConnection(String driver, String driverName, String database,
249
            String theschema, String user, Properties connectionProperties) {
250
        this(driver, driverName, database, theschema, user, null, null, connectionProperties);
251
    }
252
253
    public DatabaseConnection(String driver, String driverName, String database,
244
            String theschema, String user, String password,
254
            String theschema, String user, String password,
245
            Boolean rememberPassword) {
255
            Boolean rememberPassword) {
256
        this( driver, driverName, database, theschema, user, password, 
257
              rememberPassword, null);
258
    }
259
260
    public DatabaseConnection(String driver, String driverName, String database,
261
            String theschema, String user, String password,
262
            Boolean rememberPassword, Properties connectionProperties) {
246
        this();
263
        this();
247
        drv = driver;
264
        drv = driver;
248
        drvname = driverName;
265
        drvname = driverName;
Lines 252-257 Link Here
252
        rpwd = rememberPassword == null ? null : Boolean.valueOf(rememberPassword);
269
        rpwd = rememberPassword == null ? null : Boolean.valueOf(rememberPassword);
253
        schema = theschema;
270
        schema = theschema;
254
        name = getName();
271
        name = getName();
272
        setConnectionProperties(connectionProperties);
255
    }
273
    }
256
274
257
    public JDBCDriver findJDBCDriver() {
275
    public JDBCDriver findJDBCDriver() {
Lines 521-526 Link Here
521
        }
539
        }
522
    }
540
    }
523
541
542
    public Properties getConnectionProperties() {
543
        return (Properties) connectionProperties.clone();
544
    }
545
546
    public void setConnectionProperties(Properties connectionProperties) {
547
        Properties old = this.connectionProperties;
548
        if(connectionProperties == null) {
549
            this.connectionProperties = new Properties();
550
        } else {
551
            this.connectionProperties = (Properties) connectionProperties.clone();
552
        }
553
        propertySupport.firePropertyChange(PROP_CONNECTIONPROPERTIES, old, connectionProperties);
554
    }
555
    
524
    /** Returns user schema name */
556
    /** Returns user schema name */
525
    @Override
557
    @Override
526
    public String getSchema() {
558
    public String getSchema() {
Lines 784-792 Link Here
784
            throw new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")); // NOI18N
816
            throw new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")); // NOI18N
785
        }
817
        }
786
818
787
        Properties dbprops = new Properties();
819
        Properties dbprops = null;
820
        if(connectionProperties != null) {
821
            dbprops = getConnectionProperties();
822
        } else {
823
            dbprops = new Properties();
824
        }
788
        if ((usr != null) && (usr.length() > 0)) {
825
        if ((usr != null) && (usr.length() > 0)) {
789
            dbprops.put("user", usr); //NOI18N
826
            dbprops.put("user", usr); //NOI18N
827
        }
828
        if ((pwd != null) && (pwd.length() > 0)) {
790
            dbprops.put("password", pwd); //NOI18N
829
            dbprops.put("password", pwd); //NOI18N
791
        }
830
        }
792
831
Lines 864-874 Link Here
864
            sendException(new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")));
903
            sendException(new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")));
865
        }
904
        }
866
905
867
        Properties dbprops = new Properties();
906
        Properties dbprops = null;
868
        if ( usr.length() > 0 ) {
907
        if(connectionProperties != null) {
908
            dbprops = getConnectionProperties();
909
        } else {
910
            dbprops = new Properties();
911
        }
912
        if ((usr != null) && (usr.length() > 0)) {
869
            dbprops.put("user", usr); //NOI18N
913
            dbprops.put("user", usr); //NOI18N
870
        }
914
        }
871
        if ((pwd != null && pwd.length() > 0)) {
915
        if ((pwd != null) && (pwd.length() > 0)) {
872
            dbprops.put("password", pwd); //NOI18N
916
            dbprops.put("password", pwd); //NOI18N
873
        }
917
        }
874
918
Lines 1057-1065 Link Here
1057
     */
1101
     */
1058
    @Override
1102
    @Override
1059
    public boolean equals(Object obj) {
1103
    public boolean equals(Object obj) {
1060
        if (obj instanceof DBConnection) {
1104
        if (obj instanceof DatabaseConnection) {
1061
            DBConnection conn = (DBConnection) obj;
1105
            DatabaseConnection conn = (DatabaseConnection) obj;
1062
            return toString().equals(conn.toString());
1106
            return toString().equals(conn.toString()) && 
1107
                   connectionProperties.equals(conn.getConnectionProperties());
1063
        }
1108
        }
1064
1109
1065
        return false;
1110
        return false;
Lines 1081-1086 Link Here
1081
            //IGNORE - drvname not stored in 3.6 and earlier
1126
            //IGNORE - drvname not stored in 3.6 and earlier
1082
            //IGNORE - displayName not stored in 6.7 and earlier
1127
            //IGNORE - displayName not stored in 6.7 and earlier
1083
        }
1128
        }
1129
        try {
1130
            connectionProperties = (Properties) in.readObject();
1131
        } catch (Exception ex) {
1132
            //IGNORE - connectionProperties not stored in 7.0 and earlier
1133
        }
1084
1134
1085
        // boston setting/pilsen setting?
1135
        // boston setting/pilsen setting?
1086
        if ((name != null) && (name.equals(DatabaseConnection.SUPPORT))) {
1136
        if ((name != null) && (name.equals(DatabaseConnection.SUPPORT))) {
Lines 1104-1109 Link Here
1104
        out.writeObject(DatabaseConnection.SUPPORT);
1154
        out.writeObject(DatabaseConnection.SUPPORT);
1105
        out.writeObject(drvname);
1155
        out.writeObject(drvname);
1106
        out.writeObject(displayName);
1156
        out.writeObject(displayName);
1157
        out.writeObject(connectionProperties);
1107
    }
1158
    }
1108
1159
1109
    @Override
1160
    @Override
(-)db/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor.java (-1 / +65 lines)
Lines 60-65 Link Here
60
import java.nio.charset.CoderResult;
60
import java.nio.charset.CoderResult;
61
import java.util.LinkedList;
61
import java.util.LinkedList;
62
import java.util.Map;
62
import java.util.Map;
63
import java.util.Properties;
63
import java.util.WeakHashMap;
64
import java.util.WeakHashMap;
64
import java.util.concurrent.ConcurrentHashMap;
65
import java.util.concurrent.ConcurrentHashMap;
65
import java.util.logging.Level;
66
import java.util.logging.Level;
Lines 237-243 Link Here
237
                handler.driverName,
238
                handler.driverName,
238
                handler.connectionUrl,
239
                handler.connectionUrl,
239
                handler.schema,
240
                handler.schema,
240
                handler.user);
241
                handler.user,
242
                handler.connectionProperties);
241
        dbconn.setConnectionFileName(handler.connectionFileName);
243
        dbconn.setConnectionFileName(handler.connectionFileName);
242
        if (handler.displayName != null) {
244
        if (handler.displayName != null) {
243
            dbconn.setDisplayName(handler.displayName);
245
            dbconn.setDisplayName(handler.displayName);
Lines 402-407 Link Here
402
            } else {
404
            } else {
403
                DatabaseConnection.deletePassword(name);
405
                DatabaseConnection.deletePassword(name);
404
            }
406
            }
407
            if(instance.getConnectionProperties() != null) {
408
                Properties p = instance.getConnectionProperties();
409
                for(String key: p.stringPropertyNames()) {
410
                    pw.println("  <connection-property>");
411
                    pw.print("    <name>");
412
                    pw.print(XMLUtil.toElementContent(key));
413
                    pw.println("</name>");
414
                    pw.print("    <value>");
415
                    pw.print(XMLUtil.toElementContent(p.getProperty(key)));
416
                    pw.println("</value>");
417
                    pw.println("  </connection-property>");
418
                }
419
            }
405
            pw.println("</connection>"); //NOI18N
420
            pw.println("</connection>"); //NOI18N
406
        }        
421
        }        
407
    }
422
    }
Lines 418-436 Link Here
418
        private static final String ELEMENT_USER = "user"; // NOI18N
433
        private static final String ELEMENT_USER = "user"; // NOI18N
419
        private static final String ELEMENT_PASSWORD = "password"; // NOI18N
434
        private static final String ELEMENT_PASSWORD = "password"; // NOI18N
420
        private static final String ELEMENT_DISPLAY_NAME = "display-name"; // NOI18N
435
        private static final String ELEMENT_DISPLAY_NAME = "display-name"; // NOI18N
436
        private static final String ELEMENT_CONNECTION_PROPERTY = "connection-property"; // NOI18N
437
        private static final String ELEMENT_CONNECTION_PROPERTY_NAME = "name"; // NOI18N
438
        private static final String ELEMENT_CONNECTION_PROPERTY_VALUE = "value"; // NOI18N
421
        private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N
439
        private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N
422
        
440
        
423
        final String connectionFileName;
441
        final String connectionFileName;
424
        
442
        
443
        private boolean readingProperty = false;
444
        private String propertyName;
445
        private String propertyValue;
446
        private StringBuilder buffer = new StringBuilder();
447
        
425
        String driverClass;
448
        String driverClass;
426
        String driverName;
449
        String driverName;
427
        String connectionUrl;
450
        String connectionUrl;
428
        String schema;
451
        String schema;
429
        String user;
452
        String user;
430
        String displayName;
453
        String displayName;
454
        Properties connectionProperties;
431
        
455
        
432
        public Handler(String connectionFileName) {
456
        public Handler(String connectionFileName) {
433
            this.connectionFileName = connectionFileName;
457
            this.connectionFileName = connectionFileName;
458
            this.connectionProperties = new Properties();
434
        }
459
        }
435
460
436
        @Override
461
        @Override
Lines 441-446 Link Here
441
        public void endDocument() throws SAXException {
466
        public void endDocument() throws SAXException {
442
        }
467
        }
443
468
469
        
470
        
444
        @Override
471
        @Override
445
        @SuppressWarnings("deprecation") // Backward compatibility
472
        @SuppressWarnings("deprecation") // Backward compatibility
446
        public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
473
        public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
Lines 457-462 Link Here
457
                user = value;
484
                user = value;
458
            } else if (ELEMENT_DISPLAY_NAME.equals(qName)) {
485
            } else if (ELEMENT_DISPLAY_NAME.equals(qName)) {
459
                displayName = value;
486
                displayName = value;
487
            } else if (ELEMENT_CONNECTION_PROPERTY.equals(qName)) {
488
                readingProperty = true;
489
                propertyName = "";
490
                propertyValue = "";
491
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_NAME.equals(qName)) {
492
                buffer.setLength(0);
493
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_VALUE.equals(qName)) {
494
                buffer.setLength(0);
460
            } else if (ELEMENT_PASSWORD.equals(qName)) {
495
            } else if (ELEMENT_PASSWORD.equals(qName)) {
461
                // reading old settings
496
                // reading old settings
462
                byte[] bytes = null;
497
                byte[] bytes = null;
Lines 482-489 Link Here
482
                }
517
                }
483
            }
518
            }
484
        }
519
        }
520
521
        @Override
522
        public void ignorableWhitespace(char[] chars, int start, int length) throws SAXException {
523
            if(readingProperty) {
524
                buffer.append(chars, start, length);
485
    }
525
    }
526
        }
486
    
527
    
528
        @Override
529
        public void characters(char[] chars, int start, int length) throws SAXException {
530
            if(readingProperty) {
531
                buffer.append(chars, start, length);
532
            }
533
        }
534
535
        @Override
536
        public void endElement(String uri, String localName, String qName) throws SAXException {
537
            if (readingProperty && ELEMENT_CONNECTION_PROPERTY.equals(qName)) {
538
                connectionProperties.put(propertyName, propertyValue);
539
                readingProperty = false;
540
                propertyName = "";
541
                propertyValue = "";
542
                buffer.setLength(0);
543
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_NAME.equals(qName)) {
544
                propertyName = buffer.toString();
545
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_VALUE.equals(qName)) {
546
                propertyValue = buffer.toString();
547
            }
548
        }
549
    }
550
    
487
    private final class PCL implements PropertyChangeListener, Runnable {
551
    private final class PCL implements PropertyChangeListener, Runnable {
488
        
552
        
489
        /**
553
        /**
(-)db/src/org/netbeans/modules/db/explorer/node/ConnectionNode.java (+8 lines)
Lines 48-53 Link Here
48
import java.io.IOException;
48
import java.io.IOException;
49
import java.sql.Connection;
49
import java.sql.Connection;
50
import java.sql.DatabaseMetaData;
50
import java.sql.DatabaseMetaData;
51
import java.util.Properties;
51
import org.netbeans.api.db.explorer.DatabaseException;
52
import org.netbeans.api.db.explorer.DatabaseException;
52
import org.netbeans.api.db.explorer.DatabaseMetaDataTransfer;
53
import org.netbeans.api.db.explorer.DatabaseMetaDataTransfer;
53
import org.netbeans.modules.db.explorer.DatabaseConnection;
54
import org.netbeans.modules.db.explorer.DatabaseConnection;
Lines 61-66 Link Here
61
import org.netbeans.modules.db.explorer.DatabaseMetaDataTransferAccessor;
62
import org.netbeans.modules.db.explorer.DatabaseMetaDataTransferAccessor;
62
import org.netbeans.modules.db.metadata.model.api.MetadataModel;
63
import org.netbeans.modules.db.metadata.model.api.MetadataModel;
63
import org.netbeans.modules.db.metadata.model.api.MetadataModels;
64
import org.netbeans.modules.db.metadata.model.api.MetadataModels;
65
import org.netbeans.modules.db.util.PropertiesEditor;
66
import org.openide.nodes.PropertySupport;
64
import org.openide.util.Exceptions;
67
import org.openide.util.Exceptions;
65
import org.openide.util.HelpCtx;
68
import org.openide.util.HelpCtx;
66
import org.openide.util.NbBundle;
69
import org.openide.util.NbBundle;
Lines 149-154 Link Here
149
            connection.setDisplayName(val.toString());
152
            connection.setDisplayName(val.toString());
150
            setDisplayName(val.toString());
153
            setDisplayName(val.toString());
151
            refreshNode = false;
154
            refreshNode = false;
155
        } else if (nps.getName().equals(CONNECTIONPROPERTIES)) {
156
            connection.setConnectionProperties((Properties) val);
152
        }
157
        }
153
158
154
        if (refreshNode) {
159
        if (refreshNode) {
Lines 168-173 Link Here
168
            addProperty(USER, USERDESC, String.class, !connected, connection.getUser());
173
            addProperty(USER, USERDESC, String.class, !connected, connection.getUser());
169
            addProperty(REMEMBERPW, REMEMBERPWDESC,
174
            addProperty(REMEMBERPW, REMEMBERPWDESC,
170
                    Boolean.class, !connected, connection.rememberPassword());
175
                    Boolean.class, !connected, connection.rememberPassword());
176
            PropertySupport ps = addProperty(CONNECTIONPROPERTIES, CONNECTIONPROPERTIESDESC, Properties.class, ! connected, connection.getConnectionProperties());
177
            ps.setValue("canEditAsText", Boolean.FALSE);
178
            ps.setValue(NodePropertySupport.CUSTOM_EDITOR, PropertiesEditor.class);
171
179
172
            if (connected) {
180
            if (connected) {
173
                Specification spec = connection.getConnector().getDatabaseSpecification();
181
                Specification spec = connection.getConnector().getDatabaseSpecification();
(-)db/src/org/netbeans/modules/db/explorer/node/NodePropertySupport.java (+40 lines)
Lines 42-47 Link Here
42
42
43
package org.netbeans.modules.db.explorer.node;
43
package org.netbeans.modules.db.explorer.node;
44
44
45
import java.beans.PropertyEditor;
45
import java.lang.reflect.InvocationTargetException;
46
import java.lang.reflect.InvocationTargetException;
46
import org.netbeans.api.db.explorer.node.BaseNode;
47
import org.netbeans.api.db.explorer.node.BaseNode;
47
import org.openide.nodes.PropertySupport;
48
import org.openide.nodes.PropertySupport;
Lines 51-56 Link Here
51
 * @author Rob Englander
52
 * @author Rob Englander
52
 */
53
 */
53
public class NodePropertySupport extends PropertySupport {
54
public class NodePropertySupport extends PropertySupport {
55
    public static final String CUSTOM_EDITOR = "NodePropertySupport.customEditor";
56
    public static final String NODE = "NodePropertySupport.Node";
54
57
55
    private BaseNode node;
58
    private BaseNode node;
56
    private String key;
59
    private String key;
Lines 59-64 Link Here
59
        super(name, type, displayName, shortDescription, true, writable);
62
        super(name, type, displayName, shortDescription, true, writable);
60
        key = name;
63
        key = name;
61
        this.node = node;
64
        this.node = node;
65
        setValue(NODE, node);
62
    }
66
    }
63
67
64
    @Override
68
    @Override
Lines 76-79 Link Here
76
        node.setPropertyValue(this, val);
80
        node.setPropertyValue(this, val);
77
    }
81
    }
78
82
83
    
84
    /**
85
     * PropertyEditor can be set via setValue - it can be either instanciated
86
     * or a Class, that has a Default-Constructor and results in an object,
87
     * that implements PropertyEditor
88
     * 
89
     * @return 
90
     */
91
    @Override
92
    public PropertyEditor getPropertyEditor() {
93
        PropertyEditor result = null;
94
        Object potentialEditor = getValue(CUSTOM_EDITOR);
95
96
        if( potentialEditor instanceof PropertyEditor) {
97
            result = (PropertyEditor) potentialEditor;
98
        } else if (potentialEditor instanceof Class) {
99
            try {
100
                potentialEditor = ((Class) potentialEditor).newInstance();
101
                if( ! (potentialEditor instanceof PropertyEditor)) {
102
                    throw new IllegalArgumentException(
103
                            "Editor class does not derive from property editor");
79
}
104
}
105
                return (PropertyEditor) potentialEditor;
106
            } catch (InstantiationException ex) {
107
                throw new RuntimeException(ex);
108
            } catch (IllegalAccessException ex) {
109
                throw new RuntimeException(ex);
110
            }
111
        }
112
113
        if(result == null) {
114
            result = super.getPropertyEditor();
115
        }
116
        
117
        return result;
118
    }
119
}
(-)db/src/org/netbeans/modules/db/util/Bundle.properties (+6 lines)
Lines 71-73 Link Here
71
<TNSNAME>=TNS Name
71
<TNSNAME>=TNS Name
72
<ADDITIONAL>=Additional Properties
72
<ADDITIONAL>=Additional Properties
73
ErrorInfoPanel.iconLabel.text=
73
ErrorInfoPanel.iconLabel.text=
74
75
NoPropertiesSet=No properties set
76
PropertiesCustomEditor.addRowButton.text=Add Property
77
PropertiesCustomEditor.removeRowButton.text=Remove Property
78
PropertiesCustomEditor.propertyTable.columnModel.title0=Property
79
PropertiesCustomEditor.propertyTable.columnModel.title1=Value
(-)db/src/org/netbeans/modules/db/util/PropertiesCustomEditor.form (+97 lines)
Line 0 Link Here
1
<?xml version="1.1" encoding="UTF-8" ?>
2
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
5
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
6
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
7
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
8
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
9
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
10
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
11
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
12
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
13
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
14
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
15
  </AuxValues>
16
17
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
18
  <SubComponents>
19
    <Container class="javax.swing.JPanel" name="buttonPanel">
20
      <Constraints>
21
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
22
          <BorderConstraints direction="Last"/>
23
        </Constraint>
24
      </Constraints>
25
26
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
27
        <Property name="alignment" type="int" value="2"/>
28
      </Layout>
29
      <SubComponents>
30
        <Component class="javax.swing.JButton" name="addRowButton">
31
          <Properties>
32
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
33
              <ResourceString bundle="org/netbeans/modules/db/util/Bundle.properties" key="PropertiesCustomEditor.addRowButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
34
            </Property>
35
          </Properties>
36
          <Events>
37
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addRowButtonActionPerformed"/>
38
          </Events>
39
        </Component>
40
        <Component class="javax.swing.JButton" name="removeRowButton">
41
          <Properties>
42
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
43
              <ResourceString bundle="org/netbeans/modules/db/util/Bundle.properties" key="PropertiesCustomEditor.removeRowButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
44
            </Property>
45
          </Properties>
46
          <Events>
47
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeRowButtonActionPerformed"/>
48
          </Events>
49
        </Component>
50
      </SubComponents>
51
    </Container>
52
    <Container class="javax.swing.JScrollPane" name="propertyScrollPane">
53
      <AuxValues>
54
        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
55
      </AuxValues>
56
      <Constraints>
57
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
58
          <BorderConstraints direction="Center"/>
59
        </Constraint>
60
      </Constraints>
61
62
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
63
      <SubComponents>
64
        <Component class="javax.swing.JTable" name="propertyTable">
65
          <Properties>
66
            <Property name="autoCreateRowSorter" type="boolean" value="true"/>
67
            <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
68
              <Connection code="new javax.swing.table.DefaultTableModel(&#xa;    new Object [][] {&#xa;&#xa;    },&#xa;    new String [] {&#xa;        &quot;Property&quot;, &quot;Value&quot;&#xa;    }&#xa;) {&#xa;    Class[] types = new Class [] {&#xa;        java.lang.String.class, java.lang.String.class&#xa;    };&#xa;&#xa;    public Class getColumnClass(int columnIndex) {&#xa;        return types [columnIndex];&#xa;    }&#xa;&#xa;    public boolean isCellEditable(int rowIndex, int columnIndex) {&#xa;        return PropertiesCustomEditor.this.editor.isEditable();&#xa;    }&#xa;}" type="code"/>
69
            </Property>
70
            <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
71
              <TableColumnModel selectionModel="3">
72
                <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
73
                  <Title editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
74
                    <ResourceString bundle="org/netbeans/modules/db/util/Bundle.properties" key="PropertiesCustomEditor.propertyTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
75
                  </Title>
76
                  <Editor/>
77
                  <Renderer/>
78
                </Column>
79
                <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
80
                  <Title editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
81
                    <ResourceString bundle="org/netbeans/modules/db/util/Bundle.properties" key="PropertiesCustomEditor.propertyTable.columnModel.title1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
82
                  </Title>
83
                  <Editor/>
84
                  <Renderer/>
85
                </Column>
86
              </TableColumnModel>
87
            </Property>
88
            <Property name="columnSelectionAllowed" type="boolean" value="true"/>
89
            <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
90
              <TableHeader reorderingAllowed="true" resizingAllowed="true"/>
91
            </Property>
92
          </Properties>
93
        </Component>
94
      </SubComponents>
95
    </Container>
96
  </SubComponents>
97
</Form>
(-)db/src/org/netbeans/modules/db/util/PropertiesCustomEditor.java (+240 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
43
/*
44
 * PropertiesCustomEditor.java
45
 *
46
 * Created on 01.04.2011, 20:25:24
47
 */
48
package org.netbeans.modules.db.util;
49
50
import java.util.Arrays;
51
import java.util.Properties;
52
import java.util.Vector;
53
import javax.swing.event.ListSelectionEvent;
54
import javax.swing.event.ListSelectionListener;
55
import javax.swing.event.TableModelEvent;
56
import javax.swing.event.TableModelListener;
57
import javax.swing.table.DefaultTableModel;
58
import javax.swing.table.TableModel;
59
60
/**
61
 * Custom implentation for a property editor, as the build in doesn't work to
62
 * well with international characters
63
 * 
64
 * @author Matthias Bläsing
65
 */
66
public class PropertiesCustomEditor extends javax.swing.JPanel {
67
    PropertiesEditor editor;
68
    boolean updateing;
69
    
70
    public PropertiesCustomEditor(final PropertiesEditor editor) {
71
        initComponents();
72
        this.editor = editor;
73
        updateTableFromEditor();
74
        final TableModel tm = propertyTable.getModel();
75
        tm.addTableModelListener(new TableModelListener() {
76
            @Override
77
            public void tableChanged(TableModelEvent tme) {
78
                synchronized (PropertiesCustomEditor.this) {
79
                    if (updateing) {
80
                        return;
81
                    }
82
                    updateing = true;
83
                    Properties p = new Properties();
84
                    for(int i = 0; i < tm.getRowCount(); i++) {
85
                        p.setProperty((String) tm.getValueAt(i, 0), (String) tm.getValueAt(i, 1));
86
                    }
87
                    editor.setValue(p);
88
                    updateing = false;
89
                }
90
            }
91
        });
92
        propertyTable.getSelectionModel().addListSelectionListener( 
93
            new ListSelectionListener() {
94
                @Override
95
                public void valueChanged(ListSelectionEvent lse) {
96
                    updateRemoveButtonSensible();
97
                }
98
            }
99
        );
100
        updateAddButtonSensible();
101
        updateRemoveButtonSensible();
102
    }
103
    
104
    private void updateAddButtonSensible() {
105
        if( editor.isEditable() ) {
106
            addRowButton.setEnabled(true);
107
        } else {
108
            addRowButton.setEnabled(false);
109
        }
110
    }
111
    
112
    private void updateRemoveButtonSensible() {
113
        if (editor.isEditable() && propertyTable.getSelectedRowCount() > 0) {
114
            removeRowButton.setEnabled(true);
115
        } else {
116
            removeRowButton.setEnabled(false);
117
        }
118
    }
119
    
120
    @SuppressWarnings("unchecked")
121
    private void updateTableFromEditor() {
122
        synchronized (this) {
123
            if (updateing) {
124
                return;
125
            }
126
            updateing = true;
127
            Properties p = (Properties) editor.getValue();
128
            DefaultTableModel dtm = (DefaultTableModel) propertyTable.getModel();
129
            Vector columns = new Vector(2);
130
            Vector values = new Vector();
131
            columns.add(dtm.getColumnName(0));
132
            columns.add(dtm.getColumnName(1));
133
            for (String key : p.stringPropertyNames()) {
134
                Vector row = new Vector(2);
135
                row.add(key);
136
                row.add(p.getProperty(key, ""));
137
                values.add(row);
138
            }
139
            dtm.setDataVector(values, columns);
140
            updateing = false;
141
        }
142
    }
143
144
    /** This method is called from within the constructor to
145
     * initialize the form.
146
     * WARNING: Do NOT modify this code. The content of this method is
147
     * always regenerated by the Form Editor.
148
     */
149
    @SuppressWarnings("unchecked")
150
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
151
    private void initComponents() {
152
153
        buttonPanel = new javax.swing.JPanel();
154
        addRowButton = new javax.swing.JButton();
155
        removeRowButton = new javax.swing.JButton();
156
        propertyScrollPane = new javax.swing.JScrollPane();
157
        propertyTable = new javax.swing.JTable();
158
159
        setLayout(new java.awt.BorderLayout());
160
161
        buttonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
162
163
        addRowButton.setText(org.openide.util.NbBundle.getMessage(PropertiesCustomEditor.class, "PropertiesCustomEditor.addRowButton.text")); // NOI18N
164
        addRowButton.addActionListener(new java.awt.event.ActionListener() {
165
            public void actionPerformed(java.awt.event.ActionEvent evt) {
166
                addRowButtonActionPerformed(evt);
167
            }
168
        });
169
        buttonPanel.add(addRowButton);
170
171
        removeRowButton.setText(org.openide.util.NbBundle.getMessage(PropertiesCustomEditor.class, "PropertiesCustomEditor.removeRowButton.text")); // NOI18N
172
        removeRowButton.addActionListener(new java.awt.event.ActionListener() {
173
            public void actionPerformed(java.awt.event.ActionEvent evt) {
174
                removeRowButtonActionPerformed(evt);
175
            }
176
        });
177
        buttonPanel.add(removeRowButton);
178
179
        add(buttonPanel, java.awt.BorderLayout.PAGE_END);
180
181
        propertyTable.setAutoCreateRowSorter(true);
182
        propertyTable.setModel(new javax.swing.table.DefaultTableModel(
183
            new Object [][] {
184
185
            },
186
            new String [] {
187
                "Property", "Value"
188
            }
189
        ) {
190
            Class[] types = new Class [] {
191
                java.lang.String.class, java.lang.String.class
192
            };
193
194
            public Class getColumnClass(int columnIndex) {
195
                return types [columnIndex];
196
            }
197
198
            public boolean isCellEditable(int rowIndex, int columnIndex) {
199
                return PropertiesCustomEditor.this.editor.isEditable();
200
            }
201
        });
202
        propertyTable.setColumnSelectionAllowed(true);
203
        propertyScrollPane.setViewportView(propertyTable);
204
        propertyTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
205
        propertyTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(PropertiesCustomEditor.class, "PropertiesCustomEditor.propertyTable.columnModel.title0")); // NOI18N
206
        propertyTable.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle.getMessage(PropertiesCustomEditor.class, "PropertiesCustomEditor.propertyTable.columnModel.title1")); // NOI18N
207
208
        add(propertyScrollPane, java.awt.BorderLayout.CENTER);
209
    }// </editor-fold>//GEN-END:initComponents
210
211
    private void addRowButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRowButtonActionPerformed
212
        DefaultTableModel dtm = (DefaultTableModel) propertyTable.getModel();
213
        dtm.addRow(new Object[] {"", ""});
214
    }//GEN-LAST:event_addRowButtonActionPerformed
215
216
    private void removeRowButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeRowButtonActionPerformed
217
        int[] viewRows = propertyTable.getSelectedRows();
218
        int[] modelRows = new int[viewRows.length];
219
        
220
        for(int i = 0; i < viewRows.length; i++) {
221
            modelRows[i] = propertyTable.convertRowIndexToModel(viewRows[i]);
222
        }
223
        
224
        Arrays.sort(modelRows);
225
        
226
        DefaultTableModel dtm = (DefaultTableModel) propertyTable.getModel();
227
        
228
        for(int i = modelRows.length - 1; i >= 0; i--) {
229
            dtm.removeRow(modelRows[i]);
230
        }
231
    }//GEN-LAST:event_removeRowButtonActionPerformed
232
233
    // Variables declaration - do not modify//GEN-BEGIN:variables
234
    private javax.swing.JButton addRowButton;
235
    private javax.swing.JPanel buttonPanel;
236
    private javax.swing.JScrollPane propertyScrollPane;
237
    private javax.swing.JTable propertyTable;
238
    private javax.swing.JButton removeRowButton;
239
    // End of variables declaration//GEN-END:variables
240
}
(-)db/src/org/netbeans/modules/db/util/PropertiesEditor.java (+102 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.db.util;
43
44
import java.beans.FeatureDescriptor;
45
import java.beans.PropertyEditorSupport;
46
import java.util.Properties;
47
import org.openide.explorer.propertysheet.ExPropertyEditor;
48
import org.openide.explorer.propertysheet.PropertyEnv;
49
import org.openide.nodes.Node;
50
import org.openide.util.NbBundle;
51
52
/**
53
 * Custom editor for properties - mainly exists to call custom editor
54
 * 
55
 * @author Matthias Bläsing
56
 */
57
public class PropertiesEditor extends PropertyEditorSupport implements ExPropertyEditor {
58
    private boolean canWrite = true;
59
    
60
    @Override
61
    public String getAsText() {
62
        Properties value = (Properties) getValue();
63
        if(value == null || value.size() == 0) {
64
            return NbBundle.getMessage(PropertiesEditor.class, "NoPropertiesSet");
65
        } else {
66
            return value.toString();
67
        }
68
    }
69
70
    /** Can't be called and throws IllegalArgumentException */
71
    @Override
72
    public void setAsText(String text) throws IllegalArgumentException {
73
        throw new IllegalArgumentException("Can't be set by setAsText");
74
    }
75
76
    @Override
77
    public String getJavaInitializationString() {
78
        return null; // does not generate any code
79
    }
80
81
    @Override
82
    public boolean supportsCustomEditor() {
83
        return true;
84
    }
85
86
    @Override
87
    public java.awt.Component getCustomEditor() {
88
        return new PropertiesCustomEditor(this);
89
    }
90
91
    @Override
92
    public void attachEnv(PropertyEnv env) {
93
        FeatureDescriptor d = env.getFeatureDescriptor();
94
        if (d instanceof Node.Property) {
95
            canWrite = ((Node.Property) d).canWrite();
96
        }
97
    }
98
99
    public boolean isEditable() {
100
        return canWrite;
101
    }
102
}
(-)db/test/unit/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertorTest.java (-1 / +1 lines)
Lines 144-150 Link Here
144
    }
144
    }
145
    
145
    
146
    public void testSaveOnPropertyChange() throws Exception {
146
    public void testSaveOnPropertyChange() throws Exception {
147
        DatabaseConnection dbconn = new DatabaseConnection("a", "b", "c", "d", "e", null);
147
        DatabaseConnection dbconn = new DatabaseConnection("a", "b", "c", "d", "e", (String) null);
148
        FileObject fo = DatabaseConnectionConvertor.create(dbconn).getPrimaryFile();
148
        FileObject fo = DatabaseConnectionConvertor.create(dbconn).getPrimaryFile();
149
        
149
        
150
        class FCL extends FileChangeAdapter {
150
        class FCL extends FileChangeAdapter {

Return to bug 197408