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

(-)nb.orig/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
}
(-)nb.orig/db/src/org/netbeans/api/db/explorer/node/BaseNode.java (-1 / +11 lines)
Lines 52-57 Link Here
52
import javax.swing.event.ChangeListener;
52
import javax.swing.event.ChangeListener;
53
import org.netbeans.modules.db.explorer.action.ActionRegistry;
53
import org.netbeans.modules.db.explorer.action.ActionRegistry;
54
import org.netbeans.modules.db.explorer.node.NodeDataLookup;
54
import org.netbeans.modules.db.explorer.node.NodeDataLookup;
55
import org.netbeans.modules.db.explorer.node.NodePropertiesPropertySupport;
55
import org.netbeans.modules.db.explorer.node.NodePropertySupport;
56
import org.netbeans.modules.db.explorer.node.NodePropertySupport;
56
import org.netbeans.modules.db.explorer.node.NodeRegistry;
57
import org.netbeans.modules.db.explorer.node.NodeRegistry;
57
import org.openide.nodes.AbstractNode;
58
import org.openide.nodes.AbstractNode;
Lines 117-122 Link Here
117
    protected static final String FKREFERREDTABLEDESC = "ReferredFKTable"; // NOI18N
118
    protected static final String FKREFERREDTABLEDESC = "ReferredFKTable"; // NOI18N
118
    protected static final String FKREFERREDCOLUMN = "ReferredFKColumn"; // NOI18N
119
    protected static final String FKREFERREDCOLUMN = "ReferredFKColumn"; // NOI18N
119
    protected static final String FKREFERREDCOLUMNDESC = "ReferredFKColumn"; // NOI18N
120
    protected static final String FKREFERREDCOLUMNDESC = "ReferredFKColumn"; // NOI18N
121
    protected static final String CONNECTIONPROPERTIES = "ConnectionProperties";
122
    protected static final String CONNECTIONPROPERTIESDESC = "ConnectionPropertiesDescription";
120
123
121
    private final NodeDataLookup dataLookup;
124
    private final NodeDataLookup dataLookup;
122
    private final ActionRegistry actionRegistry;
125
    private final ActionRegistry actionRegistry;
Lines 290-296 Link Here
290
        } else {
293
        } else {
291
            propDesc = NbBundle.getMessage (BaseNode.class, desc);
294
            propDesc = NbBundle.getMessage (BaseNode.class, desc);
292
        }
295
        }
293
        PropertySupport ps = new NodePropertySupport(this, name, clazz, propName, propDesc, writeable);
296
297
        PropertySupport ps;
298
        
299
        if(java.util.Properties.class.isAssignableFrom(clazz)) {
300
            ps = new NodePropertiesPropertySupport(this, name, clazz, propName, propDesc, writeable);
301
        } else {
302
            ps = new NodePropertySupport(this, name, clazz, propName, propDesc, writeable);
303
        }
294
        props.add(ps);
304
        props.add(ps);
295
        propMap.put(ps.getName(), value);
305
        propMap.put(ps.getName(), value);
296
306
(-)nb.orig/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
(-)nb.orig/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 239-245 Link Here
239
                handler.driverName,
240
                handler.driverName,
240
                handler.connectionUrl,
241
                handler.connectionUrl,
241
                handler.schema,
242
                handler.schema,
242
                handler.user);
243
                handler.user,
244
                handler.connectionProperties);
243
        dbconn.setConnectionFileName(handler.connectionFileName);
245
        dbconn.setConnectionFileName(handler.connectionFileName);
244
        if (handler.displayName != null) {
246
        if (handler.displayName != null) {
245
            dbconn.setDisplayName(handler.displayName);
247
            dbconn.setDisplayName(handler.displayName);
Lines 408-413 Link Here
408
                LOGGER.log(Level.FINE, "Deleting password for " + name);
410
                LOGGER.log(Level.FINE, "Deleting password for " + name);
409
                Keyring.delete(name);
411
                Keyring.delete(name);
410
            }
412
            }
