Changeset 10179 in josm for trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
- Timestamp:
- 2016-05-11T02:44:10+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
r10173 r10179 117 117 public void prepareForOsmApiCredentials(String username, String password) { 118 118 setTitle(tr("Enter credentials for OSM API")); 119 getContentPane().add(pnlCredentials = new OsmApiCredentialsPanel(this), BorderLayout.CENTER); 119 pnlCredentials = new OsmApiCredentialsPanel(this); 120 getContentPane().add(pnlCredentials, BorderLayout.CENTER); 120 121 pnlCredentials.init(username, password); 121 122 validate(); … … 124 125 public void prepareForOtherHostCredentials(String username, String password, String host) { 125 126 setTitle(tr("Enter credentials for host")); 126 getContentPane().add(pnlCredentials = new OtherHostCredentialsPanel(this, host), BorderLayout.CENTER); 127 pnlCredentials = new OtherHostCredentialsPanel(this, host); 128 getContentPane().add(pnlCredentials, BorderLayout.CENTER); 127 129 pnlCredentials.init(username, password); 128 130 validate(); … … 131 133 public void prepareForProxyCredentials(String username, String password) { 132 134 setTitle(tr("Enter credentials for HTTP proxy")); 133 getContentPane().add(pnlCredentials = new HttpProxyCredentialsPanel(this), BorderLayout.CENTER); 135 pnlCredentials = new HttpProxyCredentialsPanel(this); 136 getContentPane().add(pnlCredentials, BorderLayout.CENTER); 134 137 pnlCredentials.init(username, password); 135 138 validate(); … … 137 140 138 141 public String getUsername() { 139 if (pnlCredentials == null) return null; 142 if (pnlCredentials == null) 143 return null; 140 144 return pnlCredentials.getUserName(); 141 145 } 142 146 143 147 public char[] getPassword() { 144 if (pnlCredentials == null) return null; 148 if (pnlCredentials == null) 149 return null; 145 150 return pnlCredentials.getPassword(); 146 151 } 147 152 148 153 public boolean isSaveCredentials() { 149 if (pnlCredentials == null) return false; 154 if (pnlCredentials == null) 155 return false; 150 156 return pnlCredentials.isSaveCredentials(); 151 157 } … … 155 161 protected JosmPasswordField tfPassword; 156 162 protected JCheckBox cbSaveCredentials; 157 protected JMultilineLabel lblHeading;158 protected JMultilineLabel lblWarning;163 protected final JMultilineLabel lblHeading = new JMultilineLabel(""); 164 protected final JMultilineLabel lblWarning = new JMultilineLabel(""); 159 165 protected CredentialDialog owner; // owner Dependency Injection to use Key listeners for username and password text fields 160 166 … … 176 182 gc.weighty = 0.0; 177 183 gc.insets = new Insets(0, 0, 10, 0); 178 add(lblHeading = new JMultilineLabel(""), gc);184 add(lblHeading, gc); 179 185 180 186 gc.gridx = 0; … … 208 214 gc.weightx = 1.0; 209 215 gc.weighty = 0.0; 210 lblWarning = new JMultilineLabel("");211 216 lblWarning.setFont(lblWarning.getFont().deriveFont(Font.ITALIC)); 212 217 add(lblWarning, gc);
Note:
See TracChangeset
for help on using the changeset viewer.