decodes.dbeditor.EquipmentModelCombo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opendcs Show documentation
Show all versions of opendcs Show documentation
A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.
The newest version!
/*
* $Id$
*
* $State$
*
* $Log$
* Revision 1.1 2008/04/04 18:21:00 cvs
* Added legacy code to repository
*
* Revision 1.4 2008/01/07 16:16:05 mmaloney
* internationalization
*
* Revision 1.3 2004/09/20 14:18:46 mjmaloney
* Javadocs
*
* Revision 1.2 2002/03/31 21:09:38 mike
* bug fixes
*
* Revision 1.1 2001/05/03 14:15:55 mike
* dev
*
*/
package decodes.dbeditor;
import java.util.ResourceBundle;
import javax.swing.JComboBox;
import java.util.Iterator;
import decodes.db.*;
/**
Combo box for selecting an EquipmentModel.
*/
public class EquipmentModelCombo extends JComboBox
{
static ResourceBundle genericLabels = DbEditorFrame.getGenericLabels();
static final String none = genericLabels.getString("noneComboItem");
/** Constructor. */
public EquipmentModelCombo()
{
super();
addItem(none);
Iterator it = Database.getDb().equipmentModelList.iterator();
while(it.hasNext())
{
EquipmentModel em = (EquipmentModel)it.next();
addItem(em.name);
}
}
/**
Sets the current selection from the name of an Equipment Model.
@param v the current selection.
*/
public void set(String v)
{
if (v == null)
{
setSelectedIndex(0);
return;
}
int n = getItemCount();
for(int i=0; i