public class

UserAccountComboBox

extends FancyComboBox
java.lang.Object
   ↳ java.awt.Component
     ↳ java.awt.Container
       ↳ javax.swing.JComponent
         ↳ javax.swing.JComboBox
           ↳ org.mbari.swing.FancyComboBox
             ↳ vars.shared.ui.UserAccountComboBox

Class Overview

Use as:

 UserAccountComboBox cb = new UserAccountComboBox();
 try {
     cb.update(); // Populates the cb from the database
 }
 catch (Exception e) {
     // Handle exception
 }
 UserAccount userAccount = cb.getSelectedUserAccount();
 

Summary

[Expand]
Inherited Constants
From class javax.swing.JComponent
From class java.awt.Component
From interface java.awt.image.ImageObserver
[Expand]
Inherited Fields
From class javax.swing.JComboBox
From class javax.swing.JComponent
Public Constructors
UserAccountComboBox(MiscDAOFactory miscDAOFactory)
Constructs ...
Public Methods
UserAccount getSelectedUserAccount()
void setSelectedUserName(String userName)
Sets the user name selected in the combo box.
void update()
Updates the combo box with the useraccount information stored in the database.
[Expand]
Inherited Methods
From class org.mbari.swing.FancyComboBox
From class javax.swing.JComboBox
From class javax.swing.JComponent
From class java.awt.Container
From class java.awt.Component
From class java.lang.Object
From interface java.awt.ItemSelectable
From interface java.awt.MenuContainer
From interface java.awt.event.ActionListener
From interface java.awt.image.ImageObserver
From interface javax.accessibility.Accessible
From interface javax.swing.event.ListDataListener

Public Constructors

public UserAccountComboBox (MiscDAOFactory miscDAOFactory)

Constructs ...

Public Methods

public UserAccount getSelectedUserAccount ()

Returns
  • The selected userAccount. null if none is selected.

public void setSelectedUserName (String userName)

Sets the user name selected in the combo box. If an account matching the name does not exist then it is set to the first element.

public void update ()

Updates the combo box with the useraccount information stored in the database.