com.ccg.net.email
Class AuthenticatorSwing

java.lang.Object
  extended by javax.mail.Authenticator
      extended by com.ccg.net.email.AuthenticatorSwing

public class AuthenticatorSwing
extends javax.mail.Authenticator

A "swing" based email authentication window (to be used in conjunction with Session objects).

 class Example {
   public void main(String[] args) {
     com.ccg.net.email.AuthenticatorSwing o = new com.ccg.net.email.AuthenticatorSwing();
          System.out.println(o);
   }
 }
 

Since:
1.0
Version:
$Revision: 1.1 $
Author:
$Author: pkb $ #see [class][#method]|Text

Constructor Summary
AuthenticatorSwing()
          Construct the authentication object without associating a specific JFrame or JDialog object.
AuthenticatorSwing(JComponent jc, TagLookup props)
          Construct the authentication object associated with a "owning" swing component (which we'll use when presenting the pop-up window).
 
Method Summary
protected  javax.mail.PasswordAuthentication getPasswordAuthentication()
          One line summary...
 void setProperties(TagLookup val)
          Set the properties to be used when setting labels, formats, etc (optional).
 
Methods inherited from class javax.mail.Authenticator
getDefaultUserName, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingSite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticatorSwing

public AuthenticatorSwing()
Construct the authentication object without associating a specific JFrame or JDialog object.

Since:
1.0

AuthenticatorSwing

public AuthenticatorSwing(JComponent jc,
                          TagLookup props)
Construct the authentication object associated with a "owning" swing component (which we'll use when presenting the pop-up window).

This method allows one to specify more details about how the dialog box is presented to the user. In particular, if you pass a non-null set of properties, we will honor any of the following properties which are found (its OK if you are missing some, we'll fall back to built in defaults):

id.label
Label to precede the Login ID text field area.
id.text
Text for the default Login ID (typically empty).
pwd.label
Label to precede the Login Password text field area.
pwd.text
Text for the default Login Password (typically empty).
button.login
Label for login button.
button.cancel
Label for cancel button.
background
The background color of the components.
foreground
The foreground color of the components.
title
The title to show on the dialog frame.
info.format
The format string to use for displaying information about the mail service we are about to connect to.

It should be noted that the info.format value is passed through a MessageFormat formatting and passed the following parameters:

 {0} = The mail transport protocol
 {1} = The mail host.
 {2} = The port on the mail host.
 {3} = The "prompt" from the session.
 

The default value (if you not found) is:

 "Connecting to {0} "+
 "mail service on host {1},"+
 " port {2}.

{3}"

Parameters:
jc - The swing component which is considered the "owner" of this object (you may pass null in which case we'll create our own).
props - A set of properties which can be used to configure the labels and other strings which are presented to the user (may be null if you want the system default values) - allows for localization.
Since:
1.0
Method Detail

setProperties

public void setProperties(TagLookup val)
Set the properties to be used when setting labels, formats, etc (optional).

Parameters:
val - New TagLookup value to assign - may be null if you just want the built in defaults (but then there isn't much point in setting them now is there).

getPasswordAuthentication

protected javax.mail.PasswordAuthentication getPasswordAuthentication()
One line summary... Describe...

Overrides:
getPasswordAuthentication in class javax.mail.Authenticator
Parameters:
arg1 - arg1-describe
arg2 - arg2-describe
Returns:
ret-description
Throws:
exc - Why thrown
Since:
1.0 #see [class][#meth]|Text


Copyright 1998-1998-2006 null. All Rights Reserved.