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

(-)a/db/libsrc/org/netbeans/lib/ddl/DBConnection.java (+4 lines)
Lines 100-105 Link Here
100
    * @param name Connection name
100
    * @param name Connection name
101
    */
101
    */
102
    public void setName(String name);
102
    public void setName(String name);
103
104
    public String getDisplayName();
105
106
    public void setDisplayName(String name);
103
    
107
    
104
    /** Returns driver name */
108
    /** Returns driver name */
105
    public String getDriverName();
109
    public String getDriverName();
(-)a/db/src/org/netbeans/api/db/explorer/DatabaseConnection.java (-3 / +3 lines)
Lines 113-119 Link Here
113
     * @param user the username.
113
     * @param user the username.
114
     * @param schema the schema to use, or null for the default schema
114
     * @param schema the schema to use, or null for the default schema
115
     * @param password the password.
115
     * @param password the password.
116
     * @param rememberPassword whether to remeber the password for the current session.
116
     * @param rememberPassword whether to remember the password for the current session.
117
     *
117
     *
118
     * @return the new instance.
118
     * @return the new instance.
119
     *
119
     *
Lines 149-155 Link Here
149
     * Returns the JDBC driver instance that this connection uses.
149
     * Returns the JDBC driver instance that this connection uses.
150
     *
150
     *
151
     * @since 1.32
151
     * @since 1.32
152
     * @return the JDBC driver or null if no driver registred
152
     * @return the JDBC driver or null if no driver registered
153
     */
153
     */
