|
|
|
|
@ -29,13 +29,15 @@ import javax.swing.tree.TreeSelectionModel;
|
|
|
|
|
import leaf.data.Validator;
|
|
|
|
|
import leaf.ui.LeafButton;
|
|
|
|
|
import leaf.ui.LeafError;
|
|
|
|
|
import leaf.ui.LeafIconButton;
|
|
|
|
|
import leaf.ui.LeafTextAreaEditor;
|
|
|
|
|
import leaf.ui.LeafUIConstants;
|
|
|
|
|
import leaf.ui.TreeTools;
|
|
|
|
|
import siprp.database.cayenne.objects.HsLegislacao;
|
|
|
|
|
import siprp.database.cayenne.objects.HsLegislacaoCategoria;
|
|
|
|
|
import siprp.logic.HigieneSegurancaLogic;
|
|
|
|
|
|
|
|
|
|
public class GerirLegislacaoPanel extends JPanel
|
|
|
|
|
public class GerirLegislacaoPanel extends JPanel implements LeafUIConstants
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
@ -46,23 +48,23 @@ public class GerirLegislacaoPanel extends JPanel
|
|
|
|
|
|
|
|
|
|
private final JPanel panelButtonsGeral = new JPanel();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonGeralCriar = new LeafButton( "Criar" );
|
|
|
|
|
private final LeafButton buttonGeralCriar = LeafIconButton.createDefaultNewButton();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonGeralRemover = new LeafButton( "Remover" );
|
|
|
|
|
private final LeafButton buttonGeralRemover = LeafIconButton.createDefaultRemoveButton();
|
|
|
|
|
|
|
|
|
|
private final JPanel panelButtonsCategoriasCategoria = new JPanel();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonCategoriaCriar = new LeafButton( "Criar" );
|
|
|
|
|
private final LeafButton buttonCategoriaCriar = LeafIconButton.createDefaultNewButton();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonCategoriaEditar = new LeafButton( "Editar" );
|
|
|
|
|
private final LeafButton buttonCategoriaEditar = LeafIconButton.createDefaultEditButton();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonCategoriaRemover = new LeafButton( "Remover" );
|
|
|
|
|
private final LeafButton buttonCategoriaRemover = LeafIconButton.createDefaultRemoveButton();
|
|
|
|
|
|
|
|
|
|
private final JPanel panelButtonsCategoriasLegislacao = new JPanel();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonCategoriasLegislacaoCriar = new LeafButton( "Criar" );
|
|
|
|
|
private final LeafButton buttonCategoriasLegislacaoCriar = LeafIconButton.createDefaultNewButton();
|
|
|
|
|
|
|
|
|
|
private final LeafButton buttonCategoriasLegislacaoRemover = new LeafButton( "Remover" );
|
|
|
|
|
private final LeafButton buttonCategoriasLegislacaoRemover = LeafIconButton.createDefaultRemoveButton();
|
|
|
|
|
|
|
|
|
|
private final DefaultMutableTreeNode rootGeral = new DefaultMutableTreeNode();
|
|
|
|
|
|
|
|
|
|
@ -102,17 +104,17 @@ public class GerirLegislacaoPanel extends JPanel
|
|
|
|
|
placeComponents();
|
|
|
|
|
setupListeners();
|
|
|
|
|
reload();
|
|
|
|
|
setEnable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void startupComponents()
|
|
|
|
|
{
|
|
|
|
|
panelGeral.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o de aplica" + ccedil + atilde + "o geral" ) );
|
|
|
|
|
panelButtonsGeral.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panelCategorias.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o espec" + iacute + "fica" ) );
|
|
|
|
|
panelButtonsCategoriasCategoria.setBorder( BorderFactory.createTitledBorder( "Categoria" ) );
|
|
|
|
|
panelButtonsCategoriasLegislacao.setBorder( BorderFactory.createTitledBorder( "Legisla" + ccedil + atilde + "o" ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treeCategorias.setRootVisible( false );
|
|
|
|
|
treeGeral.setRootVisible( false );
|
|
|
|
|
treeCategorias.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );
|
|
|
|
|
@ -136,19 +138,19 @@ public class GerirLegislacaoPanel extends JPanel
|
|
|
|
|
panelGeral.setLayout( layout );
|
|
|
|
|
|
|
|
|
|
layout = new TableLayout( new double[] {
|
|
|
|
|
TableLayout.MINIMUM, TableLayout.FILL
|
|
|
|
|
}, new double[] {
|
|
|
|
|
TableLayout.MINIMUM, TableLayout.MINIMUM, TableLayout.FILL
|
|
|
|
|
}, new double[] {
|
|
|
|
|
TableLayout.MINIMUM, TableLayout.FILL
|
|
|
|
|
} );
|
|
|
|
|
panelCategorias.setLayout( layout );
|
|
|
|
|
|
|
|
|
|
layout = new GridLayout( 2, 1, 5, 5 );
|
|
|
|
|
layout = new GridLayout( 1, 2, 5, 5 );
|
|
|
|
|
panelButtonsGeral.setLayout( layout );
|
|
|
|
|
|
|
|
|
|
layout = new GridLayout( 3, 1, 5, 5 );
|
|
|
|
|
layout = new GridLayout( 1, 4, 5, 5 );
|
|
|
|
|
panelButtonsCategoriasCategoria.setLayout( layout );
|
|
|
|
|
|
|
|
|
|
layout = new GridLayout( 2, 1, 5, 5 );
|
|
|
|
|
layout = new GridLayout( 1, 4, 5, 5 );
|
|
|
|
|
panelButtonsCategoriasLegislacao.setLayout( layout );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -160,16 +162,19 @@ public class GerirLegislacaoPanel extends JPanel
|
|
|
|
|
panelButtonsCategoriasCategoria.add( buttonCategoriaCriar );
|
|
|
|
|
panelButtonsCategoriasCategoria.add( buttonCategoriaEditar );
|
|
|
|
|
panelButtonsCategoriasCategoria.add( buttonCategoriaRemover );
|
|
|
|
|
panelButtonsCategoriasCategoria.add( new JPanel() );
|
|
|
|
|
|
|
|
|
|
panelButtonsCategoriasLegislacao.add( buttonCategoriasLegislacaoCriar );
|
|
|
|
|
panelButtonsCategoriasLegislacao.add( buttonCategoriasLegislacaoRemover );
|
|
|
|
|
panelButtonsCategoriasLegislacao.add( new JPanel() );
|
|
|
|
|
panelButtonsCategoriasLegislacao.add( new JPanel() );
|
|
|
|
|
|
|
|
|
|
panelGeral.add( panelButtonsGeral, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
panelGeral.add( scrollGeral, new TableLayoutConstraints( 1, 0, 1, 1 ) );
|
|
|
|
|
panelGeral.add( scrollGeral, new TableLayoutConstraints( 0, 1, 1, 1 ) );
|
|
|
|
|
|
|
|
|
|
panelCategorias.add( panelButtonsCategoriasCategoria, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
panelCategorias.add( panelButtonsCategoriasLegislacao, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
panelCategorias.add( scrollCategorias, new TableLayoutConstraints( 1, 0, 1, 2 ) );
|
|
|
|
|
panelCategorias.add( panelButtonsCategoriasLegislacao, new TableLayoutConstraints( 1, 0 ) );
|
|
|
|
|
panelCategorias.add( scrollCategorias, new TableLayoutConstraints( 0, 1, 2, 1 ) );
|
|
|
|
|
|
|
|
|
|
this.add( panelGeral, new TableLayoutConstraints( 0, 0 ) );
|
|
|
|
|
this.add( panelCategorias, new TableLayoutConstraints( 0, 1 ) );
|
|
|
|
|
|