413
            if(instance.getConnectionProperties() != null) {
414
                Properties p = instance.getConnectionProperties();
415
                for(String key: p.stringPropertyNames()) {
416
                    pw.println("  <connection-property>");
417
                    pw.print("    <name>");
418
                    pw.print(XMLUtil.toElementContent(key));
419
                    pw.println("</name>");
420
                    pw.print("    <value>");
421
                    pw.print(XMLUtil.toElementContent(p.getProperty(key)));
422
                    pw.println("</value>");
423
                    pw.println("  </connection-property>");
424
                }
425
            }
411
            pw.println("</connection>"); //NOI18N
426
            pw.println("</connection>"); //NOI18N
412
        }        
427
        }        
413
    }
428
    }
Lines 424-442 Link Here
424
        private static final String ELEMENT_USER = "user"; // NOI18N
439
        private static final String ELEMENT_USER = "user"; // NOI18N
425
        private static final String ELEMENT_PASSWORD = "password"; // NOI18N
440
        private static final String ELEMENT_PASSWORD = "password"; // NOI18N
426
        private static final String ELEMENT_DISPLAY_NAME = "display-name"; // NOI18N
441
        private static final String ELEMENT_DISPLAY_NAME = "display-name"; // NOI18N
442
        private static final String ELEMENT_CONNECTION_PROPERTY = "connection-property"; // NOI18N
443
        private static final String ELEMENT_CONNECTION_PROPERTY_NAME = "name"; // NOI18N
444
        private static final String ELEMENT_CONNECTION_PROPERTY_VALUE = "value"; // NOI18N
427
        private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N
445
        private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N
428
        
446
        
429
        final String connectionFileName;
447
        final String connectionFileName;
430
        
448
        
449
        private boolean readingProperty = false;
450
        private String propertyName;
451
        private String propertyValue;
452
        private StringBuilder buffer = new StringBuilder();
453
        
431
        String driverClass;
454
        String driverClass;
432
        String driverName;
455
        String driverName;
433
        String connectionUrl;
456
        String connectionUrl;
434
        String schema;
457
        String schema;
435
        String user;
458
        String user;
436
        String displayName;
459
        String displayName;
460
        Properties connectionProperties;
437
        
461
        
438
        public Handler(String connectionFileName) {
462
        public Handler(String connectionFileName) {
439
            this.connectionFileName = connectionFileName;
463
            this.connectionFileName = connectionFileName;
464
            this.connectionProperties = new Properties();
440
        }
465
        }
441
466
442
        @Override
467
        @Override
Lines 447-452 Link Here
447
        public void endDocument() throws SAXException {
472
        public void endDocument() throws SAXException {
448
        }
473
        }
449
474
475
        
476
        
450
        @Override
477
        @Override
451
        @SuppressWarnings("deprecation") // Backward compatibility
478
        @SuppressWarnings("deprecation") // Backward compatibility
452
        public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
479
        public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
Lines 463-468 Link Here
463
                user = value;
490
                user = value;
464
            } else if (ELEMENT_DISPLAY_NAME.equals(qName)) {
491
            } else if (ELEMENT_DISPLAY_NAME.equals(qName)) {
465
                displayName = value;
492
                displayName = value;
493
            } else if (ELEMENT_CONNECTION_PROPERTY.equals(qName)) {
494
                readingProperty = true;
495
                propertyName = "";
496
                propertyValue = "";
497
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_NAME.equals(qName)) {
498
                buffer.setLength(0);
499
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_VALUE.equals(qName)) {
500
                buffer.setLength(0);
466
            } else if (ELEMENT_PASSWORD.equals(qName)) {
501
            } else if (ELEMENT_PASSWORD.equals(qName)) {
467
                // reading old settings
502
                // reading old settings
468
                byte[] bytes = null;
503
                byte[] bytes = null;
Lines 491-496 Link Here
491
                }
526
                }
492
            }
527
            }
493
        }
528
        }
529
530
        @Override
531
        public void ignorableWhitespace(char[] chars, int start, int length) throws SAXException {
532
            if(readingProperty) {
533
                buffer.append(chars, start, length);
534
            }
535
        }
536
        
537
        @Override
