no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@106 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Luis Flores 22 years ago
parent d80768e3c0
commit 4e54b62e5a

@ -141,7 +141,7 @@ public class DataChooserWindow extends CustomJDialog
}); });
} }
public Hashtable getData( boolean multiple ) public Hashtable getData()
{ {
if( canceled ) if( canceled )
{ {
@ -150,26 +150,31 @@ public class DataChooserWindow extends CustomJDialog
Hashtable hash = new Hashtable(); Hashtable hash = new Hashtable();
for( int i = 0; i < labels.length; ++i ) for( int i = 0; i < labels.length; ++i )
{ {
String sel = combos[ i ].getSelectedItem().toString(); hash.put( labels[ i ], combos[ i ].getSelectedItem() );
if( multiple )
{
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 ); return hash;
} }
else
public Hashtable[] getMultipleData()
{
if( canceled )
{ {
hash.put( labels[ i ], empty ); return null;
} }
Hashtable hash[] = new Hashtable[ allItems[ 0 ].length ];
for( int j = 0; j < hash.length; ++j )
{
hash[ j ] = new Hashtable();
} }
else for( int i = 0; i < labels.length; ++i )
{
String sel = combos[ i ].getSelectedItem().toString();
if( sel.length() > 0 )
{ {
hash.put( labels[ i ], sel ); for( int j = 0; j < allItems.length; ++j )
{
hash[ j ].put( labels[ i ], allItems[ j ][ combos[ i ].getSelectedIndex() ] );
}
} }
} }
return hash; return hash;

@ -233,9 +233,26 @@ public class Importer extends CustomJDialog
return null; return null;
} }
return dcw.getData( multipleSelection ); return dcw.getData();
} }
public Hashtable[] getMultipleData()
{
if( NAMES == null || vals == null )
{
return null;
}
dcw = new DataChooserWindow( null, NAMES, vals, DEFAULT_SELECTION );
if( canceled || ( dcw == null ) )
{
return null;
}
return dcw.getMultipleData();
}
public static void main( String args[] ) public static void main( String args[] )
{ {
// FileDialog fd = new FileDialog( null, "Escolha um ficheiro Excel:", FileDialog.LOAD ); // FileDialog fd = new FileDialog( null, "Escolha um ficheiro Excel:", FileDialog.LOAD );

Loading…
Cancel
Save