154
    public JDBCDriver getJDBCDriver() {
154
    public JDBCDriver getJDBCDriver() {
155
        return delegate.findJDBCDriver ();
155
        return delegate.findJDBCDriver ();
Lines 206-212 Link Here
206
     * @return the display name
206
     * @return the display name
207
     */
207
     */
208
    public String getDisplayName() {
208
    public String getDisplayName() {
209
        return delegate.getName();
209
        return delegate.getDisplayName();
210
    }
210
    }
211
    
211
    
212
    /**
212
    /**
(-)a/db/src/org/netbeans/api/db/explorer/node/BaseNode.java (+2 lines)
Lines 84-89 Link Here
84
    protected static final String REMEMBERPWDESC = "RememberPasswordDescription"; // NOI18N
84
    protected static final String REMEMBERPWDESC = "RememberPasswordDescription"; // NOI18N
85
    protected static final String CATALOG = "Catalog"; // NOI18N
85
    protected static final String CATALOG = "Catalog"; // NOI18N
86
    protected static final String CATALOGDESC = "CatalogDescription"; // NOI18N
86
    protected static final String CATALOGDESC = "CatalogDescription"; // NOI18N
87
    protected static final String DISPLAYNAME = "DisplayName"; // NOI18N
88
    protected static final String DISPLAYNAMEDESC = "DisplayNameDescription"; // NOI18N
87
    protected static final String UNIQUE = "UniqueNoMnemonic"; // NOI18N
89
    protected static final String UNIQUE = "UniqueNoMnemonic"; // NOI18N
88
    protected static final String UNIQUEDESC = "UniqueDescription"; // NOI18N
90
    protected static final String UNIQUEDESC = "UniqueDescription"; // NOI18N
89
    protected static final String NULL = "Null"; // NOI18N
91
    protected static final String NULL = "Null"; // NOI18N
(-)a/db/src/org/netbeans/api/db/explorer/node/Bundle.properties (+2 lines)
Lines 67-72 Link Here
67
RememberPasswordDescription=Remember password
67
RememberPasswordDescription=Remember password
68
Catalog=Catalog
68
Catalog=Catalog
69
CatalogDescription=Catalog
69
CatalogDescription=Catalog
70
DisplayName=Display name
71
DisplayNameDescription=Display name
70
DefaultCatalog=Default Catalog
72
DefaultCatalog=Default Catalog
71
Schema=Schema
73
Schema=Schema
72
SchemaDescription=Schema
74
SchemaDescription=Schema
(-)a/db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java (-2 / +26 lines)
Lines 138-143 Link Here
138
138
139
    /** Connection name */
139
    /** Connection name */
140
    private String name;
140
    private String name;
141
142
    /** The user-specified name that is to be displayed for this connection. */
143
    private String displayName;
141
    
144
    
142
    /** Error code */
145
    /** Error code */
143
    private int errorCode = -1;
146
    private int errorCode = -1;
Lines 166-171 Link Here
166
    public static final String PROP_DEFCATALOG = "defaultCatalog"; //NOI18N
169
    public static final String PROP_DEFCATALOG = "defaultCatalog"; //NOI18N
167
    public static final String PROP_DRIVERNAME = "drivername"; //NOI18N
170
    public static final String PROP_DRIVERNAME = "drivername"; //NOI18N
168
    public static final String PROP_NAME = "name"; //NOI18N
171
    public static final String PROP_NAME = "name"; //NOI18N
172
    public static final String PROP_DISPLAY_NAME = "displayName"; //NOI18N
169
    public static final String DRIVER_CLASS_NET = "org.apache.derby.jdbc.ClientDriver"; // NOI18N
173
    public static final String DRIVER_CLASS_NET = "org.apache.derby.jdbc.ClientDriver"; // NOI18N
170
    public static final int DERBY_UNICODE_ERROR_CODE = 20000;
174
    public static final int DERBY_UNICODE_ERROR_CODE = 20000;
171
    private OpenConnectionInterface openConnection = null;
175
    private OpenConnectionInterface openConnection = null;
Lines 424-430 Link Here
424
    /** Returns name of the connection */
428
    /** Returns name of the connection */
425
    public String getName() {
429
    public String getName() {
426
        if(name == null) {
430
        if(name == null) {
427
            if((getSchema()==null)||(getSchema().length()==0)) {
431
            if ( getUser().length()==0 ) {
432
                return "";
433
            } else if((getSchema()==null)||(getSchema().length()==0)) {
428
                name = NbBundle.getMessage (DatabaseConnection.class, "ConnectionNodeUniqueName", getDatabase(), getUser(),
434
                name = NbBundle.getMessage (DatabaseConnection.class, "ConnectionNodeUniqueName", getDatabase(), getUser(),
429
                        NbBundle.getMessage (DatabaseConnection.class, "SchemaIsNotSet")); //NOI18N
435
                        NbBundle.getMessage (DatabaseConnection.class, "SchemaIsNotSet")); //NOI18N
430
            } else {
436
            } else {
Lines 448-453 Link Here
448
            propertySupport.firePropertyChange(PROP_NAME, old, name);
454
            propertySupport.firePropertyChange(PROP_NAME, old, name);
449
    }
455
    }
450
456
457
    public String getDisplayName() {
458
        return ( displayName!=null && displayName.length()>0 ) ? displayName : getName();
459
    }
460
461
    public void setDisplayName(String value) {
462
        if ( (displayName == null && value==null) ||
463
                (displayName!=null && displayName.equals(value)) )
464
            return;
465
466
        String old = displayName;
467
        displayName = value;
468
        if(propertySupport!=null)
469
            propertySupport.firePropertyChange(PROP_NAME, old, displayName);
470
    }
471
451
    /** Returns user schema name */
472
    /** Returns user schema name */
452
    public String getSchema() {
473
    public String getSchema() {
453
        if (schema == null)
474
        if (schema == null)
Lines 841-848 Link Here
841
862
842
        try {
863
        try {
843
            drvname = (String) in.readObject();
864
            drvname = (String) in.readObject();
865
            displayName = (String) in.readObject();
844
        } catch (Exception exc) {
866
        } catch (Exception exc) {
845
            //IGNORE - not stored in 3.6 and earlier
867
            //IGNORE - drvname not stored in 3.6 and earlier
868
            //IGNORE - displayName not stored in 6.7 and earlier
846
        }
869
        }
847
870
848
        // boston setting/pilsen setting?
871
        // boston setting/pilsen setting?
Lines 866-871 Link Here
866
        out.writeObject(schema);
889
        out.writeObject(schema);
867
        out.writeObject(DatabaseConnection.SUPPORT);
890
        out.writeObject(DatabaseConnection.SUPPORT);
868
        out.writeObject(drvname);
891
        out.writeObject(drvname);
892
        out.writeObject(displayName);
869
    }
893
    }
870
894
871
    @Override
895
    @Override
(-)a/db/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor.java (-4 / +13 lines)
Lines 55-69 Link Here
55
import java.nio.charset.Charset;
55
import java.nio.charset.Charset;
56
import java.nio.charset.CharsetDecoder;
56
import java.nio.charset.CharsetDecoder;
57
import java.nio.charset.CoderResult;
57
import java.nio.charset.CoderResult;
58
import java.util.Iterator;
59
import java.util.LinkedList;
58
import java.util.LinkedList;
60
import java.util.Map;
59
import java.util.Map;
61
import java.util.Vector;
62
import java.util.WeakHashMap;
60
import java.util.WeakHashMap;
63
import java.util.concurrent.ConcurrentHashMap;
61
import java.util.concurrent.ConcurrentHashMap;
64
import java.util.logging.Level;
62
import java.util.logging.Level;
65
import java.util.logging.Logger;
63
import java.util.logging.Logger;
66
import org.netbeans.modules.db.explorer.node.RootNode;
67
import org.openide.cookies.InstanceCookie;
64
import org.openide.cookies.InstanceCookie;
68
import org.openide.filesystems.FileLock;
65
import org.openide.filesystems.FileLock;
69
import org.openide.filesystems.FileObject;
66
import org.openide.filesystems.FileObject;
Lines 82-88 Link Here
82
import org.openide.xml.EntityCatalog;
79
import org.openide.xml.EntityCatalog;
83
import org.openide.xml.XMLUtil;
80
import org.openide.xml.XMLUtil;
84
import org.netbeans.modules.db.util.Base64;
81
import org.netbeans.modules.db.util.Base64;
85
import org.openide.util.Exceptions;
86
import org.xml.sax.Attributes;
82
import org.xml.sax.Attributes;
87
import org.xml.sax.InputSource;
83
import org.xml.sax.InputSource;
88
import org.xml.sax.SAXException;
84
import org.xml.sax.SAXException;
Lines 232-237 Link Here
232
                handler.user,
228
                handler.user,
233
                handler.password, 
229
                handler.password, 
234
                handler.rememberPassword);
230
                handler.rememberPassword);
231
        if ( handler.displayName!=null ) {
232
            dbconn.setDisplayName(handler.displayName);
233
        }
235
234
236
        return dbconn;
235
        return dbconn;
237
    }
236
    }
Lines 379-384 Link Here
379
            if (instance.getUser() != null) {
378
            if (instance.getUser() != null) {
380
                pw.println("  <user value='" + XMLUtil.toAttributeValue(instance.getUser()) + "'/>"); //NOI18N
379
                pw.println("  <user value='" + XMLUtil.toAttributeValue(instance.getUser()) + "'/>"); //NOI18N
381
            }
380
            }
381
            if ( ! instance.getUser().equals(instance.getDisplayName()) ) {
382
                pw.println("  <display-name value='" + XMLUtil.toAttributeValue(instance.getDisplayName()) + "'/>"); //NOI18N
383
            }
382
            if (instance.rememberPassword() ) {
384
            if (instance.rememberPassword() ) {
383
                String password = instance.getPassword();
385
                String password = instance.getPassword();
384
                
386
                
Lines 407-412 Link Here
407
        private static final String ELEMENT_SCHEMA = "schema"; // NOI18N
409
        private static final String ELEMENT_SCHEMA = "schema"; // NOI18N
408
        private static final String ELEMENT_USER = "user"; // NOI18N
410
        private static final String ELEMENT_USER = "user"; // NOI18N
409
        private static final String ELEMENT_PASSWORD = "password"; // NOI18N
411
        private static final String ELEMENT_PASSWORD = "password"; // NOI18N
412
        private static final String ELEMENT_DISPLAY_NAME = "display-name"; // NOI18N
410
        private static final String ELEMENT_REMEMBER_PASSWORD = "remember-password";
413
        private static final String ELEMENT_REMEMBER_PASSWORD = "remember-password";
411
        private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N
414
        private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N
412
        
415
        
Lines 419-435 Link Here
419
        String user;
422
        String user;
420
        String password;
423
        String password;
421
        boolean rememberPassword;
424
        boolean rememberPassword;
425
        String displayName;
422
        
426
        
423
        public Handler(String connectionFileName) {
427
        public Handler(String connectionFileName) {
424
            this.connectionFileName = connectionFileName;
428
            this.connectionFileName = connectionFileName;
425
        }
429
        }
426
430
431
        @Override
427
        public void startDocument() throws SAXException {
432
        public void startDocument() throws SAXException {
428
        }
433
        }
429
434
435
        @Override
430
        public void endDocument() throws SAXException {
436
        public void endDocument() throws SAXException {
431
        }
437
        }
432
438
439
        @Override
433
        public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
440
        public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
434
            String value = attrs.getValue(ATTR_PROPERTY_VALUE);
441
            String value = attrs.getValue(ATTR_PROPERTY_VALUE);
435
            if (ELEMENT_DRIVER_CLASS.equals(qName)) {
442
            if (ELEMENT_DRIVER_CLASS.equals(qName)) {
Lines 442-447 Link Here
442
                schema = value;
449
                schema = value;
443
            } else if (ELEMENT_USER.equals(qName)) {
450
            } else if (ELEMENT_USER.equals(qName)) {
444
                user = value;
451
                user = value;
452
            } else if (ELEMENT_DISPLAY_NAME.equals(qName)) {
453
                displayName = value;
445
            } else if (ELEMENT_PASSWORD.equals(qName)) {
454
            } else if (ELEMENT_PASSWORD.equals(qName)) {
446
                // If the password was saved, then it means the user checked
455
                // If the password was saved, then it means the user checked
447
                // the box to say the password should be remembered.
456
                // the box to say the password should be remembered.
(-)a/db/src/org/netbeans/modules/db/explorer/dataview/DataViewWindow.java (-1 / +1 lines)
Lines 124-130 Link Here
124
        //while(!(tempInfo instanceof ConnectionNodeInfo))
124
        //while(!(tempInfo instanceof ConnectionNodeInfo))
125
        //    tempInfo = tempInfo.getParent();
125
        //    tempInfo = tempInfo.getParent();
126
126
127
        String title = connection.getName(); //tempInfo.getDisplayName();
127
        String title = connection.getDisplayName(); //tempInfo.getDisplayName();
128
        int idx = title.indexOf(" ["); //NOI18N
128
        int idx = title.indexOf(" ["); //NOI18N
129
        title = title.substring(0, idx);
129
        title = title.substring(0, idx);
130
        setName(title);
130
        setName(title);
(-)a/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.form (-17 / +42 lines)
Lines 5-10 Link Here
5
    <Component class="javax.swing.ButtonGroup" name="inputModeButtonGroup">
5
    <Component class="javax.swing.ButtonGroup" name="inputModeButtonGroup">
6
    </Component>
6
    </Component>
7
  </NonVisualComponents>
7
  </NonVisualComponents>
8
  <SyntheticProperties>
9
    <SyntheticProperty 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,2,-29,0,0,2,-68"/>
10
  </SyntheticProperties>
8
  <AuxValues>
11
  <AuxValues>
9
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
10
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
13
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
Lines 22-29 Link Here
22
          <Group type="102" attributes="0">
25
          <Group type="102" attributes="0">
23
              <EmptySpace max="-2" attributes="0"/>
26
              <EmptySpace max="-2" attributes="0"/>
24
              <Group type="103" groupAlignment="0" attributes="0">
27
              <Group type="103" groupAlignment="0" attributes="0">
28
                  <Component id="errorInfoPanel" alignment="0" pref="676" max="32767" attributes="0"/>
25
                  <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
29
                  <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
26
                  <Group type="102" attributes="0">
30
                  <Group type="102" alignment="0" attributes="0">
31
                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
32
                          <Component id="additionalPropsLabel" alignment="1" max="32767" attributes="1"/>
33
                          <Component id="directUrlLabel" alignment="0" max="32767" attributes="1"/>
34
                          <Component id="showUrlCheckBox" alignment="1" min="-2" pref="132" max="-2" attributes="1"/>
35
                      </Group>
36
                      <EmptySpace max="-2" attributes="0"/>
37
                      <Group type="103" groupAlignment="0" attributes="0">
38
                          <Component id="urlField" alignment="0" pref="532" max="32767" attributes="1"/>
39
                          <Component id="additionalPropsField" alignment="1" pref="532" max="32767" attributes="1"/>
40
                          <Group type="102" alignment="1" attributes="0">
41
                              <Component id="passwordCheckBox" pref="393" max="32767" attributes="0"/>
42
                              <EmptySpace min="-2" pref="139" max="-2" attributes="0"/>
43
                          </Group>
44
                          <Component id="directUrlScroll" alignment="1" pref="532" max="32767" attributes="0"/>
45
                      </Group>
46
                  </Group>
47
                  <Group type="102" alignment="0" attributes="0">
27
                      <Group type="103" groupAlignment="0" attributes="0">
48
                      <Group type="103" groupAlignment="0" attributes="0">
28
                          <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
49
                          <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
29
                              <Component id="inputModelLabel" alignment="0" max="32767" attributes="1"/>
50
                              <Component id="inputModelLabel" alignment="0" max="32767" attributes="1"/>
Lines 40-55 Link Here
40
                              <Component id="serviceLabel" alignment="0" max="32767" attributes="1"/>
61
                              <Component id="serviceLabel" alignment="0" max="32767" attributes="1"/>
41
                              <Component id="sidLabel" alignment="0" pref="119" max="32767" attributes="1"/>
62
                              <Component id="sidLabel" alignment="0" pref="119" max="32767" attributes="1"/>
42
                          </Group>
63
                          </Group>
43
                          <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
64
                          <Component id="displayNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
44
                              <Component id="additionalPropsLabel" alignment="1" max="32767" attributes="1"/>
45
                              <Component id="directUrlLabel" alignment="0" max="32767" attributes="1"/>
46
                              <Component id="showUrlCheckBox" alignment="1" min="-2" pref="132" max="-2" attributes="1"/>
47
                          </Group>
48
                      </Group>
65
                      </Group>
49
                      <EmptySpace max="-2" attributes="0"/>
66
                      <EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
50
                      <Group type="103" groupAlignment="0" attributes="0">
67
                      <Group type="103" groupAlignment="0" attributes="0">
51
                          <Component id="urlField" alignment="0" pref="532" max="32767" attributes="1"/>
52
                          <Component id="additionalPropsField" alignment="1" pref="532" max="32767" attributes="1"/>
53
                          <Group type="102" attributes="0">
68
                          <Group type="102" attributes="0">
54
                              <Component id="fieldInputCheckBox" min="-2" max="-2" attributes="0"/>
69
                              <Component id="fieldInputCheckBox" min="-2" max="-2" attributes="0"/>
55
                              <EmptySpace type="separate" max="-2" attributes="0"/>
70
                              <EmptySpace type="separate" max="-2" attributes="0"/>
Lines 67-80 Link Here
67
                          <Component id="instanceField" alignment="1" pref="532" max="32767" attributes="1"/>
82
                          <Component id="instanceField" alignment="1" pref="532" max="32767" attributes="1"/>
68
                          <Component id="userField" alignment="1" pref="532" max="32767" attributes="1"/>
83
                          <Component id="userField" alignment="1" pref="532" max="32767" attributes="1"/>
69
                          <Component id="passwordField" alignment="1" pref="532" max="32767" attributes="1"/>
84
                          <Component id="passwordField" alignment="1" pref="532" max="32767" attributes="1"/>
70
                          <Group type="102" alignment="1" attributes="0">
85
                          <Component id="displayNameField" alignment="0" pref="532" max="32767" attributes="0"/>
71
                              <Component id="passwordCheckBox" pref="393" max="32767" attributes="0"/>
72
                              <EmptySpace min="-2" pref="139" max="-2" attributes="0"/>
73
                          </Group>
74
                          <Component id="directUrlScroll" alignment="1" pref="532" max="32767" attributes="0"/>
75
                      </Group>
86
                      </Group>
76
                  </Group>
87
                  </Group>
77
                  <Component id="errorInfoPanel" alignment="0" pref="676" max="32767" attributes="0"/>
78
              </Group>
88
              </Group>
79
              <EmptySpace max="-2" attributes="0"/>
89
              <EmptySpace max="-2" attributes="0"/>
80
          </Group>
90
          </Group>
Lines 149-155 Link Here
149
                  <Component id="passwordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
159
                  <Component id="passwordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
150
                  <Component id="passwordField" alignment="3" min="-2" max="-2" attributes="0"/>
160
                  <Component id="passwordField" alignment="3" min="-2" max="-2" attributes="0"/>
151
              </Group>
161
              </Group>
152
              <EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
162
              <EmptySpace max="-2" attributes="0"/>
163
              <Group type="103" groupAlignment="3" attributes="0">
164
                  <Component id="displayNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
165
                  <Component id="displayNameField" alignment="3" min="-2" max="-2" attributes="0"/>
166
              </Group>
167
              <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
153
              <Component id="passwordCheckBox" min="-2" max="-2" attributes="0"/>
168
              <Component id="passwordCheckBox" min="-2" max="-2" attributes="0"/>
154
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
169
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
155
              <Group type="103" groupAlignment="3" attributes="0">
170
              <Group type="103" groupAlignment="3" attributes="0">
Lines 170-176 Link Here
170
              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
185
              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
171
              <EmptySpace max="-2" attributes="0"/>
186
              <EmptySpace max="-2" attributes="0"/>
172
              <Component id="errorInfoPanel" min="-2" max="-2" attributes="0"/>
187
              <Component id="errorInfoPanel" min="-2" max="-2" attributes="0"/>
173
              <EmptySpace pref="161" max="32767" attributes="0"/>
188
              <EmptySpace pref="110" max="32767" attributes="0"/>
174
          </Group>
189
          </Group>
175
      </Group>
190
      </Group>
176
    </DimensionLayout>
191
    </DimensionLayout>
Lines 533-537 Link Here
533
        </DimensionLayout>
548
        </DimensionLayout>
534
      </Layout>
549
      </Layout>
535
    </Container>
550
    </Container>
551
    <Component class="javax.swing.JLabel" name="displayNameLabel">
552
      <Properties>
553
        <Property name="text" type="java.lang.String" value="Display Name:"/>
554
      </Properties>
555
    </Component>
556
    <Component class="javax.swing.JTextField" name="displayNameField">
557
      <Events>
558
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="displayNameFieldActionPerformed"/>
559
      </Events>
560
    </Component>
536
  </SubComponents>
561
  </SubComponents>
537
</Form>
562
</Form>
(-)a/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java (-15 / +47 lines)
Lines 142-147 Link Here
142
        userField.setText(connection.getUser());
142
        userField.setText(connection.getUser());
143
        
143
        
144
        passwordField.setText(connection.getPassword());
144
        passwordField.setText(connection.getPassword());
145
146
        displayNameField.setText(connection.getDisplayName());
145
        
147
        
146
        String driver = connection.getDriver();
148
        String driver = connection.getDriver();
147
        String driverName = connection.getDriverName();
149
        String driverName = connection.getDriverName();
Lines 294-299 Link Here
294
        directUrlScroll = new javax.swing.JScrollPane();
296
        directUrlScroll = new javax.swing.JScrollPane();
295
        directUrlField = new javax.swing.JTextArea();
297
        directUrlField = new javax.swing.JTextArea();
296
        jPanel1 = new javax.swing.JPanel();
298
        jPanel1 = new javax.swing.JPanel();
299
        displayNameLabel = new javax.swing.JLabel();
300
        displayNameField = new javax.swing.JTextField();
297
301
298
        FormListener formListener = new FormListener();
302
        FormListener formListener = new FormListener();
299
303
Lines 411-416 Link Here
411
            .add(0, 19, Short.MAX_VALUE)
415
            .add(0, 19, Short.MAX_VALUE)
412
        );
416
        );
413
417
418
        org.openide.awt.Mnemonics.setLocalizedText(displayNameLabel, "Display Name:");
419
420
        displayNameField.addActionListener(formListener);
421
414
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
422
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
415
        this.setLayout(layout);
423
        this.setLayout(layout);
416
        layout.setHorizontalGroup(
424
        layout.setHorizontalGroup(
Lines 418-425 Link Here
418
            .add(layout.createSequentialGroup()
426
            .add(layout.createSequentialGroup()
419
                .addContainerGap()
427
                .addContainerGap()
420
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
428
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
429
                    .add(errorInfoPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 676, Short.MAX_VALUE)
421
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
430
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
422
                    .add(layout.createSequentialGroup()
431
                    .add(layout.createSequentialGroup()
432
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
433
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, additionalPropsLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
434
                            .add(directUrlLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
435
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, showUrlCheckBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 132, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
436
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
437
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
438
                            .add(urlField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
439
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, additionalPropsField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
440
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
441
                                .add(passwordCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
442
                                .add(139, 139, 139))
443
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, directUrlScroll, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)))
444
                    .add(layout.createSequentialGroup()
423
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
445
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
424
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
446
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
425
                                .add(inputModelLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
447
                                .add(inputModelLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
Lines 435-448 Link Here
435
                                .add(tnsLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
457
                                .add(tnsLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
436
                                .add(serviceLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
458
                                .add(serviceLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
437
                                .add(sidLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE))
459
                                .add(sidLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE))
438
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
460
                            .add(displayNameLabel))
439
                                .add(org.jdesktop.layout.GroupLayout.TRAILING, additionalPropsLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
461
                        .add(25, 25, 25)
440
                                .add(directUrlLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
441
                                .add(org.jdesktop.layout.GroupLayout.TRAILING, showUrlCheckBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 132, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
442
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
443
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
462
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
444
                            .add(urlField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
445
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, additionalPropsField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
446
                            .add(layout.createSequentialGroup()
463
                            .add(layout.createSequentialGroup()
447
                                .add(fieldInputCheckBox)
464
                                .add(fieldInputCheckBox)
448
                                .add(18, 18, 18)
465
                                .add(18, 18, 18)
Lines 459-469 Link Here
459
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, instanceField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
476
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, instanceField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
460
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, userField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
477
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, userField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
461
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, passwordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
478
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, passwordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
462
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
479
                            .add(displayNameField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE))))
463
                                .add(passwordCheckBox, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
464
                                .add(139, 139, 139))
465
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, directUrlScroll, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)))
466
                    .add(errorInfoPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 676, Short.MAX_VALUE))
467
                .addContainerGap())
480
                .addContainerGap())
468
        );
481
        );
469
        layout.setVerticalGroup(
482
        layout.setVerticalGroup(
Lines 522-528 Link Here
522
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
535
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
523
                    .add(passwordLabel)
536
                    .add(passwordLabel)
524
                    .add(passwordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
537
                    .add(passwordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
525
                .add(5, 5, 5)
538
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
539
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
540
                    .add(displayNameLabel)
541
                    .add(displayNameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
542
                .add(31, 31, 31)
526
                .add(passwordCheckBox)
543
                .add(passwordCheckBox)
527
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
544
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
528
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
545
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
Lines 540-546 Link Here
540
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
557
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
541
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
558
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
542
                .add(errorInfoPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
559
                .add(errorInfoPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
543
                .addContainerGap(161, Short.MAX_VALUE))
560
                .addContainerGap(110, Short.MAX_VALUE))
544
        );
561
        );
545
    }
562
    }
546
563
Lines 564-569 Link Here
564
            else if (evt.getSource() == directInputCheckBox) {
581
            else if (evt.getSource() == directInputCheckBox) {
565
                NewConnectionPanel.this.directInputCheckBoxActionPerformed(evt);
582
                NewConnectionPanel.this.directInputCheckBoxActionPerformed(evt);
566
            }
583
            }
584
            else if (evt.getSource() == displayNameField) {
585
                NewConnectionPanel.this.displayNameFieldActionPerformed(evt);
586
            }
567
        }
587
        }
568
588
569
        public void focusGained(java.awt.event.FocusEvent evt) {
589
        public void focusGained(java.awt.event.FocusEvent evt) {
Lines 655-660 Link Here
655
        updateInputMode(true);
675
        updateInputMode(true);
656
    }//GEN-LAST:event_directInputCheckBoxActionPerformed
676
    }//GEN-LAST:event_directInputCheckBoxActionPerformed
657
677
678
    private void displayNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayNameFieldActionPerformed
679
        // TODO add your handling code here:
680
    }//GEN-LAST:event_displayNameFieldActionPerformed
681
658
private void showUrlCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
682
private void showUrlCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
659
    showUrl();
683
    showUrl();
660
}
684
}
Lines 680-685 Link Here
680
    private javax.swing.JTextArea directUrlField;
704
    private javax.swing.JTextArea directUrlField;
681
    private javax.swing.JLabel directUrlLabel;
705
    private javax.swing.JLabel directUrlLabel;
682
    private javax.swing.JScrollPane directUrlScroll;
706
    private javax.swing.JScrollPane directUrlScroll;
707
    private javax.swing.JTextField displayNameField;
708
    private javax.swing.JLabel displayNameLabel;
683
    private javax.swing.JTextField dsnField;
709
    private javax.swing.JTextField dsnField;
684
    private javax.swing.JLabel dsnLabel;
710
    private javax.swing.JLabel dsnLabel;
685
    private org.netbeans.modules.db.util.ErrorInfoPanel errorInfoPanel;
711
    private org.netbeans.modules.db.util.ErrorInfoPanel errorInfoPanel;
Lines 718-724 Link Here
718
            JDBCDriver driver = url.getDriver();
744
            JDBCDriver driver = url.getDriver();
719
            assert(driver != null);
745
            assert(driver != null);
720
            connection.setDriverName(driver.getName());
746
            connection.setDriverName(driver.getName());
721
           connection.setDriver(driver.getClassName());
747
            connection.setDriver(driver.getClassName());
722
        }
748
        }
723
        
749
        
724
        if (fieldEntryMode) {
750
        if (fieldEntryMode) {
Lines 730-735 Link Here
730
        connection.setUser(userField.getText());
756
        connection.setUser(userField.getText());
731
        connection.setPassword(getPassword());
757
        connection.setPassword(getPassword());
732
        connection.setRememberPassword(passwordCheckBox.isSelected());
758
        connection.setRememberPassword(passwordCheckBox.isSelected());
759
        connection.setDisplayName(displayNameField.getText());
733
    }
760
    }
734
761
735
    private void resize() {
762
    private void resize() {
Lines 889-894 Link Here
889
        return NbBundle.getMessage(NewConnectionPanel.class, "NewConnectionDialogTitle"); //NOI18N
916
        return NbBundle.getMessage(NewConnectionPanel.class, "NewConnectionDialogTitle"); //NOI18N
890
    }
917
    }
891
918
919
    public String getDisplayName() {
920
        return displayNameField.getText();
921
    }
922
892
    private void startProgress() {
923
    private void startProgress() {
893
        SwingUtilities.invokeLater(new Runnable() {
924
        SwingUtilities.invokeLater(new Runnable() {
894
            public void run() {
925
            public void run() {
Lines 938-943 Link Here
938
        showUrlCheckBox.setEnabled(enable);
969
        showUrlCheckBox.setEnabled(enable);
939
        urlField.setEnabled(enable);
970
        urlField.setEnabled(enable);
940
        directUrlField.setEnabled(enable);
971
        directUrlField.setEnabled(enable);
972
        displayNameField.setEnabled(enable);
941
        
973
        
942
        for (Entry<String,UrlField> entry : urlFields.entrySet()) {
974
        for (Entry<String,UrlField> entry : urlFields.entrySet()) {
943
            entry.getValue().getField().setEnabled(enable);
975
            entry.getValue().getField().setEnabled(enable);
(-)a/db/src/org/netbeans/modules/db/explorer/node/ConnectionNode.java (-1 / +4 lines)
Lines 135-140 Link Here
135
            connection.setSchema(val.toString());
135
            connection.setSchema(val.toString());
136
        } else if (nps.getName().equals(SCHEMA)) {
136
        } else if (nps.getName().equals(SCHEMA)) {
137
            connection.setSchema(val.toString());
137
            connection.setSchema(val.toString());
138
        } else if (nps.getName().equals(DISPLAYNAME)) {
139
            connection.setDisplayName(val.toString());
138
        }
140
        }
139
141
140
        if (refreshNode) {
142
        if (refreshNode) {
Lines 153-158 Link Here
153
            addProperty(USER, USERDESC, String.class, !connected, connection.getUser());
155
            addProperty(USER, USERDESC, String.class, !connected, connection.getUser());
154
            addProperty(REMEMBERPW, REMEMBERPWDESC,
156
            addProperty(REMEMBERPW, REMEMBERPWDESC,
155
                    Boolean.class, !connected, connection.rememberPassword());
157
                    Boolean.class, !connected, connection.rememberPassword());
158
            addProperty(DISPLAYNAME, DISPLAYNAMEDESC, String.class, !connected, connection.getDisplayName());
156
159
157
            if (connected) {
160
            if (connected) {
158
                Specification spec = connection.getConnector().getDatabaseSpecification();
161
                Specification spec = connection.getConnector().getDatabaseSpecification();
Lines 336-342 Link Here
336
339
337
    @Override
340
    @Override
338
    public String getDisplayName() {
341
    public String getDisplayName() {
339
        return connection.getName();
342
        return connection.getDisplayName();
340
    }
343
    }
341
 
344
 
342
    public String getIconBase() {
345
    public String getIconBase() {

Return to bug 144112