538
        public void characters(char[] chars, int start, int length) throws SAXException {
539
            if(readingProperty) {
540
                buffer.append(chars, start, length);
541
            }
542
        }
543
544
        @Override
545
        public void endElement(String uri, String localName, String qName) throws SAXException {
546
            if (readingProperty && ELEMENT_CONNECTION_PROPERTY.equals(qName)) {
547
                connectionProperties.put(propertyName, propertyValue);
548
                readingProperty = false;
549
                propertyName = "";
550
                propertyValue = "";
551
                buffer.setLength(0);
552
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_NAME.equals(qName)) {
553
                propertyName = buffer.toString();
554
            } else if (readingProperty && ELEMENT_CONNECTION_PROPERTY_VALUE.equals(qName)) {
555
                propertyValue = buffer.toString();
556
            }
557
        }
494
    }
558
    }
495
    
559
    
496
    private final class PCL implements PropertyChangeListener, Runnable {
560
    private final class PCL implements PropertyChangeListener, Runnable {
(-)nb.orig/db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java (-10 / +61 lines)
Lines 164-169 Link Here
164
     */
164
     */
165
    private MetadataModel metadataModel = null;
165
    private MetadataModel metadataModel = null;
166
166
167
    /** Properties for connection
168
     */
169
    private Properties connectionProperties = new Properties();
170
167
    /**
171
    /**
168
     * The API DatabaseConnection (delegates to this instance)
172
     * The API DatabaseConnection (delegates to this instance)
169
     */
173
     */
Lines 181-186 Link Here
181
    public static final String PROP_DRIVERNAME = "drivername"; //NOI18N
185
    public static final String PROP_DRIVERNAME = "drivername"; //NOI18N
182
    public static final String PROP_NAME = "name"; //NOI18N
186
    public static final String PROP_NAME = "name"; //NOI18N
183
    public static final String PROP_DISPLAY_NAME = "displayName"; //NOI18N
187
    public static final String PROP_DISPLAY_NAME = "displayName"; //NOI18N
188
    public static final String PROP_CONNECTIONPROPERTIES = "connectionProperties";
184
    public static final String DRIVER_CLASS_NET = "org.apache.derby.jdbc.ClientDriver"; // NOI18N
189
    public static final String DRIVER_CLASS_NET = "org.apache.derby.jdbc.ClientDriver"; // NOI18N
185
    public static final int DERBY_UNICODE_ERROR_CODE = 20000;
190
    public static final int DERBY_UNICODE_ERROR_CODE = 20000;
186
    private OpenConnectionInterface openConnection = null;
191
    private OpenConnectionInterface openConnection = null;
Lines 217-238 Link Here
217
     * @param password User password
222
     * @param password User password
218
     */
223
     */
219
    public DatabaseConnection(String driver, String database, String user, String password) {
224
    public DatabaseConnection(String driver, String database, String user, String password) {
220
        this(driver, null, database, null, user, password, null);
225
        this(driver, null, database, null, user, password, null, null);
221
    }
226
    }
222
227
223
    public DatabaseConnection(String driver, String driverName, String database,
228
    public DatabaseConnection(String driver, String driverName, String database,
224
            String theschema, String user, String password) {
229
            String theschema, String user, String password) {
225
        this(driver, driverName, database, theschema, user, password, null);
230
        this(driver, driverName, database, theschema, user, password, null, null);
226
    }
231
    }
227
232
228
    public DatabaseConnection(String driver, String driverName, String database, 
233
    public DatabaseConnection(String driver, String driverName, String database, 
229
            String theschema, String user) {
234
            String theschema, String user) {
230
        this(driver, driverName, database, theschema, user, null, null);
235
        this(driver, driverName, database, theschema, user, null, null, null);
236
    }
237
    
238
    public DatabaseConnection(String driver, String driverName, String database, 
239
            String theschema, String user, Properties connectionProperties) {
240
        this(driver, driverName, database, theschema, user, null, null, connectionProperties);
231
    }
241
    }
232
242
233
    public DatabaseConnection(String driver, String driverName, String database,
243
    public DatabaseConnection(String driver, String driverName, String database,
234
            String theschema, String user, String password,
244
            String theschema, String user, String password,
235
            Boolean rememberPassword) {
245
            Boolean rememberPassword) {
246
        this( driver, driverName, database, theschema, user, password, 
247
              rememberPassword, null);
248
    }
249
250
    public DatabaseConnection(String driver, String driverName, String database,
251
            String theschema, String user, String password,
252
            Boolean rememberPassword, Properties connectionProperties) {
236
        this();
253
        this();
237
        drv = driver;
254
        drv = driver;
238
        drvname = driverName;
255
        drvname = driverName;
Lines 242-247 Link Here
242
        rpwd = rememberPassword == null ? null : Boolean.valueOf(rememberPassword);
259
        rpwd = rememberPassword == null ? null : Boolean.valueOf(rememberPassword);
243
        schema = theschema;
260
        schema = theschema;
244
        name = getName();
261
        name = getName();
262
        setConnectionProperties(connectionProperties);
245
    }
263
    }
246
264
247
    public JDBCDriver findJDBCDriver() {
265
    public JDBCDriver findJDBCDriver() {
Lines 511-516 Link Here
511
        }
529
        }
512
    }
530
    }
