Distribuidores y empresas
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package xyz.danielcortes.controllers;
|
package xyz.danielcortes.controllers;
|
||||||
|
|
||||||
import java.awt.event.KeyEvent;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
@@ -15,18 +14,18 @@ import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaCreateContro
|
|||||||
import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaSearchController;
|
import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaSearchController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaUpdateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaViewController;
|
import xyz.danielcortes.controllers.mantenedores.categoria.CategoriaViewController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoCreateController;
|
import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorCreateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoSearchController;
|
import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorSearchController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorUpdateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoViewController;
|
import xyz.danielcortes.controllers.mantenedores.distribuidor.DistribuidorViewController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionCreateController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionSearchController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionUpdateController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionViewController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialCreateController;
|
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialCreateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialSearchController;
|
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialSearchController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialUpdateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialViewController;
|
import xyz.danielcortes.controllers.mantenedores.editorial.EditorialViewController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaCreateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaSearchController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.empresa.EmpresaViewController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaCreateController;
|
import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaCreateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaSearchController;
|
import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaSearchController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.idioma.IdiomaUpdateController;
|
||||||
@@ -35,14 +34,22 @@ import xyz.danielcortes.controllers.mantenedores.libro.LibroCreateController;
|
|||||||
import xyz.danielcortes.controllers.mantenedores.libro.LibroSearchController;
|
import xyz.danielcortes.controllers.mantenedores.libro.LibroSearchController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.libro.LibroUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.libro.LibroUpdateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.libro.LibroViewController;
|
import xyz.danielcortes.controllers.mantenedores.libro.LibroViewController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoCreateController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoSearchController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoUpdateController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoViewController;
|
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorCreateController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorCreateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorSearchController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorSearchController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorUpdateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorViewController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.TrabajadorViewController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoCreateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoSearchController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.correo.CorreoViewController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionCreateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionSearchController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.direccion.DireccionViewController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoCreateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoSearchController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.mantenedores.trabajador.telefono.TelefonoViewController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioCreateController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioCreateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioUpdateController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioUpdateController;
|
||||||
import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioViewController;
|
import xyz.danielcortes.controllers.mantenedores.trabajador.usuario.UsuarioViewController;
|
||||||
@@ -58,18 +65,26 @@ import xyz.danielcortes.views.mantenedores.categoria.CategoriaCreatePanel;
|
|||||||
import xyz.danielcortes.views.mantenedores.categoria.CategoriaSearchPanel;
|
import xyz.danielcortes.views.mantenedores.categoria.CategoriaSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.categoria.CategoriaUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.categoria.CategoriaUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.categoria.CategoriaViewPanel;
|
import xyz.danielcortes.views.mantenedores.categoria.CategoriaViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoCreatePanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoSearchPanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoViewPanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionCreatePanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionSearchPanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionViewPanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionViewPanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorCreatePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorSearchPanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorUpdatePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.editorial.EditorialCreatePanel;
|
import xyz.danielcortes.views.mantenedores.editorial.EditorialCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.editorial.EditorialSearchPanel;
|
import xyz.danielcortes.views.mantenedores.editorial.EditorialSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.editorial.EditorialUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.editorial.EditorialUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.editorial.EditorialViewPanel;
|
import xyz.danielcortes.views.mantenedores.editorial.EditorialViewPanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaCreatePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaSearchPanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaUpdatePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.idioma.IdiomaCreatePanel;
|
import xyz.danielcortes.views.mantenedores.idioma.IdiomaCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.idioma.IdiomaSearchPanel;
|
import xyz.danielcortes.views.mantenedores.idioma.IdiomaSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.idioma.IdiomaUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.idioma.IdiomaUpdatePanel;
|
||||||
@@ -78,17 +93,17 @@ import xyz.danielcortes.views.mantenedores.libro.LibroCreatePanel;
|
|||||||
import xyz.danielcortes.views.mantenedores.libro.LibroSearchPanel;
|
import xyz.danielcortes.views.mantenedores.libro.LibroSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.libro.LibroUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.libro.LibroUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.libro.LibroViewPanel;
|
import xyz.danielcortes.views.mantenedores.libro.LibroViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoCreatePanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoSearchPanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoViewPanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorCreatePanel;
|
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorSearchPanel;
|
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorSearchPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorViewPanel;
|
import xyz.danielcortes.views.mantenedores.trabajador.TrabajadorViewPanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioCreatePanel;
|
import xyz.danielcortes.views.mantenedores.usuario.UsuarioCreatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.usuario.UsuarioUpdatePanel;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioViewPanel;
|
import xyz.danielcortes.views.mantenedores.usuario.UsuarioViewPanel;
|
||||||
|
|
||||||
public class LaunchController {
|
public class LaunchController {
|
||||||
|
|
||||||
@@ -140,6 +155,16 @@ public class LaunchController {
|
|||||||
this.controllers.put(PanelName.TRABAJADOR_CREATE, new TrabajadorCreateController(new TrabajadorCreatePanel(), this));
|
this.controllers.put(PanelName.TRABAJADOR_CREATE, new TrabajadorCreateController(new TrabajadorCreatePanel(), this));
|
||||||
this.controllers.put(PanelName.TRABAJADOR_UPDATE, new TrabajadorUpdateController(new TrabajadorUpdatePanel(), this));
|
this.controllers.put(PanelName.TRABAJADOR_UPDATE, new TrabajadorUpdateController(new TrabajadorUpdatePanel(), this));
|
||||||
|
|
||||||
|
this.controllers.put(PanelName.DISTRIBUIDOR_VIEW, new DistribuidorViewController(new DistribuidorViewPanel(), this));
|
||||||
|
this.controllers.put(PanelName.DISTRIBUIDOR_SEARCH, new DistribuidorSearchController(new DistribuidorSearchPanel(), this));
|
||||||
|
this.controllers.put(PanelName.DISTRIBUIDOR_CREATE, new DistribuidorCreateController(new DistribuidorCreatePanel(), this));
|
||||||
|
this.controllers.put(PanelName.DISTRIBUIDOR_UPDATE, new DistribuidorUpdateController(new DistribuidorUpdatePanel(), this));
|
||||||
|
|
||||||
|
this.controllers.put(PanelName.EMPRESA_VIEW, new EmpresaViewController(new EmpresaViewPanel(), this));
|
||||||
|
this.controllers.put(PanelName.EMPRESA_SEARCH, new EmpresaSearchController(new EmpresaSearchPanel(), this));
|
||||||
|
this.controllers.put(PanelName.EMPRESA_CREATE, new EmpresaCreateController(new EmpresaCreatePanel(), this));
|
||||||
|
this.controllers.put(PanelName.EMPRESA_UPDATE, new EmpresaUpdateController(new EmpresaUpdatePanel(), this));
|
||||||
|
|
||||||
this.controllers.put(PanelName.USUARIO_VIEW, new UsuarioViewController(new UsuarioViewPanel(), this));
|
this.controllers.put(PanelName.USUARIO_VIEW, new UsuarioViewController(new UsuarioViewPanel(), this));
|
||||||
this.controllers.put(PanelName.USUARIO_CREATE, new UsuarioCreateController(new UsuarioCreatePanel(), this));
|
this.controllers.put(PanelName.USUARIO_CREATE, new UsuarioCreateController(new UsuarioCreatePanel(), this));
|
||||||
this.controllers.put(PanelName.USUARIO_UPDATE, new UsuarioUpdateController(new UsuarioUpdatePanel(), this));
|
this.controllers.put(PanelName.USUARIO_UPDATE, new UsuarioUpdateController(new UsuarioUpdatePanel(), this));
|
||||||
@@ -177,20 +202,15 @@ public class LaunchController {
|
|||||||
|
|
||||||
private JMenu createMantenedoresMenu() {
|
private JMenu createMantenedoresMenu() {
|
||||||
JMenu mantenedoresMenu = new JMenu("Mantenedores");
|
JMenu mantenedoresMenu = new JMenu("Mantenedores");
|
||||||
mantenedoresMenu.setMnemonic(KeyEvent.VK_M);
|
|
||||||
|
|
||||||
JMenuItem librosItem = new JMenuItem("Libros");
|
JMenuItem librosItem = new JMenuItem("Libros");
|
||||||
librosItem.setMnemonic(KeyEvent.VK_L);
|
|
||||||
JMenuItem autoresItem = new JMenuItem("Autores");
|
JMenuItem autoresItem = new JMenuItem("Autores");
|
||||||
autoresItem.setMnemonic(KeyEvent.VK_A);
|
|
||||||
JMenuItem idiomasItem = new JMenuItem("Idiomas");
|
JMenuItem idiomasItem = new JMenuItem("Idiomas");
|
||||||
idiomasItem.setMnemonic(KeyEvent.VK_I);
|
|
||||||
JMenuItem categoriasItem = new JMenuItem("Categorias");
|
JMenuItem categoriasItem = new JMenuItem("Categorias");
|
||||||
categoriasItem.setMnemonic(KeyEvent.VK_C);
|
|
||||||
JMenuItem editorialesItem = new JMenuItem("Editoriales");
|
JMenuItem editorialesItem = new JMenuItem("Editoriales");
|
||||||
editorialesItem.setMnemonic(KeyEvent.VK_E);
|
|
||||||
JMenuItem trabajadoresItem = new JMenuItem("Trabajadores");
|
JMenuItem trabajadoresItem = new JMenuItem("Trabajadores");
|
||||||
trabajadoresItem.setMnemonic(KeyEvent.VK_T);
|
JMenuItem empresasItem = new JMenuItem("Empresas");
|
||||||
|
JMenuItem distribuidoresItem = new JMenuItem("Distribuidores");
|
||||||
|
|
||||||
autoresItem.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH));
|
autoresItem.addActionListener(e -> this.showCard(PanelName.AUTOR_SEARCH));
|
||||||
idiomasItem.addActionListener(e -> this.showCard(PanelName.IDIOMA_SEARCH));
|
idiomasItem.addActionListener(e -> this.showCard(PanelName.IDIOMA_SEARCH));
|
||||||
@@ -198,6 +218,8 @@ public class LaunchController {
|
|||||||
categoriasItem.addActionListener(e -> this.showCard(PanelName.CATEGORIA_SEARCH));
|
categoriasItem.addActionListener(e -> this.showCard(PanelName.CATEGORIA_SEARCH));
|
||||||
editorialesItem.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH));
|
editorialesItem.addActionListener(e -> this.showCard(PanelName.EDITORIAL_SEARCH));
|
||||||
trabajadoresItem.addActionListener(e -> this.showCard(PanelName.TRABAJADOR_SEARCH));
|
trabajadoresItem.addActionListener(e -> this.showCard(PanelName.TRABAJADOR_SEARCH));
|
||||||
|
empresasItem.addActionListener(e -> this.showCard(PanelName.EMPRESA_SEARCH));
|
||||||
|
distribuidoresItem.addActionListener(e -> this.showCard(PanelName.DISTRIBUIDOR_SEARCH));
|
||||||
|
|
||||||
mantenedoresMenu.add(librosItem );
|
mantenedoresMenu.add(librosItem );
|
||||||
mantenedoresMenu.add(autoresItem);
|
mantenedoresMenu.add(autoresItem);
|
||||||
@@ -205,6 +227,8 @@ public class LaunchController {
|
|||||||
mantenedoresMenu.add(categoriasItem);
|
mantenedoresMenu.add(categoriasItem);
|
||||||
mantenedoresMenu.add(editorialesItem);
|
mantenedoresMenu.add(editorialesItem);
|
||||||
mantenedoresMenu.add(trabajadoresItem);
|
mantenedoresMenu.add(trabajadoresItem);
|
||||||
|
mantenedoresMenu.add(empresasItem);
|
||||||
|
mantenedoresMenu.add(distribuidoresItem);
|
||||||
|
|
||||||
return mantenedoresMenu;
|
return mantenedoresMenu;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.DistribuidorRepository;
|
||||||
|
import xyz.danielcortes.repository.EmpresaRepository;
|
||||||
|
import xyz.danielcortes.validator.DistribuidorValidator;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorCreatePanel;
|
||||||
|
|
||||||
|
public class DistribuidorCreateController extends BaseController {
|
||||||
|
|
||||||
|
private DistribuidorCreatePanel view;
|
||||||
|
private DistribuidorRepository respository;
|
||||||
|
private EmpresaRepository empresaRepository;
|
||||||
|
private DistribuidorValidator validator;
|
||||||
|
|
||||||
|
public DistribuidorCreateController(DistribuidorCreatePanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.respository = new DistribuidorRepository();
|
||||||
|
this.empresaRepository = new EmpresaRepository();
|
||||||
|
this.validator = new DistribuidorValidator(this.respository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.fillEmpresasCombobox();
|
||||||
|
this.view.getRutField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getGuardarButton().addActionListener(e -> save());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillEmpresasCombobox() {
|
||||||
|
this.view.getEmpresaModel().removeAllElements();
|
||||||
|
this.view.getEmpresaModel().addAll(empresaRepository.getAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void save() {
|
||||||
|
String rut = this.view.getRutField().getText();
|
||||||
|
ValidationResult rutValidation = this.validator.validateRut(rut);
|
||||||
|
if(rutValidation.hasError()){
|
||||||
|
rutValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Empresa empresa = (Empresa) this.view.getEmpresaCombobox().getSelectedItem();
|
||||||
|
ValidationResult empresaValidation = this.validator.validateEmpresa(empresa);
|
||||||
|
if(empresaValidation.hasError()){
|
||||||
|
empresaValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Distribuidor distribuidor = new Distribuidor();
|
||||||
|
distribuidor.setRut(rut);
|
||||||
|
distribuidor.setEmpresa(empresa);
|
||||||
|
|
||||||
|
respository.save(distribuidor);
|
||||||
|
|
||||||
|
this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
import xyz.danielcortes.repository.DistribuidorRepository;
|
||||||
|
import xyz.danielcortes.validator.DistribuidorValidator;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorSearchPanel;
|
||||||
|
|
||||||
|
public class DistribuidorSearchController extends BaseController {
|
||||||
|
|
||||||
|
private DistribuidorSearchPanel view;
|
||||||
|
private DistribuidorRepository distribuidorRepository;
|
||||||
|
private DistribuidorValidator distribuidorValidator;
|
||||||
|
|
||||||
|
public DistribuidorSearchController(DistribuidorSearchPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.distribuidorRepository = new DistribuidorRepository();
|
||||||
|
this.distribuidorValidator = new DistribuidorValidator(this.distribuidorRepository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.reload();
|
||||||
|
this.view.getDistribuidorTable().clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void reload() {
|
||||||
|
this.loadDistribuidorTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getCrearButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_CREATE));
|
||||||
|
this.view.getSearchField().addActionListener(e -> this.search());
|
||||||
|
this.view.getBuscarButton().addActionListener(e -> this.search());
|
||||||
|
this.view.getVerButton().addActionListener(e -> this.view());
|
||||||
|
this.view.getEditarButton().addActionListener(e -> this.edit());
|
||||||
|
this.view.getEliminarButton().addActionListener(e -> this.delete());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
|
Distribuidor distribuidor = this.getSelectedDistribuidor();
|
||||||
|
if (distribuidor != null) {
|
||||||
|
DistribuidorUpdateController controller = (DistribuidorUpdateController) this.getParentController().getCard(PanelName.DISTRIBUIDOR_UPDATE);
|
||||||
|
controller.setDistribuidor(distribuidor);
|
||||||
|
this.getParentController().showCard(PanelName.DISTRIBUIDOR_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
Distribuidor distribuidor = this.getSelectedDistribuidor();
|
||||||
|
if (distribuidor == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int option = JOptionPane.showConfirmDialog(
|
||||||
|
null,
|
||||||
|
"¿Estas seguro de que deseas eliminar el distribuidor?",
|
||||||
|
"Confirmacion",
|
||||||
|
JOptionPane.YES_NO_OPTION,
|
||||||
|
JOptionPane.QUESTION_MESSAGE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (option == JOptionPane.NO_OPTION)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.distribuidorRepository.delete(distribuidor);
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void view() {
|
||||||
|
Distribuidor distribuidor = this.getSelectedDistribuidor();
|
||||||
|
if (distribuidor != null) {
|
||||||
|
DistribuidorViewController controller = (DistribuidorViewController) this.getParentController().getCard(PanelName.DISTRIBUIDOR_VIEW);
|
||||||
|
controller.setDistribuidor(distribuidor);
|
||||||
|
this.getParentController().showCard(PanelName.DISTRIBUIDOR_VIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void search() {
|
||||||
|
String term = this.view.getSearchField().getText();
|
||||||
|
List<Distribuidor> distribuidores = this.distribuidorRepository.search(term);
|
||||||
|
this.loadDistribuidorTable(distribuidores);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadDistribuidorTable() {
|
||||||
|
List<Distribuidor> distribuidores = this.distribuidorRepository.getAll();
|
||||||
|
loadDistribuidorTable(distribuidores);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadDistribuidorTable(List<Distribuidor> distribuidores) {
|
||||||
|
BaseTableModel<Distribuidor> model = this.view.getDistribuidorModel();
|
||||||
|
model.setRows(distribuidores);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Distribuidor getSelectedDistribuidor() {
|
||||||
|
int selectedRow = this.view.getDistribuidorTable().getSelectedRow();
|
||||||
|
if (selectedRow == -1) {
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No hay distribuidor seleccionado",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.view.getDistribuidorModel().getRow(selectedRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.DistribuidorRepository;
|
||||||
|
import xyz.danielcortes.repository.EmpresaRepository;
|
||||||
|
import xyz.danielcortes.validator.DistribuidorValidator;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorUpdatePanel;
|
||||||
|
|
||||||
|
public class DistribuidorUpdateController extends BaseController {
|
||||||
|
private Distribuidor distribuidor;
|
||||||
|
private DistribuidorUpdatePanel view;
|
||||||
|
private DistribuidorRepository distribuidorRepository;
|
||||||
|
private EmpresaRepository empresaRepository;
|
||||||
|
private DistribuidorValidator distribuidorValidator;
|
||||||
|
|
||||||
|
public DistribuidorUpdateController(DistribuidorUpdatePanel view, LaunchController parent){
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.distribuidorRepository = new DistribuidorRepository();
|
||||||
|
this.empresaRepository = new EmpresaRepository();
|
||||||
|
this.distribuidorValidator = new DistribuidorValidator(this.distribuidorRepository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistribuidor(Distribuidor distribuidor) {
|
||||||
|
this.distribuidor = distribuidor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.fillEmpresaCombobox();
|
||||||
|
this.fillDistribuidor();
|
||||||
|
this.view.getRutField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillEmpresaCombobox() {
|
||||||
|
this.view.getEmpresaModel().removeAllElements();
|
||||||
|
this.view.getEmpresaModel().addAll(this.empresaRepository.getAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillDistribuidor() {
|
||||||
|
if(distribuidorRepository == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getRutField().setText(this.distribuidor.getRut());
|
||||||
|
this.view.getEmpresaCombobox().setSelectedItem(this.distribuidor.getEmpresa());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getActualizarButton().addActionListener(e -> update());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
ValidationResult originalValidation = this.distribuidorValidator.validateOriginal(this.distribuidor);
|
||||||
|
if(originalValidation.hasError()){
|
||||||
|
originalValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String rut = this.view.getRutField().getText();
|
||||||
|
ValidationResult rutValidation = this.distribuidorValidator.validateRut(rut);
|
||||||
|
if(rutValidation.hasError()){
|
||||||
|
rutValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Empresa empresa = (Empresa) this.view.getEmpresaCombobox().getSelectedItem();
|
||||||
|
ValidationResult empresaValidation = this.distribuidorValidator.validateEmpresa(empresa);
|
||||||
|
if(empresaValidation.hasError()){
|
||||||
|
empresaValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
assert this.distribuidor != null;
|
||||||
|
this.distribuidor.setRut(rut);
|
||||||
|
this.distribuidor.setEmpresa(empresa);
|
||||||
|
this.distribuidorRepository.update(this.distribuidor);
|
||||||
|
|
||||||
|
this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() { return view; }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
import xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorViewPanel;
|
||||||
|
|
||||||
|
public class DistribuidorViewController extends BaseController {
|
||||||
|
|
||||||
|
private Distribuidor distribuidor;
|
||||||
|
private DistribuidorViewPanel view;
|
||||||
|
|
||||||
|
public DistribuidorViewController(DistribuidorViewPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
this.fillDistribuidor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistribuidor(Distribuidor distribuidor) {
|
||||||
|
this.distribuidor = distribuidor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.DISTRIBUIDOR_SEARCH));
|
||||||
|
// this.view.getCorreosButton().addActionListener(e -> this.gotoCorreosView());
|
||||||
|
// this.view.getTelefonosButton().addActionListener(e -> this.gotoTelefonoView());
|
||||||
|
// this.view.getDireccionesButton().addActionListener(e -> this.gotoDireccionView());
|
||||||
|
}
|
||||||
|
|
||||||
|
// private void gotoDireccionView() {
|
||||||
|
// DireccionSearchController controller = (DireccionSearchController) this.getParentController().getCard(PanelName.DIRECCION_SEARCH);
|
||||||
|
// controller.setDistribuidor(distribuidor);
|
||||||
|
// this.getParentController().showCard(PanelName.DIRECCION_SEARCH);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void gotoTelefonoView() {
|
||||||
|
// TelefonoSearchController controller = (TelefonoSearchController) this.getParentController().getCard(PanelName.TELEFONO_SEARCH);
|
||||||
|
// controller.setDistribuidor(distribuidor);
|
||||||
|
// this.getParentController().showCard(PanelName.TELEFONO_SEARCH);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void gotoCorreosView() {
|
||||||
|
// CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH);
|
||||||
|
// controller.setDistribuidor(distribuidor);
|
||||||
|
// this.getParentController().showCard(PanelName.CORREO_SEARCH);
|
||||||
|
// }
|
||||||
|
|
||||||
|
private void fillDistribuidor() {
|
||||||
|
if (distribuidor == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getRutField().setText(this.distribuidor.getRut());
|
||||||
|
this.view.getEmpresaField().setText(this.distribuidor.getEmpresa().getNombre());
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.empresa;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.EmpresaRepository;
|
||||||
|
import xyz.danielcortes.validator.EmpresaValidator;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaCreatePanel;
|
||||||
|
|
||||||
|
public class EmpresaCreateController extends BaseController {
|
||||||
|
|
||||||
|
private EmpresaRepository empresaRepository;
|
||||||
|
private EmpresaCreatePanel view;
|
||||||
|
private EmpresaValidator validator;
|
||||||
|
|
||||||
|
public EmpresaCreateController(EmpresaCreatePanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.empresaRepository = new EmpresaRepository();
|
||||||
|
this.validator = new EmpresaValidator(this.empresaRepository);
|
||||||
|
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.view.getNombreField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getGuardarButton().addActionListener(e -> save());
|
||||||
|
this.view.getNombreField().addActionListener(e -> save());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.EMPRESA_SEARCH));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void save() {
|
||||||
|
String nombre = this.view.getNombreField().getText();
|
||||||
|
ValidationResult nombreValidation = this.validator.validateNombre(nombre);
|
||||||
|
if(nombreValidation.hasError()){
|
||||||
|
nombreValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Empresa empresa = new Empresa();
|
||||||
|
empresa.setNombre(nombre);
|
||||||
|
|
||||||
|
this.empresaRepository.save(empresa);
|
||||||
|
|
||||||
|
this.view.getNombreField().setText("");
|
||||||
|
this.view.getNombreField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.empresa;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.EmpresaRepository;
|
||||||
|
import xyz.danielcortes.validator.EmpresaValidator;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaSearchPanel;
|
||||||
|
|
||||||
|
public class EmpresaSearchController extends BaseController {
|
||||||
|
private EmpresaSearchPanel view;
|
||||||
|
private EmpresaRepository empresaRepository;
|
||||||
|
private EmpresaValidator validator;
|
||||||
|
|
||||||
|
public EmpresaSearchController(EmpresaSearchPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.empresaRepository = new EmpresaRepository();
|
||||||
|
this.validator = new EmpresaValidator(this.empresaRepository);
|
||||||
|
this.loadEmpresaTable();
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
this.loadEmpresaTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners(){
|
||||||
|
this.view.getCrearButton().addActionListener(e -> this.getParentController().showCard(PanelName.EMPRESA_CREATE));
|
||||||
|
this.view.getBuscarButton().addActionListener(e -> search());
|
||||||
|
this.view.getBuscarField().addActionListener(e -> search());
|
||||||
|
this.view.getEliminarButton().addActionListener(e -> delete());
|
||||||
|
this.view.getEditarButton().addActionListener(e -> edit());
|
||||||
|
this.view.getVerButton().addActionListener(e -> view());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void view() {
|
||||||
|
Empresa empresa = this.getSelectedEmpresa();
|
||||||
|
if(empresa != null) {
|
||||||
|
EmpresaViewController controller = (EmpresaViewController) this.getParentController().getCard(PanelName.EMPRESA_VIEW);
|
||||||
|
controller.setEmpresa(empresa);
|
||||||
|
this.getParentController().showCard(PanelName.EMPRESA_VIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
|
Empresa empresa = this.getSelectedEmpresa();
|
||||||
|
if(empresa != null) {
|
||||||
|
EmpresaUpdateController controller = (EmpresaUpdateController) this.getParentController().getCard(PanelName.EMPRESA_UPDATE);
|
||||||
|
controller.setEmpresa(empresa);
|
||||||
|
this.getParentController().showCard(PanelName.EMPRESA_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
Empresa empresa = this.getSelectedEmpresa();
|
||||||
|
if (empresa == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int option = JOptionPane.showConfirmDialog(
|
||||||
|
null,
|
||||||
|
"¿Estas seguro de que deseas eliminar la empresa?",
|
||||||
|
"Confirmacion",
|
||||||
|
JOptionPane.YES_NO_OPTION,
|
||||||
|
JOptionPane.QUESTION_MESSAGE
|
||||||
|
);
|
||||||
|
if (option == JOptionPane.NO_OPTION)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.empresaRepository.delete(empresa);
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void search() {
|
||||||
|
String term = this.view.getBuscarField().getText();
|
||||||
|
List<Empresa> empresaes = this.empresaRepository.search(term);
|
||||||
|
this.loadEmpresaTable(empresaes);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadEmpresaTable(List<Empresa> empresas){
|
||||||
|
BaseTableModel<Empresa> model = this.view.getEmpresaModel();
|
||||||
|
model.setRows(empresas);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadEmpresaTable(){
|
||||||
|
List<Empresa> empresas = this.empresaRepository.getAll();
|
||||||
|
loadEmpresaTable(empresas);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Empresa getSelectedEmpresa() {
|
||||||
|
int selectedRow = this.view.getEmpresaTable().getSelectedRow();
|
||||||
|
if (selectedRow == -1) {
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No hay empresa seleccionada",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.view.getEmpresaModel().getRow(selectedRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.empresa;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.EmpresaRepository;
|
||||||
|
import xyz.danielcortes.validator.EmpresaValidator;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaUpdatePanel;
|
||||||
|
|
||||||
|
public class EmpresaUpdateController extends BaseController {
|
||||||
|
|
||||||
|
private EmpresaUpdatePanel view;
|
||||||
|
private EmpresaRepository empresaRepository;
|
||||||
|
private EmpresaValidator validator;
|
||||||
|
private Empresa empresa;
|
||||||
|
|
||||||
|
public EmpresaUpdateController(EmpresaUpdatePanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.empresaRepository = new EmpresaRepository();
|
||||||
|
this.validator = new EmpresaValidator(this.empresaRepository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
if(this.empresa == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getNombreField().setText(this.empresa.getNombre());
|
||||||
|
this.view.getNombreField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getNombreField().addActionListener(e -> this.update());
|
||||||
|
this.view.getActualizarButton().addActionListener(e -> this.update());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
ValidationResult originalValidation = this.validator.validateOriginal(this.empresa);
|
||||||
|
if(originalValidation.hasError()){
|
||||||
|
originalValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String nombre = this.view.getNombreField().getText();
|
||||||
|
ValidationResult nombreValidation = this.validator.validateNombre(nombre);
|
||||||
|
if(nombreValidation.hasError()){
|
||||||
|
nombreValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert this.empresa != null;
|
||||||
|
this.empresa.setNombre(nombre);
|
||||||
|
this.empresaRepository.update(this.empresa);
|
||||||
|
|
||||||
|
this.getParentController().showCard(PanelName.EMPRESA_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package xyz.danielcortes.controllers.mantenedores.empresa;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.views.mantenedores.empresa.EmpresaViewPanel;
|
||||||
|
|
||||||
|
public class EmpresaViewController extends BaseController {
|
||||||
|
private Empresa empresa;
|
||||||
|
private EmpresaViewPanel view;
|
||||||
|
|
||||||
|
public EmpresaViewController(EmpresaViewPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.fillEmpresa();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa){
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners(){
|
||||||
|
this.view.getVolverButton().addActionListener(e -> {
|
||||||
|
this.getParentController().showCard(PanelName.EMPRESA_SEARCH);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillEmpresa() {
|
||||||
|
if(empresa == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.view.getNombreField().setText(this.empresa.getNombre());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import xyz.danielcortes.models.Correo;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.CorreoRepository;
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
import xyz.danielcortes.validator.CorreoValidator;
|
import xyz.danielcortes.validator.CorreoValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoCreatePanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoCreatePanel;
|
||||||
|
|
||||||
public class CorreoCreateController extends BaseController {
|
public class CorreoCreateController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import xyz.danielcortes.models.Correo;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.CorreoRepository;
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
import xyz.danielcortes.validator.CorreoValidator;
|
import xyz.danielcortes.validator.CorreoValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoSearchPanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoSearchPanel;
|
||||||
|
|
||||||
public class CorreoSearchController extends BaseController {
|
public class CorreoSearchController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import xyz.danielcortes.models.Correo;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.CorreoRepository;
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
import xyz.danielcortes.validator.CorreoValidator;
|
import xyz.danielcortes.validator.CorreoValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoUpdatePanel;
|
||||||
|
|
||||||
public class CorreoUpdateController extends BaseController {
|
public class CorreoUpdateController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import xyz.danielcortes.framework.BasePanel;
|
|||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Correo;
|
import xyz.danielcortes.models.Correo;
|
||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoViewPanel;
|
import xyz.danielcortes.views.mantenedores.correo.CorreoViewPanel;
|
||||||
|
|
||||||
public class CorreoViewController extends BaseController {
|
public class CorreoViewController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import xyz.danielcortes.models.Direccion;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.DireccionRepository;
|
import xyz.danielcortes.repository.DireccionRepository;
|
||||||
import xyz.danielcortes.validator.DireccionValidator;
|
import xyz.danielcortes.validator.DireccionValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionCreatePanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionCreatePanel;
|
||||||
|
|
||||||
public class DireccionCreateController extends BaseController {
|
public class DireccionCreateController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import xyz.danielcortes.models.Direccion;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.DireccionRepository;
|
import xyz.danielcortes.repository.DireccionRepository;
|
||||||
import xyz.danielcortes.validator.DireccionValidator;
|
import xyz.danielcortes.validator.DireccionValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionSearchPanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionSearchPanel;
|
||||||
|
|
||||||
public class DireccionSearchController extends BaseController {
|
public class DireccionSearchController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import xyz.danielcortes.models.Direccion;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.DireccionRepository;
|
import xyz.danielcortes.repository.DireccionRepository;
|
||||||
import xyz.danielcortes.validator.DireccionValidator;
|
import xyz.danielcortes.validator.DireccionValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionUpdatePanel;
|
||||||
|
|
||||||
public class DireccionUpdateController extends BaseController {
|
public class DireccionUpdateController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import xyz.danielcortes.framework.BasePanel;
|
|||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Direccion;
|
import xyz.danielcortes.models.Direccion;
|
||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionViewPanel;
|
import xyz.danielcortes.views.mantenedores.direccion.DireccionViewPanel;
|
||||||
|
|
||||||
public class DireccionViewController extends BaseController {
|
public class DireccionViewController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import xyz.danielcortes.models.Telefono;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.TelefonoRepository;
|
import xyz.danielcortes.repository.TelefonoRepository;
|
||||||
import xyz.danielcortes.validator.TelefonoValidator;
|
import xyz.danielcortes.validator.TelefonoValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoCreatePanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoCreatePanel;
|
||||||
|
|
||||||
public class TelefonoCreateController extends BaseController {
|
public class TelefonoCreateController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import xyz.danielcortes.models.Telefono;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.TelefonoRepository;
|
import xyz.danielcortes.repository.TelefonoRepository;
|
||||||
import xyz.danielcortes.validator.TelefonoValidator;
|
import xyz.danielcortes.validator.TelefonoValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoSearchPanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoSearchPanel;
|
||||||
|
|
||||||
public class TelefonoSearchController extends BaseController {
|
public class TelefonoSearchController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import xyz.danielcortes.models.Telefono;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.TelefonoRepository;
|
import xyz.danielcortes.repository.TelefonoRepository;
|
||||||
import xyz.danielcortes.validator.TelefonoValidator;
|
import xyz.danielcortes.validator.TelefonoValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoUpdatePanel;
|
||||||
|
|
||||||
public class TelefonoUpdateController extends BaseController {
|
public class TelefonoUpdateController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import xyz.danielcortes.framework.BasePanel;
|
|||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Telefono;
|
import xyz.danielcortes.models.Telefono;
|
||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoViewPanel;
|
import xyz.danielcortes.views.mantenedores.telefono.TelefonoViewPanel;
|
||||||
|
|
||||||
public class TelefonoViewController extends BaseController {
|
public class TelefonoViewController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import xyz.danielcortes.models.Trabajador;
|
|||||||
import xyz.danielcortes.models.Usuario;
|
import xyz.danielcortes.models.Usuario;
|
||||||
import xyz.danielcortes.repository.UsuarioRepository;
|
import xyz.danielcortes.repository.UsuarioRepository;
|
||||||
import xyz.danielcortes.validator.UsuarioValidator;
|
import xyz.danielcortes.validator.UsuarioValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioCreatePanel;
|
import xyz.danielcortes.views.mantenedores.usuario.UsuarioCreatePanel;
|
||||||
|
|
||||||
public class UsuarioCreateController extends BaseController {
|
public class UsuarioCreateController extends BaseController {
|
||||||
private Trabajador trabajador;
|
private Trabajador trabajador;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import xyz.danielcortes.framework.ValidationResult;
|
|||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.UsuarioRepository;
|
import xyz.danielcortes.repository.UsuarioRepository;
|
||||||
import xyz.danielcortes.validator.UsuarioValidator;
|
import xyz.danielcortes.validator.UsuarioValidator;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioUpdatePanel;
|
import xyz.danielcortes.views.mantenedores.usuario.UsuarioUpdatePanel;
|
||||||
|
|
||||||
public class UsuarioUpdateController extends BaseController {
|
public class UsuarioUpdateController extends BaseController {
|
||||||
private Trabajador trabajador;
|
private Trabajador trabajador;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import xyz.danielcortes.framework.BasePanel;
|
|||||||
import xyz.danielcortes.framework.PanelName;
|
import xyz.danielcortes.framework.PanelName;
|
||||||
import xyz.danielcortes.models.Trabajador;
|
import xyz.danielcortes.models.Trabajador;
|
||||||
import xyz.danielcortes.repository.UsuarioRepository;
|
import xyz.danielcortes.repository.UsuarioRepository;
|
||||||
import xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioViewPanel;
|
import xyz.danielcortes.views.mantenedores.usuario.UsuarioViewPanel;
|
||||||
|
|
||||||
public class UsuarioViewController extends BaseController {
|
public class UsuarioViewController extends BaseController {
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,16 @@ public enum PanelName {
|
|||||||
TRABAJADOR_CREATE,
|
TRABAJADOR_CREATE,
|
||||||
TRABAJADOR_UPDATE,
|
TRABAJADOR_UPDATE,
|
||||||
|
|
||||||
|
EMPRESA_VIEW,
|
||||||
|
EMPRESA_SEARCH,
|
||||||
|
EMPRESA_CREATE,
|
||||||
|
EMPRESA_UPDATE,
|
||||||
|
|
||||||
|
DISTRIBUIDOR_VIEW,
|
||||||
|
DISTRIBUIDOR_SEARCH,
|
||||||
|
DISTRIBUIDOR_CREATE,
|
||||||
|
DISTRIBUIDOR_UPDATE,
|
||||||
|
|
||||||
USUARIO_VIEW,
|
USUARIO_VIEW,
|
||||||
USUARIO_CREATE,
|
USUARIO_CREATE,
|
||||||
USUARIO_UPDATE,
|
USUARIO_UPDATE,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import javax.persistence.Table;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "correo")
|
@Table(name = "correo")
|
||||||
public class Correo {
|
public class Correo {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@Column(name = "id", nullable = false)
|
@Column(name = "id", nullable = false)
|
||||||
@@ -32,6 +33,14 @@ public class Correo {
|
|||||||
)
|
)
|
||||||
private List<Trabajador> trabajadores;
|
private List<Trabajador> trabajadores;
|
||||||
|
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(
|
||||||
|
name = "distribuidor_direccion",
|
||||||
|
joinColumns = @JoinColumn(name = "direccion_id", referencedColumnName = "id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "distribuidor_id", referencedColumnName = "id")
|
||||||
|
)
|
||||||
|
private List<Distribuidor> distribuidores;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -59,6 +68,16 @@ public class Correo {
|
|||||||
this.trabajadores = trabajador;
|
this.trabajadores = trabajador;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Distribuidor> getDistribuidores() {
|
||||||
|
if(distribuidores == null)
|
||||||
|
distribuidores = new ArrayList<>();
|
||||||
|
return distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistribuidores(List<Distribuidor> distribuidores) {
|
||||||
|
this.distribuidores = distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ public class Direccion {
|
|||||||
)
|
)
|
||||||
private List<Trabajador> trabajadores;
|
private List<Trabajador> trabajadores;
|
||||||
|
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(
|
||||||
|
name = "distribuidor_direccion",
|
||||||
|
joinColumns = @JoinColumn(name = "direccion_id", referencedColumnName = "id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "distribuidor_id", referencedColumnName = "id")
|
||||||
|
)
|
||||||
|
private List<Distribuidor> distribuidores;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -71,6 +79,16 @@ public class Direccion {
|
|||||||
this.trabajadores = trabajador;
|
this.trabajadores = trabajador;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Distribuidor> getDistribuidores() {
|
||||||
|
if(distribuidores == null)
|
||||||
|
distribuidores = new ArrayList<>();
|
||||||
|
return distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistribuidores(List<Distribuidor> distribuidores) {
|
||||||
|
this.distribuidores = distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|||||||
61
src/main/java/xyz/danielcortes/models/Distribuidor.java
Normal file
61
src/main/java/xyz/danielcortes/models/Distribuidor.java
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
package xyz.danielcortes.models;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToMany;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "distribuidor")
|
||||||
|
public class Distribuidor {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name="rut")
|
||||||
|
private String rut;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "empresa_id")
|
||||||
|
private Empresa empresa;
|
||||||
|
|
||||||
|
@ManyToMany(mappedBy = "distribuidores")
|
||||||
|
private List<Correo> correos;
|
||||||
|
|
||||||
|
@ManyToMany(mappedBy = "distribuidores")
|
||||||
|
private List<Telefono> telefonos;
|
||||||
|
|
||||||
|
@ManyToMany(mappedBy = "distribuidores")
|
||||||
|
private List<Direccion> direcciones;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRut() {
|
||||||
|
return rut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRut(String rut) {
|
||||||
|
this.rut = rut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/main/java/xyz/danielcortes/models/Empresa.java
Normal file
59
src/main/java/xyz/danielcortes/models/Empresa.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
package xyz.danielcortes.models;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.OneToMany;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "empresa")
|
||||||
|
public class Empresa {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "nombre")
|
||||||
|
private String nombre;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "empresa")
|
||||||
|
private List<Distribuidor> distribuidores;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNombre() {
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNombre(String nombre) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Distribuidor> getDistribuidores() {
|
||||||
|
if(distribuidores == null){
|
||||||
|
distribuidores = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistribuidores(List<Distribuidor> distribuidores) {
|
||||||
|
this.distribuidores = distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.nombre;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,14 @@ public class Telefono {
|
|||||||
)
|
)
|
||||||
private List<Trabajador> trabajadores;
|
private List<Trabajador> trabajadores;
|
||||||
|
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(
|
||||||
|
name = "distribuidor_direccion",
|
||||||
|
joinColumns = @JoinColumn(name = "direccion_id", referencedColumnName = "id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "distribuidor_id", referencedColumnName = "id")
|
||||||
|
)
|
||||||
|
private List<Distribuidor> distribuidores;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -59,6 +67,16 @@ public class Telefono {
|
|||||||
this.trabajadores = trabajadores;
|
this.trabajadores = trabajadores;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Distribuidor> getDistribuidores() {
|
||||||
|
if(distribuidores == null)
|
||||||
|
distribuidores = new ArrayList<>();
|
||||||
|
return distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistribuidores(List<Distribuidor> distribuidores) {
|
||||||
|
this.distribuidores = distribuidores;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package xyz.danielcortes.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.persistence.Query;
|
||||||
|
import javax.persistence.TypedQuery;
|
||||||
|
import xyz.danielcortes.framework.BaseRepository;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
|
||||||
|
public class DistribuidorRepository extends BaseRepository<Distribuidor> {
|
||||||
|
|
||||||
|
public List<Distribuidor> getAll() {
|
||||||
|
TypedQuery<Distribuidor> query = em.createQuery("SELECT d FROM Distribuidor d", Distribuidor.class);
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Distribuidor> search(String term) {
|
||||||
|
Query query = em.createQuery("SELECT d FROM Distribuidor d JOIN d.empresa e WHERE e.id = d.empresa.id AND (LOWER(e.nombre) LIKE :term OR LOWER(d.rut) LIKE :term)" );
|
||||||
|
query.setParameter("term", "%" + term + "%");
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package xyz.danielcortes.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.persistence.Query;
|
||||||
|
import javax.persistence.TypedQuery;
|
||||||
|
import xyz.danielcortes.framework.BaseRepository;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
|
||||||
|
public class EmpresaRepository extends BaseRepository<Empresa> {
|
||||||
|
|
||||||
|
public List<Empresa> getAll() {
|
||||||
|
TypedQuery<Empresa> query = em.createQuery("SELECT e FROM Empresa e", Empresa.class);
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Empresa> search(String term) {
|
||||||
|
Query query = em.createQuery("SELECT e FROM Empresa e WHERE LOWER(e.nombre) LIKE :term" );
|
||||||
|
query.setParameter("term", "%" + term.toLowerCase() + "%");
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package xyz.danielcortes.validator;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.DistribuidorRepository;
|
||||||
|
|
||||||
|
public class DistribuidorValidator {
|
||||||
|
|
||||||
|
private DistribuidorRepository distribuidorRepository;
|
||||||
|
|
||||||
|
public DistribuidorValidator(DistribuidorRepository distribuidorRepository) {
|
||||||
|
this.distribuidorRepository = distribuidorRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateRut(String rut) {
|
||||||
|
if (rut == null) {
|
||||||
|
return new ValidationResult("El rut es nulo");
|
||||||
|
} else if (rut.isEmpty()) {
|
||||||
|
return new ValidationResult("El rut esta vacío");
|
||||||
|
} else if(rut.length() < 4){
|
||||||
|
return new ValidationResult("El rut es muy corto");
|
||||||
|
}
|
||||||
|
if (!rutChecksum(rut)) {
|
||||||
|
return new ValidationResult("El rut es invalido");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateEmpresa(Empresa empresa) {
|
||||||
|
if(empresa == null) {
|
||||||
|
return new ValidationResult("La empresa no existe");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateOriginal(Distribuidor distribuidor) {
|
||||||
|
if(distribuidor == null){
|
||||||
|
return new ValidationResult("El distribuidor es nulo");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean rutChecksum(String rut) {
|
||||||
|
char lastchar = rut.charAt(rut.length() - 1);
|
||||||
|
rut = rut.toLowerCase().replaceAll("[^\\dkK]", "");
|
||||||
|
|
||||||
|
int sum = 0;
|
||||||
|
for (int i = rut.length() - 2, j = 2; i >= 0; i--, j++) {
|
||||||
|
int digit = rut.charAt(i) - '0';
|
||||||
|
if (j == 8)
|
||||||
|
j = 2;
|
||||||
|
|
||||||
|
sum += digit * j;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mod11 = 11 - (sum % 11);
|
||||||
|
|
||||||
|
char digitoVerificador = (char) (mod11 + '0');
|
||||||
|
if (mod11 == 11)
|
||||||
|
digitoVerificador = '0';
|
||||||
|
if (mod11 == 10)
|
||||||
|
digitoVerificador = 'k';
|
||||||
|
|
||||||
|
return lastchar == digitoVerificador;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package xyz.danielcortes.validator;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.repository.EmpresaRepository;
|
||||||
|
|
||||||
|
public class EmpresaValidator {
|
||||||
|
|
||||||
|
private EmpresaRepository empresaRespository;
|
||||||
|
|
||||||
|
public EmpresaValidator(EmpresaRepository empresaRespository) {
|
||||||
|
this.empresaRespository = empresaRespository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateNombre(String nombre) {
|
||||||
|
if (nombre == null) {
|
||||||
|
return new ValidationResult("El nombre es nulo");
|
||||||
|
} else if (nombre.isEmpty()) {
|
||||||
|
return new ValidationResult("El nombre esta vacío");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateOriginal(Empresa empresa) {
|
||||||
|
if(empresa == null){
|
||||||
|
return new ValidationResult("El empresa es nula");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -44,6 +44,8 @@ public class TrabajadorValidator {
|
|||||||
return new ValidationResult("El rut es nulo");
|
return new ValidationResult("El rut es nulo");
|
||||||
} else if (rut.isEmpty()) {
|
} else if (rut.isEmpty()) {
|
||||||
return new ValidationResult("El rut esta vacío");
|
return new ValidationResult("El rut esta vacío");
|
||||||
|
} else if (rut.length() < 4) {
|
||||||
|
return new ValidationResult("El rut es muy corto");
|
||||||
}
|
}
|
||||||
if (!rutChecksum(rut)) {
|
if (!rutChecksum(rut)) {
|
||||||
return new ValidationResult("El rut es invalido");
|
return new ValidationResult("El rut es invalido");
|
||||||
@@ -60,6 +62,7 @@ public class TrabajadorValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean rutChecksum(String rut) {
|
private boolean rutChecksum(String rut) {
|
||||||
|
char lastchar = rut.charAt(rut.length() - 1);
|
||||||
rut = rut.toLowerCase().replaceAll("[^\\dkK]", "");
|
rut = rut.toLowerCase().replaceAll("[^\\dkK]", "");
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (int i = rut.length() - 2, j = 2; i >= 0; i--, j++) {
|
for (int i = rut.length() - 2, j = 2; i >= 0; i--, j++) {
|
||||||
@@ -71,7 +74,6 @@ public class TrabajadorValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int mod11 = 11 - (sum % 11);
|
int mod11 = 11 - (sum % 11);
|
||||||
char lastchar = rut.charAt(rut.length() - 1);
|
|
||||||
|
|
||||||
char digitoVerificador = (char) (mod11 + '0');
|
char digitoVerificador = (char) (mod11 + '0');
|
||||||
if (mod11 == 11)
|
if (mod11 == 11)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoCreatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.correo.CorreoCreatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.correo;
|
package xyz.danielcortes.views.mantenedores.correo;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoSearchPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.correo.CorreoSearchPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.correo;
|
package xyz.danielcortes.views.mantenedores.correo;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoUpdatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.correo.CorreoUpdatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.correo;
|
package xyz.danielcortes.views.mantenedores.correo;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.correo.CorreoViewPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.correo.CorreoViewPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.correo;
|
package xyz.danielcortes.views.mantenedores.correo;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionCreatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.direccion.DireccionCreatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.direccion;
|
package xyz.danielcortes.views.mantenedores.direccion;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionSearchPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.direccion.DireccionSearchPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.direccion;
|
package xyz.danielcortes.views.mantenedores.direccion;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionUpdatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.direccion.DireccionUpdatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.direccion;
|
package xyz.danielcortes.views.mantenedores.direccion;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.direccion.DireccionViewPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.direccion.DireccionViewPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.direccion;
|
package xyz.danielcortes.views.mantenedores.direccion;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorCreatePanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="518" height="218"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<vspacer id="8d91b">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="a8101">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="f2d12">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<grid id="4b9e5" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="a11e3" class="javax.swing.JButton" binding="guardarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Guardar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="ef3e2" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<component id="8fb77" class="javax.swing.JTextField" binding="rutField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="23030" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Rut:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="ca950" class="javax.swing.JComboBox" binding="empresaCombobox" custom-create="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="7f01c" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Empresa:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
|
||||||
|
public class DistribuidorCreatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JButton guardarButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField rutField;
|
||||||
|
private JComboBox<Empresa> empresaCombobox;
|
||||||
|
private DefaultComboBoxModel<Empresa> empresaModel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getGuardarButton() {
|
||||||
|
return guardarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRutField() {
|
||||||
|
return rutField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JComboBox<Empresa> getEmpresaCombobox() {
|
||||||
|
return empresaCombobox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultComboBoxModel<Empresa> getEmpresaModel() {
|
||||||
|
return empresaModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
createUIComponents();
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(6, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(5, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
guardarButton = new JButton();
|
||||||
|
guardarButton.setText("Guardar");
|
||||||
|
panel1.add(guardarButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
panel1.add(volverButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
rutField = new JTextField();
|
||||||
|
contentPane.add(rutField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Rut:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
contentPane.add(empresaCombobox,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("Empresa:");
|
||||||
|
contentPane.add(label2, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.empresaModel = new DefaultComboBoxModel<>();
|
||||||
|
this.empresaCombobox = new JComboBox<>(empresaModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorSearchPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="501" height="443"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<scrollpane id="4cd2">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="c98c0" class="javax.swing.JTable" binding="distribuidorTable" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<component id="ced19" class="javax.swing.JTextField" binding="searchField" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="d89c0" class="javax.swing.JButton" binding="buscarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Buscar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<grid id="6e1ed" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="23e34" class="javax.swing.JButton" binding="verButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Ver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="40732" class="javax.swing.JButton" binding="eliminarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Eliminar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="99cf5" class="javax.swing.JButton" binding="editarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Editar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="bdc48" class="javax.swing.JButton" binding="crearButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Crear"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.ListSelectionModel;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.models.Distribuidor;
|
||||||
|
|
||||||
|
public class DistribuidorSearchPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTable distribuidorTable;
|
||||||
|
private JTextField searchField;
|
||||||
|
private JButton buscarButton;
|
||||||
|
private JButton verButton;
|
||||||
|
private JButton eliminarButton;
|
||||||
|
private JButton editarButton;
|
||||||
|
private JButton crearButton;
|
||||||
|
private BaseTableModel<Distribuidor> distribuidorModel;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTable getDistribuidorTable() {
|
||||||
|
return distribuidorTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getSearchField() {
|
||||||
|
return searchField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getBuscarButton() {
|
||||||
|
return buscarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVerButton() {
|
||||||
|
return verButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEliminarButton() {
|
||||||
|
return eliminarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEditarButton() {
|
||||||
|
return editarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getCrearButton() {
|
||||||
|
return crearButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseTableModel<Distribuidor> getDistribuidorModel() {
|
||||||
|
return distribuidorModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.createDistribuidorTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createDistribuidorTable() {
|
||||||
|
// @formatter:off
|
||||||
|
this.distribuidorModel= new BaseTableModel<>(
|
||||||
|
new String[]{"Rut", "Empresa"},
|
||||||
|
(row, rowIndex, colIndex) -> {
|
||||||
|
switch (colIndex) {
|
||||||
|
case 0: return row.get(rowIndex).getRut();
|
||||||
|
case 1: return row.get(rowIndex).getEmpresa().getNombre();
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// @formatter:on
|
||||||
|
this.distribuidorTable = new JTable(this.distribuidorModel);
|
||||||
|
this.distribuidorTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
createUIComponents();
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(3, 2, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JScrollPane scrollPane1 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane1, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane1.setViewportView(distribuidorTable);
|
||||||
|
searchField = new JTextField();
|
||||||
|
contentPane.add(searchField,
|
||||||
|
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
buscarButton = new JButton();
|
||||||
|
buscarButton.setText("Buscar");
|
||||||
|
contentPane.add(buscarButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
verButton = new JButton();
|
||||||
|
verButton.setText("Ver");
|
||||||
|
panel1.add(verButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
eliminarButton = new JButton();
|
||||||
|
eliminarButton.setText("Eliminar");
|
||||||
|
panel1.add(eliminarButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
editarButton = new JButton();
|
||||||
|
editarButton.setText("Editar");
|
||||||
|
panel1.add(editarButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
crearButton = new JButton();
|
||||||
|
crearButton.setText("Crear");
|
||||||
|
panel1.add(crearButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorUpdatePanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="532" height="218"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<vspacer id="29de9">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="4e68">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="1cc6d">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<grid id="30754" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="125a5" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="482e0" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Actualizar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<component id="c684" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Rut:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="a68a1" class="javax.swing.JTextField" binding="rutField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="5bd66" class="javax.swing.JComboBox" binding="empresaCombobox" custom-create="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="70362" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Empresa:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
|
||||||
|
public class DistribuidorUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JButton actualizarButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField rutField;
|
||||||
|
private JComboBox<Empresa> empresaCombobox;
|
||||||
|
private DefaultComboBoxModel<Empresa> empresaModel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getActualizarButton() {
|
||||||
|
return actualizarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRutField() {
|
||||||
|
return rutField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JComboBox<Empresa> getEmpresaCombobox() {
|
||||||
|
return empresaCombobox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultComboBoxModel<Empresa> getEmpresaModel() {
|
||||||
|
return empresaModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
createUIComponents();
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(6, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(5, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
panel1.add(volverButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
actualizarButton = new JButton();
|
||||||
|
actualizarButton.setText("Actualizar");
|
||||||
|
panel1.add(actualizarButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Rut:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
rutField = new JTextField();
|
||||||
|
contentPane.add(rutField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
contentPane.add(empresaCombobox,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("Empresa:");
|
||||||
|
contentPane.add(label2, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.empresaModel = new DefaultComboBoxModel<>();
|
||||||
|
this.empresaCombobox = new JComboBox<>(empresaModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.distribuidor.DistribuidorViewPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="468"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="7a2da" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Empresa:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="7e150" class="javax.swing.JTextField" binding="empresaField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
<enabled value="true"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<vspacer id="31a4">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="28129">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="69f08">
|
||||||
|
<constraints>
|
||||||
|
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<component id="7d83d" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="8e275" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Rut:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="b9ea8" class="javax.swing.JTextField" binding="rutField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<grid id="21544" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="8a01b" class="javax.swing.JButton" binding="direccionesButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Direcciones"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="5f09d" class="javax.swing.JButton" binding="correosButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Correos"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="e9b39" class="javax.swing.JButton" binding="telefonosButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Telefonos"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.distribuidor;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class DistribuidorViewPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JTextField empresaField;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField rutField;
|
||||||
|
private JButton direccionesButton;
|
||||||
|
private JButton correosButton;
|
||||||
|
private JButton telefonosButton;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getEmpresaField() {
|
||||||
|
return empresaField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRutField() {
|
||||||
|
return rutField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getDireccionesButton() {
|
||||||
|
return direccionesButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getCorreosButton() {
|
||||||
|
return correosButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getTelefonosButton() {
|
||||||
|
return telefonosButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(7, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Empresa:");
|
||||||
|
contentPane.add(label1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
empresaField = new JTextField();
|
||||||
|
empresaField.setEditable(false);
|
||||||
|
empresaField.setEnabled(true);
|
||||||
|
contentPane.add(empresaField,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(6, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
contentPane.add(volverButton, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
final JLabel label2 = new JLabel();
|
||||||
|
label2.setText("Rut:");
|
||||||
|
contentPane.add(label2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
rutField = new JTextField();
|
||||||
|
rutField.setEditable(false);
|
||||||
|
contentPane.add(rutField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
direccionesButton = new JButton();
|
||||||
|
direccionesButton.setText("Direcciones");
|
||||||
|
panel1.add(direccionesButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
correosButton = new JButton();
|
||||||
|
correosButton.setText("Correos");
|
||||||
|
panel1.add(correosButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
telefonosButton = new JButton();
|
||||||
|
telefonosButton.setText("Telefonos");
|
||||||
|
panel1.add(telefonosButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.empresa.EmpresaCreatePanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="45fe9" class="javax.swing.JTextField" binding="nombreField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<vspacer id="ff24d">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<component id="1cefe" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<hspacer id="ae074">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="8a871">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<grid id="f9380" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="360a" class="javax.swing.JButton" binding="guardarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Guardar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="c59e6" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.empresa;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class EmpresaCreatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JButton guardarButton;
|
||||||
|
private JButton volverButton;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getGuardarButton() {
|
||||||
|
return guardarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(4, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nombre:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
guardarButton = new JButton();
|
||||||
|
guardarButton.setText("Guardar");
|
||||||
|
panel1.add(guardarButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
panel1.add(volverButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.empresa.EmpresaSearchPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<scrollpane id="5e7a3">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="285b9" class="javax.swing.JTable" binding="empresaTable" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<grid id="4c5af" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="321a9" class="javax.swing.JButton" binding="buscarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Buscar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="e3030" class="javax.swing.JTextField" binding="buscarField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<grid id="42238" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="1abb7" class="javax.swing.JButton" binding="verButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Ver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="4dbb2" class="javax.swing.JButton" binding="editarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Editar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="279e1" class="javax.swing.JButton" binding="eliminarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Eliminar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="8d838" class="javax.swing.JButton" binding="crearButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Crear"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.empresa;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.models.Empresa;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class EmpresaSearchPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTable empresaTable;
|
||||||
|
private JButton buscarButton;
|
||||||
|
private JTextField buscarField;
|
||||||
|
private JButton verButton;
|
||||||
|
private JButton editarButton;
|
||||||
|
private JButton eliminarButton;
|
||||||
|
private JButton crearButton;
|
||||||
|
private BaseTableModel<Empresa> empresaModel;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTable getEmpresaTable() {
|
||||||
|
return empresaTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseTableModel<Empresa> getEmpresaModel() {
|
||||||
|
return empresaModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getBuscarButton() {
|
||||||
|
return buscarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getBuscarField() {
|
||||||
|
return buscarField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVerButton() {
|
||||||
|
return verButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEditarButton() {
|
||||||
|
return editarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getEliminarButton() {
|
||||||
|
return eliminarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getCrearButton() {
|
||||||
|
return crearButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.createEmpresaTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createEmpresaTable() {
|
||||||
|
// @formatter:off
|
||||||
|
this.empresaModel = new BaseTableModel<>(
|
||||||
|
new String[]{"Nombre", "Nº Distribuidores"},
|
||||||
|
(row, rowIndex, colIndex) -> {
|
||||||
|
switch(colIndex) {
|
||||||
|
case 0: return row.get(rowIndex).getNombre();
|
||||||
|
case 1: return row.get(rowIndex).getDistribuidores().size();
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.empresaTable = new JTable(this.empresaModel);
|
||||||
|
// @formatter:on
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
createUIComponents();
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(3, 1, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final JScrollPane scrollPane1 = new JScrollPane();
|
||||||
|
contentPane.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
scrollPane1.setViewportView(empresaTable);
|
||||||
|
final JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
buscarButton = new JButton();
|
||||||
|
buscarButton.setText("Buscar");
|
||||||
|
panel1.add(buscarButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
buscarField = new JTextField();
|
||||||
|
panel1.add(buscarField,
|
||||||
|
new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
|
||||||
|
final JPanel panel2 = new JPanel();
|
||||||
|
panel2.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
|
||||||
|
verButton = new JButton();
|
||||||
|
verButton.setText("Ver");
|
||||||
|
panel2.add(verButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
editarButton = new JButton();
|
||||||
|
editarButton.setText("Editar");
|
||||||
|
panel2.add(editarButton, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
eliminarButton = new JButton();
|
||||||
|
eliminarButton.setText("Eliminar");
|
||||||
|
panel2.add(eliminarButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
crearButton = new JButton();
|
||||||
|
crearButton.setText("Crear");
|
||||||
|
panel2.add(crearButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.empresa.EmpresaUpdatePanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="484" height="154"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<component id="faf3" class="javax.swing.JTextField" binding="nombreField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
<component id="e88f4" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<vspacer id="d3329">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="76a13">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="1d353">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<component id="84fc7" class="javax.swing.JButton" binding="actualizarButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Actualizar"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.empresa;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class EmpresaUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JButton actualizarButton;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getActualizarButton() {
|
||||||
|
return actualizarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(4, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nombre:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
actualizarButton = new JButton();
|
||||||
|
actualizarButton.setText("Actualizar");
|
||||||
|
contentPane.add(actualizarButton, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.empresa.EmpresaViewPanel">
|
||||||
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="484" height="154"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<vspacer id="f48a">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<hspacer id="cd1c3">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<hspacer id="66a37">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</hspacer>
|
||||||
|
<component id="b8e06" class="javax.swing.JLabel">
|
||||||
|
<constraints>
|
||||||
|
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Nombre:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="1e63f" class="javax.swing.JTextField" binding="nombreField">
|
||||||
|
<constraints>
|
||||||
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="400" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<editable value="false"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="f1834" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
|
<preferred-size width="150" height="-1"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package xyz.danielcortes.views.mantenedores.empresa;
|
||||||
|
|
||||||
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import com.intellij.uiDesigner.core.Spacer;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
|
||||||
|
public class EmpresaViewPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTextField nombreField;
|
||||||
|
private JButton volverButton;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getNombreField() {
|
||||||
|
return nombreField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// GUI initializer generated by IntelliJ IDEA GUI Designer
|
||||||
|
// >>> IMPORTANT!! <<<
|
||||||
|
// DO NOT EDIT OR ADD ANY CODE HERE!
|
||||||
|
$$$setupUI$$$();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
|
||||||
|
*
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
private void $$$setupUI$$$() {
|
||||||
|
contentPane = new JPanel();
|
||||||
|
contentPane.setLayout(new GridLayoutManager(4, 3, new Insets(20, 20, 20, 20), -1, -1));
|
||||||
|
final Spacer spacer1 = new Spacer();
|
||||||
|
contentPane.add(spacer1,
|
||||||
|
new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer2 = new Spacer();
|
||||||
|
contentPane.add(spacer2,
|
||||||
|
new GridConstraints(3, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final Spacer spacer3 = new Spacer();
|
||||||
|
contentPane.add(spacer3,
|
||||||
|
new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null,
|
||||||
|
null, null, 0, false));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Nombre:");
|
||||||
|
contentPane.add(label1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
||||||
|
nombreField = new JTextField();
|
||||||
|
nombreField.setEditable(false);
|
||||||
|
contentPane.add(nombreField,
|
||||||
|
new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||||
|
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(400, -1), null, 0, false));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
contentPane.add(volverButton, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
|
||||||
|
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1),
|
||||||
|
null, 0, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoCreatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.telefono.TelefonoCreatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.telefono;
|
package xyz.danielcortes.views.mantenedores.telefono;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoSearchPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.telefono.TelefonoSearchPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.telefono;
|
package xyz.danielcortes.views.mantenedores.telefono;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoUpdatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.telefono.TelefonoUpdatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.telefono;
|
package xyz.danielcortes.views.mantenedores.telefono;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.telefono.TelefonoViewPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.telefono.TelefonoViewPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.telefono;
|
package xyz.danielcortes.views.mantenedores.telefono;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioCreatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.usuario.UsuarioCreatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.usuario;
|
package xyz.danielcortes.views.mantenedores.usuario;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioUpdatePanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.usuario.UsuarioUpdatePanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.usuario;
|
package xyz.danielcortes.views.mantenedores.usuario;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.trabajador.usuario.UsuarioViewPanel">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.mantenedores.usuario.UsuarioViewPanel">
|
||||||
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="20" left="20" bottom="20" right="20"/>
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package xyz.danielcortes.views.mantenedores.trabajador.usuario;
|
package xyz.danielcortes.views.mantenedores.usuario;
|
||||||
|
|
||||||
import com.intellij.uiDesigner.core.GridConstraints;
|
import com.intellij.uiDesigner.core.GridConstraints;
|
||||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
Reference in New Issue
Block a user