notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2683 - development/main/depot/prefs/src/main/net/dpml/depot/prefs
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2683 - development/main/depot/prefs/src/main/net/dpml/depot/prefs
- Date: Tue, 31 May 2005 08:31:35 -0400
Author: mcconnell AT dpml.net
Date: Tue May 31 08:31:33 2005
New Revision: 2683
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicCredentialsPanel.java
Log:
fix a bug in the credentials handling
Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicCredentialsPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicCredentialsPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/ClassicCredentialsPanel.java
Tue May 31 08:31:33 2005
@@ -105,13 +105,13 @@
JPanel rack = new JPanel();
rack.setLayout( new BoxLayout( rack, BoxLayout.Y_AXIS ) );
rack.setBackground( Color.white );
- m_username = new JTextField( m_auth.getUserName() );
+ m_username = new JTextField( getUserNameValue() );
m_username.getDocument().addDocumentListener( new
UsernameDocumentListener() );
m_username.setBackground( Color.white );
rack.add( new LabelHolder( "Username:" ) );
rack.add( m_username );
- m_password = new JPasswordField( new String(
m_auth.getPassword() ) );
+ m_password = new JPasswordField( new String( getPasswordValue()
) );
m_password.getDocument().addDocumentListener( new
PasswordDocumentListener() );
m_password.setBackground( Color.white );
rack.add( new LabelHolder( "Password:" ) );
@@ -155,6 +155,31 @@
}
}
+ private String getUserNameValue()
+ {
+ if( null == m_auth )
+ {
+ return "";
+ }
+ else
+ {
+ return m_auth.getUserName();
+ }
+ }
+
+ private String getPasswordValue()
+ {
+ if( null == m_auth )
+ {
+ return "";
+ }
+ else
+ {
+ return new String( m_auth.getPassword() );
+ }
+ }
+
+
//--------------------------------------------------------------
// PasswordAuthenticationModel
//--------------------------------------------------------------
@@ -242,13 +267,13 @@
private boolean isPasswordModified()
{
- String password = new String( m_auth.getPassword() );
+ String password = getPasswordValue();
return !m_password.getText().equals( password );
}
private boolean isUsernameModified()
{
- String username = m_auth.getUserName();
+ String username = getUserNameValue();
return !m_username.getText().equals( username );
}
@@ -277,14 +302,14 @@
public void actionPerformed( ActionEvent event )
{
- String username = m_auth.getUserName();
+ String username = getUserNameValue();
String old = m_username.getText();
m_username.setText( username );
PropertyChangeEvent usernameEvent =
new PropertyChangeEvent( this, "username", old, username );
m_propertyChangeSupport.firePropertyChange( usernameEvent );
- String password = new String( m_auth.getPassword() );
+ String password = new String( getPasswordValue() );
m_password.setText( password );
PropertyChangeEvent passwordEvent =
new PropertyChangeEvent( this, "password", null, null );
- svn commit: r2683 - development/main/depot/prefs/src/main/net/dpml/depot/prefs, mcconnell, 05/30/2005
Archive powered by MHonArc 2.6.24.