513
531
532
    public Properties getConnectionProperties() {
533
        return (Properties) connectionProperties.clone();
534
    }
535
536
    public void setConnectionProperties(Properties connectionProperties) {
537
        Properties old = this.connectionProperties;
538
        if(connectionProperties == null) {
539
            this.connectionProperties = new Properties();
540
        } else {
541
            this.connectionProperties = (Properties) connectionProperties.clone();
542
        }
543
        propertySupport.firePropertyChange(PROP_CONNECTIONPROPERTIES, old, connectionProperties);
544
    }
545
    
514
    /** Returns user schema name */
546
    /** Returns user schema name */
515
    @Override
547
    @Override
516
    public String getSchema() {
548
    public String getSchema() {
Lines 672-680 Link Here
672
            throw new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")); // NOI18N
704
            throw new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")); // NOI18N
673
        }
705
        }
674
706
675
        Properties dbprops = new Properties();
707
        Properties dbprops = null;
708
        if(connectionProperties != null) {
709
            dbprops = getConnectionProperties();
710
        } else {
711
            dbprops = new Properties();
712
        }
676
        if ((usr != null) && (usr.length() > 0)) {
713
        if ((usr != null) && (usr.length() > 0)) {
677
            dbprops.put("user", usr); //NOI18N
714
            dbprops.put("user", usr); //NOI18N
715
        }
716
        if ((pwd != null) && (pwd.length() > 0)) {
678
            dbprops.put("password", pwd); //NOI18N
717
            dbprops.put("password", pwd); //NOI18N
679
        }
718
        }
680
719
Lines 752-762 Link Here
752
            sendException(new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")));
791
            sendException(new DDLException(NbBundle.getMessage(DatabaseConnection.class, "EXC_InsufficientConnInfo")));
753
        }
792
        }
754
793
755
        Properties dbprops = new Properties();
794
        Properties dbprops = null;
756
        if ( usr.length() > 0 ) {
795
        if(connectionProperties != null) {
796
            dbprops = getConnectionProperties();
797
        } else {
798
            dbprops = new Properties();
799
        }
800
        if ((usr != null) && (usr.length() > 0)) {
757
            dbprops.put("user", usr); //NOI18N
801
            dbprops.put("user", usr); //NOI18N
758
        }
802
        }
759
        if ((pwd != null && pwd.length() > 0)) {
803
        if ((pwd != null) && (pwd.length() > 0)) {
760
            dbprops.put("password", pwd); //NOI18N
804
            dbprops.put("password", pwd); //NOI18N
761
        }
805
        }
762
806
Lines 945-953 Link Here
945
     */
989
     */
946
    @Override
990
    @Override
