no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@106 bb69d46d-e84e-40c8-a05a-06db0d633741
lxbfYeaa
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 )
{
@ -149,28 +149,33 @@ public class DataChooserWindow extends CustomJDialog
}
Hashtable hash = new Hashtable();
for( int i = 0; i < labels.length; ++i )
{
hash.put( labels[ i ], combos[ i ].getSelectedItem() );
}
return hash;
}
public Hashtable[] getMultipleData()
{
if( canceled )
{
return null;
}
Hashtable hash[] = new Hashtable[ allItems[ 0 ].length ];
for( int j = 0; j < hash.length; ++j )
{
hash[ j ] = new Hashtable();
}
for( int i = 0; i < labels.length; ++i )
{
String sel = combos[ i ].getSelectedItem().toString();
if( multiple )
if( sel.length() > 0 )
{
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
for( int j = 0; j < allItems.length; ++j )
{
hash.put( labels[ i ], empty );
hash[ j ].put( labels[ i ], allItems[ j ][ combos[ i ].getSelectedIndex() ] );
}
}
else
{
hash.put( labels[ i ], sel );
}
}
return hash;
}

@ -233,9 +233,26 @@ public class Importer extends CustomJDialog
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[] )
{
// FileDialog fd = new FileDialog( null, "Escolha um ficheiro Excel:", FileDialog.LOAD );

Loading…
Cancel
Save