|
|
|
@ -27,6 +27,9 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
private ExamePanel examePanel;
|
|
|
|
private ExamePanel examePanel;
|
|
|
|
|
|
|
|
|
|
|
|
private FichaDataProvider fdpProvider;
|
|
|
|
private FichaDataProvider fdpProvider;
|
|
|
|
|
|
|
|
private Integer empresaID;
|
|
|
|
|
|
|
|
private Integer estabelecimentoID;
|
|
|
|
|
|
|
|
private Integer trabalhadorID;
|
|
|
|
|
|
|
|
|
|
|
|
private static int permissions[][] =
|
|
|
|
private static int permissions[][] =
|
|
|
|
new int[][]{ { NEW_INDEX, CANCEL_INDEX, SAVE_INDEX, DELETE_INDEX } };
|
|
|
|
new int[][]{ { NEW_INDEX, CANCEL_INDEX, SAVE_INDEX, DELETE_INDEX } };
|
|
|
|
@ -50,18 +53,6 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
setResizable( false );
|
|
|
|
setResizable( false );
|
|
|
|
setTitle( "Ficha de Aptid\u00e3o" );
|
|
|
|
setTitle( "Ficha de Aptid\u00e3o" );
|
|
|
|
|
|
|
|
|
|
|
|
// upperPanel = new UpperPanel();
|
|
|
|
|
|
|
|
// JTabbedPane tabbed = new JTabbedPane();
|
|
|
|
|
|
|
|
// getContentPane().setLayout( new BorderLayout() );
|
|
|
|
|
|
|
|
// getContentPane().add( upperPanel, BorderLayout.NORTH );
|
|
|
|
|
|
|
|
// getContentPane().add( tabbed, BorderLayout.CENTER );
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// JPanel empresaTrabalhadorPanel = new JPanel();
|
|
|
|
|
|
|
|
// JPanel exameRecomendacoesPanel = new JPanel();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// tabbed.add( "Empresa/Trabalhador", empresaTrabalhadorPanel );
|
|
|
|
|
|
|
|
// tabbed.add( "Exame", exameRecomendacoesPanel );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel empresaTrabalhadorPanel = getTab( 0 );
|
|
|
|
JPanel empresaTrabalhadorPanel = getTab( 0 );
|
|
|
|
JPanel exameRecomendacoesPanel = getTab( 1 );
|
|
|
|
JPanel exameRecomendacoesPanel = getTab( 1 );
|
|
|
|
|
|
|
|
|
|
|
|
@ -76,6 +67,7 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
constraints.weighty = 0;
|
|
|
|
constraints.weighty = 0;
|
|
|
|
|
|
|
|
|
|
|
|
empresaPanel = new EmpresaPanel();
|
|
|
|
empresaPanel = new EmpresaPanel();
|
|
|
|
|
|
|
|
empresaPanel.setEnabled( false );
|
|
|
|
gridbag.setConstraints( empresaPanel, constraints );
|
|
|
|
gridbag.setConstraints( empresaPanel, constraints );
|
|
|
|
empresaTrabalhadorPanel.add( empresaPanel );
|
|
|
|
empresaTrabalhadorPanel.add( empresaPanel );
|
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +100,13 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
|
|
|
|
|
|
|
|
public boolean save( int index )
|
|
|
|
public boolean save( int index )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
System.out.println( "Empresa id: " + empresaPanel.save() );
|
|
|
|
new ProgressDialog( this, "A gravar...",
|
|
|
|
|
|
|
|
new Runnable(){
|
|
|
|
|
|
|
|
public void run()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
empresaPanel.save();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -116,12 +114,13 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fdpProvider.setSearch( FichaDataProvider.SEARCH_EMPRESAS );
|
|
|
|
fdpProvider.setSearch( FichaDataProvider.SEARCH_EMPRESAS );
|
|
|
|
SearchDialog search = new SearchDialog( fdpProvider, null, true, null, true );
|
|
|
|
SearchDialog search = new SearchDialog( fdpProvider, null, true, null, true );
|
|
|
|
Integer empresaID = ( Integer )search.getSelected();
|
|
|
|
empresaID = ( Integer )search.getSelected();
|
|
|
|
|
|
|
|
|
|
|
|
if( empresaID == null )
|
|
|
|
if( empresaID == null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( search.getIsNew() )
|
|
|
|
if( search.getIsNew() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
clear( 0 );
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -133,12 +132,13 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
fdpProvider.setSearch( FichaDataProvider.SEARCH_ESTABELECIMENTOS );
|
|
|
|
fdpProvider.setSearch( FichaDataProvider.SEARCH_ESTABELECIMENTOS );
|
|
|
|
fdpProvider.setSearchID( FichaDataProvider.SEARCH_EMPRESAS, empresaID.intValue() );
|
|
|
|
fdpProvider.setSearchID( FichaDataProvider.SEARCH_EMPRESAS, empresaID.intValue() );
|
|
|
|
search = new SearchDialog( fdpProvider, null, true, null, true );
|
|
|
|
search = new SearchDialog( fdpProvider, null, true, null, true );
|
|
|
|
Integer estabelecimentoID = ( Integer )search.getSelected();
|
|
|
|
estabelecimentoID = ( Integer )search.getSelected();
|
|
|
|
|
|
|
|
|
|
|
|
if( estabelecimentoID == null )
|
|
|
|
if( estabelecimentoID == null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( search.getIsNew() )
|
|
|
|
if( search.getIsNew() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
reload(0);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -150,13 +150,14 @@ public class FichaWindow extends TabbedWindow
|
|
|
|
fdpProvider.setSearch( FichaDataProvider.SEARCH_TRABALHADORES );
|
|
|
|
fdpProvider.setSearch( FichaDataProvider.SEARCH_TRABALHADORES );
|
|
|
|
fdpProvider.setSearchID( FichaDataProvider.SEARCH_ESTABELECIMENTOS, estabelecimentoID.intValue() );
|
|
|
|
fdpProvider.setSearchID( FichaDataProvider.SEARCH_ESTABELECIMENTOS, estabelecimentoID.intValue() );
|
|
|
|
search = new SearchDialog( fdpProvider, null, true, null, false );
|
|
|
|
search = new SearchDialog( fdpProvider, null, true, null, false );
|
|
|
|
Integer trabalhadorID = ( Integer )search.getSelected();
|
|
|
|
trabalhadorID = ( Integer )search.getSelected();
|
|
|
|
|
|
|
|
|
|
|
|
if( trabalhadorID == null )
|
|
|
|
if( trabalhadorID == null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( search.getIsNew() )
|
|
|
|
if( search.getIsNew() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
System.out.println( "FichaWindow: newItem: CRIAR TRABALHADOR" );
|
|
|
|
System.out.println( "FichaWindow: newItem: CRIAR TRABALHADOR" );
|
|
|
|
|
|
|
|
reload(0);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@ -164,7 +165,7 @@ return true;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
reload(0);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -175,5 +176,17 @@ return true;
|
|
|
|
|
|
|
|
|
|
|
|
public void reload( int index )
|
|
|
|
public void reload( int index )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Object empresaData[] = new Object[]{ empresaID, estabelecimentoID };
|
|
|
|
|
|
|
|
empresaPanel.fill( empresaData );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void enableComponents( int index, boolean enable )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
empresaPanel.setEnabled( enable );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void clear( int index )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
empresaPanel.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|