|
|
|
|
@ -20,6 +20,7 @@ public class DataChooserWindow extends CustomJDialog
|
|
|
|
|
{
|
|
|
|
|
private final String labels[];
|
|
|
|
|
private final String items[];
|
|
|
|
|
private final String empty[];
|
|
|
|
|
private final String allItems[][];
|
|
|
|
|
private final JComboBox combos[];
|
|
|
|
|
private final int preselected[];
|
|
|
|
|
@ -37,6 +38,11 @@ public class DataChooserWindow extends CustomJDialog
|
|
|
|
|
super( modalFrame, true );
|
|
|
|
|
labels = names;
|
|
|
|
|
items = data[ 0 ];
|
|
|
|
|
empty = new String[ items.length ];
|
|
|
|
|
for( int i = 0; i < empty.length; ++i )
|
|
|
|
|
{
|
|
|
|
|
empty[ i ] = "";
|
|
|
|
|
}
|
|
|
|
|
allItems = data;
|
|
|
|
|
combos = new JComboBox[ labels.length ];
|
|
|
|
|
preselected = selected;
|
|
|
|
|
@ -144,13 +150,26 @@ public class DataChooserWindow extends CustomJDialog
|
|
|
|
|
Hashtable hash = new Hashtable();
|
|
|
|
|
for( int i = 0; i < labels.length; ++i )
|
|
|
|
|
{
|
|
|
|
|
String sel = combos[ i ].getSelectedItem().toString();
|
|
|
|
|
if( multiple )
|
|
|
|
|
{
|
|
|
|
|
hash.put( labels[ i ], allItems[ combos[ i ].getSelectedIndex() ] );
|
|
|
|
|
if( sel.length() > 0 )
|
|
|
|
|
{
|
|
|
|
|
String col[] = new String[ allItems.length ];
|
|
|
|
|
for( int j = 0; j < allItems.length; ++j )
|
|
|
|
|
{
|
|
|
|
|
col[ j ] = allItems[ j ][ combos[ i ].getSelectedIndex() ];
|
|
|
|
|
}
|
|
|
|
|
hash.put( labels[ i ], col );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hash.put( labels[ i ], empty );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hash.put( labels[ i ], combos[ i ].getSelectedItem() );
|
|
|
|
|
hash.put( labels[ i ], sel );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return hash;
|
|
|
|
|
|