generalDatabase.lookupTables
Class LookupComponent

java.lang.Object
  extended by generalDatabase.lookupTables.LookupComponent

public class LookupComponent
extends java.lang.Object

Lookup component to go in dialogs, Logger forms, etc.

Has the look and feel of Logger drop down boxes but lots of extra features, such as being editable and updatable on the fly, etc.

Author:
Doug Gillespie

Nested Class Summary
private  class LookupComponent.CodeFieldListener
           
private  class LookupComponent.CodeMouseListener
           
private  class LookupComponent.EditList
           
private  class LookupComponent.ListActionListener
           
 
Field Summary
private  boolean allowEdits
           
private  boolean allowNullSelection
           
private  javax.swing.JTextField codeField
           
private  javax.swing.JComboBox comboBox
           
private  LookupList lookupList
           
private  java.lang.String lookupTopic
           
private  javax.swing.JPanel mainPanel
           
private  javax.swing.JLabel northLabel
           
private  java.util.Vector<LookupItem> selectedList
           
private  javax.swing.JLabel westLabel
           
private  javax.swing.JPanel westPanel
           
 
Constructor Summary
LookupComponent(java.lang.String lookupTopic)
           
 
Method Summary
private  void fillList()
           
private  int findCodeIndex(java.lang.String code)
          find the index of a particular code in the selected list
 javax.swing.JComponent getComponent()
           
 LookupItem getSelectedItem()
           
 boolean isAllowEdits()
           
 boolean isAllowNullSelection()
           
private  void newListSelection(java.awt.event.ActionEvent arg0)
           
 void setAllowEdits(boolean allowEdits)
           
 void setAllowNullSelection(boolean allowNullSelection)
           
 boolean setComboFromCode()
           
 void setNorthTitle(java.lang.String northTitle)
           
 void setSelectedCode(java.lang.String codeText)
          Set the code manually, then let the comboBox part update itself
 void setWestTitle(java.lang.String westTitle)
           
 void showPopupMenu(java.awt.event.MouseEvent me)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lookupTopic

private java.lang.String lookupTopic

mainPanel

private javax.swing.JPanel mainPanel

westPanel

private javax.swing.JPanel westPanel

codeField

private javax.swing.JTextField codeField

comboBox

private javax.swing.JComboBox comboBox

westLabel

private javax.swing.JLabel westLabel

northLabel

private javax.swing.JLabel northLabel

lookupList

private LookupList lookupList

selectedList

private java.util.Vector<LookupItem> selectedList

allowNullSelection

private boolean allowNullSelection

allowEdits

private boolean allowEdits
Constructor Detail

LookupComponent

public LookupComponent(java.lang.String lookupTopic)
Method Detail

getSelectedItem

public LookupItem getSelectedItem()
Returns:
The currently selected lookup item.

showPopupMenu

public void showPopupMenu(java.awt.event.MouseEvent me)

setComboFromCode

public boolean setComboFromCode()

findCodeIndex

private int findCodeIndex(java.lang.String code)
find the index of a particular code in the selected list

Parameters:
code - text from the code field
Returns:
index in the selected list or -1 if code not found

newListSelection

private void newListSelection(java.awt.event.ActionEvent arg0)

fillList

private void fillList()

getComponent

public javax.swing.JComponent getComponent()

setWestTitle

public void setWestTitle(java.lang.String westTitle)

setNorthTitle

public void setNorthTitle(java.lang.String northTitle)

isAllowNullSelection

public boolean isAllowNullSelection()

setAllowNullSelection

public void setAllowNullSelection(boolean allowNullSelection)

isAllowEdits

public boolean isAllowEdits()

setAllowEdits

public void setAllowEdits(boolean allowEdits)

setSelectedCode

public void setSelectedCode(java.lang.String codeText)
Set the code manually, then let the comboBox part update itself

Parameters:
codeText -