947
    public boolean equals(Object obj) {
991
    public boolean equals(Object obj) {
948
        if (obj instanceof DBConnection) {
992
        if (obj instanceof DatabaseConnection) {
949
            DBConnection conn = (DBConnection) obj;
993
            DatabaseConnection conn = (DatabaseConnection) obj;
950
            return toString().equals(conn.toString());
994
            return toString().equals(conn.toString()) && 
995
                   connectionProperties.equals(conn.getConnectionProperties());
951
        }
996
        }
952
997
953
        return false;
998
        return false;
Lines 969-974 Link Here
969
            //IGNORE - drvname not stored in 3.6 and earlier
1014
            //IGNORE - drvname not stored in 3.6 and earlier
970
            //IGNORE - displayName not stored in 6.7 and earlier
1015
            //IGNORE - displayName not stored in 6.7 and earlier
971
        }
1016
        }
1017
        try {
1018
            connectionProperties = (Properties) in.readObject();
1019
        } catch (Exception ex) {
1020
            //IGNORE - displayName not stored in 7.0 and earlier
1021
        }
972
1022
973
        // boston setting/pilsen setting?
1023
        // boston setting/pilsen setting?
974
        if ((name != null) && (name.equals(DatabaseConnection.SUPPORT))) {
1024
        if ((name != null) && (name.equals(DatabaseConnection.SUPPORT))) {
Lines 992-997 Link Here
992
        out.writeObject(DatabaseConnection.SUPPORT);
1042
        out.writeObject(DatabaseConnection.SUPPORT);
993
        out.writeObject(drvname);
1043
        out.writeObject(drvname);
994
        out.writeObject(displayName);
1044
        out.writeObject(displayName);
1045
        out.writeObject(connectionProperties);
995
    }
1046
    }
996
1047
997
    @Override
1048
    @Override
(-)nb.orig/db/src/org/netbeans/modules/db/explorer/node/ConnectionNode.java (+7 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.openide.nodes.PropertySupport;
66
import org.openide.nodes.Sheet;
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 157-162 Link Here
157
    }
162
    }
158
163
159
    private void updateLocalProperties() {
164
    private void updateLocalProperties() {
165
160
        try {
166
        try {
161
            clearProperties();
167
            clearProperties();
162
            boolean connected = !connection.getConnector().isDisconnected();
168
            boolean connected = !connection.getConnector().isDisconnected();
Lines 168-173 Link Here
168
            addProperty(USER, USERDESC, String.class, !connected, connection.getUser());
174
            addProperty(USER, USERDESC, String.class, !connected, connection.getUser());
169
            addProperty(REMEMBERPW, REMEMBERPWDESC,
175
            addProperty(REMEMBERPW, REMEMBERPWDESC,
170
                    Boolean.class, !connected, connection.rememberPassword());
176
                    Boolean.class, !connected, connection.rememberPassword());
177
            addProperty(CONNECTIONPROPERTIES, CONNECTIONPROPERTIESDESC, Properties.class, ! connected, connection.getConnectionProperties());
171
178
172
            if (connected) {
179
            if (connected) {
173
                Specification spec = connection.getConnector().getDatabaseSpecification();
180
                Specification spec = connection.getConnector().getDatabaseSpecification();
(-)nb.orig/db/src/org/netbeans/modules/db/explorer/node/NodePropertiesPropertySupport.java (+66 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 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 2009 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.db.explorer.node;
44
45
import java.beans.PropertyEditor;
46
import java.lang.reflect.InvocationTargetException;
47
import org.netbeans.api.db.explorer.node.BaseNode;
48
import org.netbeans.modules.db.util.PropertiesEditor;
49
50
public class NodePropertiesPropertySupport extends NodePropertySupport {
51
52
    public NodePropertiesPropertySupport(BaseNode node, String name, Class type, String displayName, String shortDescription, boolean writable) {
53
        super(node, name, type, displayName, shortDescription, writable);
54
        setValue("canEditAsText", Boolean.FALSE);
55
    }
56
57
    @Override
58
    public PropertyEditor getPropertyEditor() {
59
        return new PropertiesEditor();
60
    }
61
62
    @Override
63
    public Object getValue() throws IllegalAccessException, InvocationTargetException {
64
        return super.getValue();
65
    }    
66
}
(-)nb.orig/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
(-)nb.orig/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>
(-)nb.orig/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
}
(-)nb.orig/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
}
(-)nb.orig/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