Creado registro de correo para un trabajador
This commit is contained in:
4
.idea/dataSources.xml
generated
4
.idea/dataSources.xml
generated
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
<data-source source="LOCAL" name="manual" uuid="98426945-c0ab-4cf0-98ad-b51c8ffcd61d">
|
<data-source source="LOCAL" name="biblioteca" uuid="98426945-c0ab-4cf0-98ad-b51c8ffcd61d">
|
||||||
<driver-ref>mysql</driver-ref>
|
<driver-ref>mysql</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
|
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
|
||||||
<jdbc-url>jdbc:mysql://localhost:3306/biblioteca_manual</jdbc-url>
|
<jdbc-url>jdbc:mysql://localhost:3306/biblioteca</jdbc-url>
|
||||||
<driver-properties>
|
<driver-properties>
|
||||||
<property name="autoReconnect" value="true" />
|
<property name="autoReconnect" value="true" />
|
||||||
<property name="zeroDateTimeBehavior" value="convertToNull" />
|
<property name="zeroDateTimeBehavior" value="convertToNull" />
|
||||||
|
|||||||
84
dump.sql
84
dump.sql
@@ -1,84 +0,0 @@
|
|||||||
-- MySQL dump 10.17 Distrib 10.3.15-MariaDB, for Linux (x86_64)
|
|
||||||
--
|
|
||||||
-- Host: localhost Database: biblioteca
|
|
||||||
-- ------------------------------------------------------
|
|
||||||
-- Server version 10.3.15-MariaDB
|
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
||||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
||||||
/*!40101 SET NAMES utf8mb4 */;
|
|
||||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
||||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
||||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
||||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
||||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
||||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `usuario`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `usuario`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `usuario` (
|
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
||||||
`nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`trabajador_id` int(10) unsigned NOT NULL,
|
|
||||||
`inserted_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
KEY `trabajador_id` (`trabajador_id`),
|
|
||||||
CONSTRAINT `usuario_ibfk_1` FOREIGN KEY (`trabajador_id`) REFERENCES `trabajador` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping data for table `usuario`
|
|
||||||
--
|
|
||||||
|
|
||||||
LOCK TABLES `usuario` WRITE;
|
|
||||||
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
|
|
||||||
/*!40000 ALTER TABLE `usuario` ENABLE KEYS */;
|
|
||||||
UNLOCK TABLES;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `trabajador`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `trabajador`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `trabajador` (
|
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
||||||
`rut` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`nombre` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`apellido_paterno` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`apellido_materno` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`fecha_contrato` date NOT NULL,
|
|
||||||
`inserted_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping data for table `trabajador`
|
|
||||||
--
|
|
||||||
|
|
||||||
LOCK TABLES `trabajador` WRITE;
|
|
||||||
/*!40000 ALTER TABLE `trabajador` DISABLE KEYS */;
|
|
||||||
INSERT INTO `trabajador` VALUES (1,'197638990','Daniel','Cortes','Pincheira','2019-06-04','2019-06-04 22:12:55');
|
|
||||||
/*!40000 ALTER TABLE `trabajador` ENABLE KEYS */;
|
|
||||||
UNLOCK TABLES;
|
|
||||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
||||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
||||||
|
|
||||||
-- Dump completed on 2019-06-04 20:10:06
|
|
||||||
18
script.sql
18
script.sql
@@ -199,7 +199,7 @@ create table distribuidor_direccion
|
|||||||
distribuidor_id int unsigned,
|
distribuidor_id int unsigned,
|
||||||
direccion_id int unsigned,
|
direccion_id int unsigned,
|
||||||
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
|
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
|
||||||
foreign key (direccion_id) references direccion (id) on delete restrict on update cascade
|
foreign key (direccion_id) references direccion (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table distribuidor_telefono
|
create table distribuidor_telefono
|
||||||
@@ -207,7 +207,7 @@ create table distribuidor_telefono
|
|||||||
distribuidor_id int unsigned,
|
distribuidor_id int unsigned,
|
||||||
telefono_id int unsigned,
|
telefono_id int unsigned,
|
||||||
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
|
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
|
||||||
foreign key (telefono_id) references telefono (id) on delete restrict on update cascade
|
foreign key (telefono_id) references telefono (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table distribuidor_correo
|
create table distribuidor_correo
|
||||||
@@ -215,7 +215,7 @@ create table distribuidor_correo
|
|||||||
distribuidor_id int unsigned,
|
distribuidor_id int unsigned,
|
||||||
correo_id int unsigned,
|
correo_id int unsigned,
|
||||||
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
|
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
|
||||||
foreign key (correo_id) references correo (id) on delete restrict on update cascade
|
foreign key (correo_id) references correo (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table cliente_direccion
|
create table cliente_direccion
|
||||||
@@ -223,7 +223,7 @@ create table cliente_direccion
|
|||||||
cliente_id int unsigned,
|
cliente_id int unsigned,
|
||||||
direccion_id int unsigned,
|
direccion_id int unsigned,
|
||||||
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
|
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
|
||||||
foreign key (direccion_id) references direccion (id) on delete restrict on update cascade
|
foreign key (direccion_id) references direccion (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table cliente_telefono
|
create table cliente_telefono
|
||||||
@@ -231,7 +231,7 @@ create table cliente_telefono
|
|||||||
cliente_id int unsigned,
|
cliente_id int unsigned,
|
||||||
telefono_id int unsigned,
|
telefono_id int unsigned,
|
||||||
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
|
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
|
||||||
foreign key (telefono_id) references telefono (id) on delete restrict on update cascade
|
foreign key (telefono_id) references telefono (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table cliente_correo
|
create table cliente_correo
|
||||||
@@ -239,7 +239,7 @@ create table cliente_correo
|
|||||||
cliente_id int unsigned,
|
cliente_id int unsigned,
|
||||||
correo_id int unsigned,
|
correo_id int unsigned,
|
||||||
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
|
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade,
|
||||||
foreign key (correo_id) references correo (id) on delete restrict on update cascade
|
foreign key (correo_id) references correo (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table trabajador_direccion
|
create table trabajador_direccion
|
||||||
@@ -247,7 +247,7 @@ create table trabajador_direccion
|
|||||||
trabajador_id int unsigned,
|
trabajador_id int unsigned,
|
||||||
direccion_id int unsigned,
|
direccion_id int unsigned,
|
||||||
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
|
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
|
||||||
foreign key (direccion_id) references direccion (id) on delete restrict on update cascade
|
foreign key (direccion_id) references direccion (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table trabajador_telefono
|
create table trabajador_telefono
|
||||||
@@ -255,7 +255,7 @@ create table trabajador_telefono
|
|||||||
trabajador_id int unsigned,
|
trabajador_id int unsigned,
|
||||||
telefono_id int unsigned,
|
telefono_id int unsigned,
|
||||||
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
|
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
|
||||||
foreign key (telefono_id) references telefono (id) on delete restrict on update cascade
|
foreign key (telefono_id) references telefono (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
create table trabajador_correo
|
create table trabajador_correo
|
||||||
@@ -263,7 +263,7 @@ create table trabajador_correo
|
|||||||
trabajador_id int unsigned,
|
trabajador_id int unsigned,
|
||||||
correo_id int unsigned,
|
correo_id int unsigned,
|
||||||
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
|
foreign key (trabajador_id) references trabajador (id) on delete restrict on update cascade,
|
||||||
foreign key (correo_id) references correo (id) on delete restrict on update cascade
|
foreign key (correo_id) references correo (id) on delete cascade on update cascade
|
||||||
);
|
);
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------#
|
#--------------------------------------------------------------------------------#
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ import xyz.danielcortes.controllers.categoria.CategoriaCreateController;
|
|||||||
import xyz.danielcortes.controllers.categoria.CategoriaSearchController;
|
import xyz.danielcortes.controllers.categoria.CategoriaSearchController;
|
||||||
import xyz.danielcortes.controllers.categoria.CategoriaUpdateController;
|
import xyz.danielcortes.controllers.categoria.CategoriaUpdateController;
|
||||||
import xyz.danielcortes.controllers.categoria.CategoriaViewController;
|
import xyz.danielcortes.controllers.categoria.CategoriaViewController;
|
||||||
|
import xyz.danielcortes.controllers.correo.CorreoCreateController;
|
||||||
|
import xyz.danielcortes.controllers.correo.CorreoSearchController;
|
||||||
|
import xyz.danielcortes.controllers.correo.CorreoUpdateController;
|
||||||
|
import xyz.danielcortes.controllers.correo.CorreoViewController;
|
||||||
import xyz.danielcortes.controllers.editorial.EditorialCreateController;
|
import xyz.danielcortes.controllers.editorial.EditorialCreateController;
|
||||||
import xyz.danielcortes.controllers.editorial.EditorialSearchController;
|
import xyz.danielcortes.controllers.editorial.EditorialSearchController;
|
||||||
import xyz.danielcortes.controllers.editorial.EditorialUpdateController;
|
import xyz.danielcortes.controllers.editorial.EditorialUpdateController;
|
||||||
@@ -46,6 +50,10 @@ import xyz.danielcortes.views.categoria.CategoriaCreatePanel;
|
|||||||
import xyz.danielcortes.views.categoria.CategoriaSearchPanel;
|
import xyz.danielcortes.views.categoria.CategoriaSearchPanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaUpdatePanel;
|
import xyz.danielcortes.views.categoria.CategoriaUpdatePanel;
|
||||||
import xyz.danielcortes.views.categoria.CategoriaViewPanel;
|
import xyz.danielcortes.views.categoria.CategoriaViewPanel;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoCreatePanel;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoSearchPanel;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoUpdatePanel;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoViewPanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialCreatePanel;
|
import xyz.danielcortes.views.editorial.EditorialCreatePanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialSearchPanel;
|
import xyz.danielcortes.views.editorial.EditorialSearchPanel;
|
||||||
import xyz.danielcortes.views.editorial.EditorialUpdatePanel;
|
import xyz.danielcortes.views.editorial.EditorialUpdatePanel;
|
||||||
@@ -120,6 +128,11 @@ public class LaunchController {
|
|||||||
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));
|
||||||
|
|
||||||
|
this.controllers.put(PanelName.CORREO_SEARCH, new CorreoSearchController(new CorreoSearchPanel(), this));
|
||||||
|
this.controllers.put(PanelName.CORREO_VIEW, new CorreoViewController(new CorreoViewPanel(), this));
|
||||||
|
this.controllers.put(PanelName.CORREO_CREATE, new CorreoCreateController(new CorreoCreatePanel(), this));
|
||||||
|
this.controllers.put(PanelName.CORREO_UPDATE, new CorreoUpdateController(new CorreoUpdatePanel(), this));
|
||||||
|
|
||||||
for (PanelName name : this.controllers.keySet()) {
|
for (PanelName name : this.controllers.keySet()) {
|
||||||
BaseController controller = this.controllers.get(name);
|
BaseController controller = this.controllers.get(name);
|
||||||
this.frame.addCard(controller.getView().getContentPane(), name);
|
this.frame.addCard(controller.getView().getContentPane(), name);
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package xyz.danielcortes.controllers.correo;
|
||||||
|
|
||||||
|
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.Correo;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
|
import xyz.danielcortes.validator.CorreoValidator;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoCreatePanel;
|
||||||
|
|
||||||
|
public class CorreoCreateController extends BaseController {
|
||||||
|
|
||||||
|
private Trabajador trabajador;
|
||||||
|
private CorreoCreatePanel view;
|
||||||
|
private CorreoRepository repository;
|
||||||
|
private CorreoValidator validator;
|
||||||
|
|
||||||
|
public CorreoCreateController(CorreoCreatePanel view, LaunchController parentController) {
|
||||||
|
super(parentController);
|
||||||
|
this.view = view;
|
||||||
|
this.repository = new CorreoRepository();
|
||||||
|
this.validator = new CorreoValidator(this.repository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LaunchController getParentController() {
|
||||||
|
return this.parentController;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.view.getCorreoField().requestFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getGuardarButton().addActionListener(e -> save());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> volver());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void save() {
|
||||||
|
String sCorreo = this.view.getCorreoField().getText();
|
||||||
|
|
||||||
|
ValidationResult correoValidation = validator.validateCorreo(sCorreo);
|
||||||
|
if (correoValidation.hasError()) {
|
||||||
|
correoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Correo correo = new Correo();
|
||||||
|
correo.setCorreo(sCorreo);
|
||||||
|
correo.getTrabajadores().add(trabajador);
|
||||||
|
|
||||||
|
this.repository.save(correo);
|
||||||
|
this.trabajador.getCorreos().add(correo);
|
||||||
|
|
||||||
|
this.volver();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void volver() {
|
||||||
|
CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package xyz.danielcortes.controllers.correo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.controllers.trabajador.TrabajadorViewController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.BaseTableModel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Correo;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
|
import xyz.danielcortes.validator.CorreoValidator;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoSearchPanel;
|
||||||
|
|
||||||
|
public class CorreoSearchController extends BaseController {
|
||||||
|
|
||||||
|
private Trabajador trabajador;
|
||||||
|
private CorreoSearchPanel view;
|
||||||
|
private CorreoRepository correoRepository;
|
||||||
|
private CorreoValidator validator;
|
||||||
|
|
||||||
|
public CorreoSearchController(CorreoSearchPanel view, LaunchController parent) {
|
||||||
|
super(parent);
|
||||||
|
this.view = view;
|
||||||
|
this.correoRepository = new CorreoRepository();
|
||||||
|
this.validator = new CorreoValidator(this.correoRepository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
this.loadCorreosTable();
|
||||||
|
this.view.getCorreosTable().clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getCrearButton().addActionListener(e -> this.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());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> this.volver());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void create() {
|
||||||
|
CorreoCreateController controller = (CorreoCreateController) this.getParentController().getCard(PanelName.CORREO_CREATE);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_CREATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void edit() {
|
||||||
|
Correo correo = this.getSelectedCorreo();
|
||||||
|
if (correo != null) {
|
||||||
|
CorreoUpdateController controller = (CorreoUpdateController) this.getParentController().getCard(PanelName.CORREO_UPDATE);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
controller.setCorreo(correo);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_UPDATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void delete() {
|
||||||
|
Correo correo = this.getSelectedCorreo();
|
||||||
|
if (correo == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int option = JOptionPane.showConfirmDialog(
|
||||||
|
null,
|
||||||
|
"¿Estas seguro de que deseas eliminar el correo?",
|
||||||
|
"Confirmacion",
|
||||||
|
JOptionPane.YES_NO_OPTION,
|
||||||
|
JOptionPane.QUESTION_MESSAGE
|
||||||
|
);
|
||||||
|
if (option == JOptionPane.NO_OPTION)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.correoRepository.delete(correo);
|
||||||
|
this.trabajador.getCorreos().remove(correo);
|
||||||
|
this.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void view() {
|
||||||
|
Correo correo = this.getSelectedCorreo();
|
||||||
|
if (correo != null) {
|
||||||
|
CorreoViewController controller = (CorreoViewController) this.getParentController().getCard(PanelName.CORREO_VIEW);
|
||||||
|
controller.setCorreo(correo);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_VIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void search() {
|
||||||
|
String term = this.view.getSearchField().getText();
|
||||||
|
List<Correo> correo = this.correoRepository.search(term, trabajador);
|
||||||
|
this.loadCorreosTable(correo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void volver() {
|
||||||
|
TrabajadorViewController controller = (TrabajadorViewController) this.getParentController().getCard(PanelName.TRABAJADOR_VIEW);
|
||||||
|
controller.setTrabajador(this.trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.TRABAJADOR_VIEW);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadCorreosTable() {
|
||||||
|
List<Correo> correos = this.trabajador.getCorreos();
|
||||||
|
loadCorreosTable(correos);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadCorreosTable(List<Correo> correos) {
|
||||||
|
BaseTableModel<Correo> model = this.view.getCorreoModel();
|
||||||
|
model.setRows(correos);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Correo getSelectedCorreo() {
|
||||||
|
int selectedRow = this.view.getCorreosTable().getSelectedRow();
|
||||||
|
if (selectedRow == -1) {
|
||||||
|
JOptionPane.showMessageDialog(
|
||||||
|
null,
|
||||||
|
"No hay correo seleccionado",
|
||||||
|
"Error",
|
||||||
|
JOptionPane.ERROR_MESSAGE
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.view.getCorreoModel().getRow(selectedRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package xyz.danielcortes.controllers.correo;
|
||||||
|
|
||||||
|
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.Correo;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
|
import xyz.danielcortes.validator.CorreoValidator;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoUpdatePanel;
|
||||||
|
|
||||||
|
public class CorreoUpdateController extends BaseController {
|
||||||
|
|
||||||
|
private Trabajador trabajador;
|
||||||
|
private Correo correo;
|
||||||
|
private CorreoUpdatePanel view;
|
||||||
|
private CorreoRepository repository;
|
||||||
|
private CorreoValidator validator;
|
||||||
|
|
||||||
|
public CorreoUpdateController(CorreoUpdatePanel view, LaunchController parentController) {
|
||||||
|
super(parentController);
|
||||||
|
this.view = view;
|
||||||
|
this.repository = new CorreoRepository();
|
||||||
|
this.validator = new CorreoValidator(this.repository);
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LaunchController getParentController() {
|
||||||
|
return this.parentController;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.view.getCorreoField().requestFocus();
|
||||||
|
this.fillCorreo();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCorreo(Correo correo) {
|
||||||
|
this.correo = correo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillCorreo() {
|
||||||
|
this.view.getCorreoField().setText(this.correo.getCorreo());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getActualizarButton().addActionListener(e -> update());
|
||||||
|
this.view.getVolverButton().addActionListener(e -> volver());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
String correo = this.view.getCorreoField().getText();
|
||||||
|
|
||||||
|
ValidationResult originalValidation = this.validator.validateOriginal(this.correo);
|
||||||
|
if (originalValidation.hasError()) {
|
||||||
|
originalValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ValidationResult correoValidation = this.validator.validateCorreo(correo);
|
||||||
|
if(correoValidation.hasError()) {
|
||||||
|
correoValidation.showErrorDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.correo.setCorreo(correo);
|
||||||
|
this.repository.update(this.correo);
|
||||||
|
|
||||||
|
this.volver();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void volver() {
|
||||||
|
CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH);
|
||||||
|
controller.setTrabajador(this.trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_SEARCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package xyz.danielcortes.controllers.correo;
|
||||||
|
|
||||||
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.framework.BaseController;
|
||||||
|
import xyz.danielcortes.framework.BasePanel;
|
||||||
|
import xyz.danielcortes.framework.PanelName;
|
||||||
|
import xyz.danielcortes.models.Correo;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
import xyz.danielcortes.views.correo.CorreoViewPanel;
|
||||||
|
|
||||||
|
public class CorreoViewController extends BaseController {
|
||||||
|
|
||||||
|
private Trabajador trabajador;
|
||||||
|
private Correo correo;
|
||||||
|
private CorreoViewPanel view;
|
||||||
|
|
||||||
|
public CorreoViewController(CorreoViewPanel view, LaunchController parentController) {
|
||||||
|
super(parentController);
|
||||||
|
this.view = view;
|
||||||
|
this.setupListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LaunchController getParentController() {
|
||||||
|
return this.parentController;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show() {
|
||||||
|
this.fillCorreo();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasePanel getView() {
|
||||||
|
return this.view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajador(Trabajador trabajador) {
|
||||||
|
this.trabajador = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCorreo(Correo correo) {
|
||||||
|
this.correo = correo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillCorreo() {
|
||||||
|
this.view.getCorreoField().setText(this.correo.getCorreo());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupListeners() {
|
||||||
|
this.view.getVolverButton().addActionListener(e -> volver());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void volver() {
|
||||||
|
CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package xyz.danielcortes.controllers.trabajador;
|
|||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import xyz.danielcortes.controllers.LaunchController;
|
import xyz.danielcortes.controllers.LaunchController;
|
||||||
|
import xyz.danielcortes.controllers.correo.CorreoSearchController;
|
||||||
import xyz.danielcortes.controllers.usuario.UsuarioCreateController;
|
import xyz.danielcortes.controllers.usuario.UsuarioCreateController;
|
||||||
import xyz.danielcortes.controllers.usuario.UsuarioViewController;
|
import xyz.danielcortes.controllers.usuario.UsuarioViewController;
|
||||||
import xyz.danielcortes.framework.BaseController;
|
import xyz.danielcortes.framework.BaseController;
|
||||||
@@ -31,9 +32,16 @@ public class TrabajadorViewController extends BaseController {
|
|||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH));
|
this.view.getVolverButton().addActionListener(e -> this.getParentController().showCard(PanelName.TRABAJADOR_SEARCH));
|
||||||
|
this.view.getCorreosButton().addActionListener(e -> this.gotoCorreosView());
|
||||||
this.view.getUsuarioButton().addActionListener(e -> this.gotoUsuarioView());
|
this.view.getUsuarioButton().addActionListener(e -> this.gotoUsuarioView());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void gotoCorreosView() {
|
||||||
|
CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH);
|
||||||
|
controller.setTrabajador(trabajador);
|
||||||
|
this.getParentController().showCard(PanelName.CORREO_SEARCH);
|
||||||
|
}
|
||||||
|
|
||||||
private void gotoUsuarioView() {
|
private void gotoUsuarioView() {
|
||||||
if(this.trabajador.getUsuario() == null) {
|
if(this.trabajador.getUsuario() == null) {
|
||||||
int result = JOptionPane.showConfirmDialog(
|
int result = JOptionPane.showConfirmDialog(
|
||||||
|
|||||||
@@ -37,5 +37,10 @@ public enum PanelName {
|
|||||||
USUARIO_CREATE,
|
USUARIO_CREATE,
|
||||||
USUARIO_UPDATE,
|
USUARIO_UPDATE,
|
||||||
|
|
||||||
|
CORREO_VIEW,
|
||||||
|
CORREO_SEARCH,
|
||||||
|
CORREO_CREATE,
|
||||||
|
CORREO_UPDATE,
|
||||||
|
|
||||||
COMPRAR_LIBRO,
|
COMPRAR_LIBRO,
|
||||||
}
|
}
|
||||||
|
|||||||
71
src/main/java/xyz/danielcortes/models/Correo.java
Normal file
71
src/main/java/xyz/danielcortes/models/Correo.java
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package xyz.danielcortes.models;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.ManyToMany;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "correo")
|
||||||
|
public class Correo {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id", nullable = false)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "correo")
|
||||||
|
private String correo;
|
||||||
|
|
||||||
|
@ManyToMany(mappedBy = "correos")
|
||||||
|
private List<Trabajador> trabajadores;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCorreo() {
|
||||||
|
return correo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCorreo(String correo) {
|
||||||
|
this.correo = correo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Trabajador> getTrabajadores() {
|
||||||
|
if(trabajadores == null){
|
||||||
|
this.trabajadores = new ArrayList<>();
|
||||||
|
}
|
||||||
|
return trabajadores;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrabajadores(List<Trabajador> trabajador) {
|
||||||
|
this.trabajadores = trabajador;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (!(o instanceof Correo))
|
||||||
|
return false;
|
||||||
|
Correo correo1 = (Correo) o;
|
||||||
|
return Objects.equals(id, correo1.id) &&
|
||||||
|
Objects.equals(correo, correo1.correo) &&
|
||||||
|
Objects.equals(trabajadores, correo1.trabajadores);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, correo, trabajadores);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,24 @@
|
|||||||
package xyz.danielcortes.models;
|
package xyz.danielcortes.models;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.JoinTable;
|
||||||
|
import javax.persistence.ManyToMany;
|
||||||
import javax.persistence.OneToOne;
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "trabajador")
|
@Table(name = "trabajador")
|
||||||
public class Trabajador {
|
public class Trabajador {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -35,6 +41,14 @@ public class Trabajador {
|
|||||||
@OneToOne(mappedBy = "trabajador")
|
@OneToOne(mappedBy = "trabajador")
|
||||||
private Usuario usuario;
|
private Usuario usuario;
|
||||||
|
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(
|
||||||
|
name = "trabajador_correo",
|
||||||
|
joinColumns = @JoinColumn(name = "trabajador_id", referencedColumnName = "id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "correo_id", referencedColumnName = "id")
|
||||||
|
)
|
||||||
|
private List<Correo> correos;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -91,6 +105,16 @@ public class Trabajador {
|
|||||||
this.usuario = usuario;
|
this.usuario = usuario;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Correo> getCorreos() {
|
||||||
|
if(correos == null)
|
||||||
|
correos = new ArrayList<>();
|
||||||
|
return correos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCorreos(List<Correo> correos) {
|
||||||
|
this.correos = correos;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
@@ -103,11 +127,14 @@ public class Trabajador {
|
|||||||
Objects.equals(nombre, that.nombre) &&
|
Objects.equals(nombre, that.nombre) &&
|
||||||
Objects.equals(apellidoPaterno, that.apellidoPaterno) &&
|
Objects.equals(apellidoPaterno, that.apellidoPaterno) &&
|
||||||
Objects.equals(apellidoMaterno, that.apellidoMaterno) &&
|
Objects.equals(apellidoMaterno, that.apellidoMaterno) &&
|
||||||
Objects.equals(fechaContrato, that.fechaContrato);
|
Objects.equals(fechaContrato, that.fechaContrato) &&
|
||||||
|
Objects.equals(usuario, that.usuario) &&
|
||||||
|
Objects.equals(correos, that.correos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(id, rut, nombre, apellidoPaterno, apellidoMaterno, fechaContrato);
|
return Objects.hash(id, rut, nombre, apellidoPaterno, apellidoMaterno, fechaContrato, usuario, correos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package xyz.danielcortes.repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.persistence.TypedQuery;
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
|
import javax.persistence.criteria.Root;
|
||||||
|
import xyz.danielcortes.framework.BaseRepository;
|
||||||
|
import xyz.danielcortes.models.Correo;
|
||||||
|
import xyz.danielcortes.models.Trabajador;
|
||||||
|
|
||||||
|
public class CorreoRepository extends BaseRepository<Correo> {
|
||||||
|
|
||||||
|
public List<Correo> getAll() {
|
||||||
|
TypedQuery<Correo> query = em.createQuery("SELECT c FROM Correo c", Correo.class);
|
||||||
|
return query.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Correo> search(String term) {
|
||||||
|
CriteriaBuilder cb = em.getCriteriaBuilder();
|
||||||
|
CriteriaQuery<Correo> query = cb.createQuery(Correo.class);
|
||||||
|
Root<Correo> r = query.from(Correo.class);
|
||||||
|
query.where(
|
||||||
|
cb.like(cb.lower(r.get("correo")), '%' + term.toLowerCase() + "%")
|
||||||
|
);
|
||||||
|
|
||||||
|
return em.createQuery(query).getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Correo> search(String term, Trabajador trabajador) {
|
||||||
|
CriteriaBuilder cb = em.getCriteriaBuilder();
|
||||||
|
CriteriaQuery<Correo> query = cb.createQuery(Correo.class);
|
||||||
|
Root<Correo> r = query.from(Correo.class);
|
||||||
|
query.where(
|
||||||
|
cb.and(
|
||||||
|
cb.like(cb.lower(r.get("correo")), '%' + term.toLowerCase() + "%"),
|
||||||
|
cb.equal(cb.lower(r.get("trabajador_id")), trabajador.getId())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return em.createQuery(query).getResultList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package xyz.danielcortes.validator;
|
||||||
|
|
||||||
|
import xyz.danielcortes.framework.ValidationResult;
|
||||||
|
import xyz.danielcortes.models.Correo;
|
||||||
|
import xyz.danielcortes.repository.CorreoRepository;
|
||||||
|
|
||||||
|
public class CorreoValidator {
|
||||||
|
private CorreoRepository correoRepository;
|
||||||
|
|
||||||
|
public CorreoValidator(CorreoRepository correoRepository) {
|
||||||
|
this.correoRepository = correoRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateCorreo(String correo) {
|
||||||
|
if(correo == null) {
|
||||||
|
return new ValidationResult("El correo es nulo");
|
||||||
|
} else if (correo.isEmpty()) {
|
||||||
|
return new ValidationResult("El correo esta vacio");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ValidationResult validateOriginal(Correo original) {
|
||||||
|
if(original == null) {
|
||||||
|
return new ValidationResult("El correo seleccionado no existe");
|
||||||
|
}
|
||||||
|
return ValidationResult.NON_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.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">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="484" height="158"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<grid id="da18d" 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="dd27f" class="javax.swing.JButton" binding="guardarButton">
|
||||||
|
<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="5841b" 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="b661c" 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="Correo:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="d65b2" class="javax.swing.JTextField" binding="correoField">
|
||||||
|
<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="38cf5">
|
||||||
|
<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="40fa1">
|
||||||
|
<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="f3ec4">
|
||||||
|
<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>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package xyz.danielcortes.views.correo;
|
||||||
|
|
||||||
|
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 CorreoCreatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JButton guardarButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField correoField;
|
||||||
|
|
||||||
|
public JButton getGuardarButton() {
|
||||||
|
return guardarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getCorreoField() {
|
||||||
|
return correoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 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 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));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Correo:");
|
||||||
|
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));
|
||||||
|
correoField = new JTextField();
|
||||||
|
contentPane.add(correoField,
|
||||||
|
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 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.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">
|
||||||
|
<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="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="c98c0" class="javax.swing.JTable" binding="correosTable" custom-create="true">
|
||||||
|
<constraints/>
|
||||||
|
<properties/>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</scrollpane>
|
||||||
|
<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="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="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>
|
||||||
|
<component id="cd99c" class="javax.swing.JButton" binding="volverButton" default-binding="true">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" 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="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<grid id="1db23" 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="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>
|
||||||
|
<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>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
package xyz.danielcortes.views.correo;
|
||||||
|
|
||||||
|
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.Correo;
|
||||||
|
|
||||||
|
public class CorreoSearchPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JTable correosTable;
|
||||||
|
private JTextField searchField;
|
||||||
|
private JButton buscarButton;
|
||||||
|
private JButton verButton;
|
||||||
|
private JButton eliminarButton;
|
||||||
|
private JButton editarButton;
|
||||||
|
private JButton crearButton;
|
||||||
|
private JButton volverButton;
|
||||||
|
private BaseTableModel<Correo> correoModel;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTable getCorreosTable() {
|
||||||
|
return correosTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseTableModel<Correo> getCorreoModel() {
|
||||||
|
return correoModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createUIComponents() {
|
||||||
|
this.creatCorreoTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void creatCorreoTable() {
|
||||||
|
// @formatter:off
|
||||||
|
this.correoModel = new BaseTableModel<>(
|
||||||
|
new String[]{"Correo"},
|
||||||
|
(row, rowIndex, colIndex) -> {
|
||||||
|
switch (colIndex) {
|
||||||
|
case 0: return row.get(rowIndex).getCorreo();
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// @formatter:on
|
||||||
|
this.correosTable = new JTable(this.correoModel);
|
||||||
|
this.correosTable.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(4, 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(correosTable);
|
||||||
|
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, 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");
|
||||||
|
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));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
contentPane.add(volverButton, new GridConstraints(3, 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 JPanel panel2 = new JPanel();
|
||||||
|
panel2.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
|
contentPane.add(panel2, 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");
|
||||||
|
panel2.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));
|
||||||
|
searchField = new JTextField();
|
||||||
|
panel2.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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.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">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="484" height="158"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<grid id="da18d" 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="dd27f" class="javax.swing.JButton" binding="actualizarButton">
|
||||||
|
<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>
|
||||||
|
<component id="5841b" 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="b661c" 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="Correo:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="d65b2" class="javax.swing.JTextField" binding="correoField">
|
||||||
|
<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="38cf5">
|
||||||
|
<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="40fa1">
|
||||||
|
<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="f3ec4">
|
||||||
|
<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>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package xyz.danielcortes.views.correo;
|
||||||
|
|
||||||
|
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 CorreoUpdatePanel extends BasePanel {
|
||||||
|
|
||||||
|
private JButton actualizarButton;
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField correoField;
|
||||||
|
|
||||||
|
public JButton getActualizarButton() {
|
||||||
|
return actualizarButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getCorreoField() {
|
||||||
|
return correoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 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 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));
|
||||||
|
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));
|
||||||
|
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));
|
||||||
|
final JLabel label1 = new JLabel();
|
||||||
|
label1.setText("Correo:");
|
||||||
|
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));
|
||||||
|
correoField = new JTextField();
|
||||||
|
contentPane.add(correoField,
|
||||||
|
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 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="xyz.danielcortes.views.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">
|
||||||
|
<margin top="20" left="20" bottom="20" right="20"/>
|
||||||
|
<constraints>
|
||||||
|
<xy x="20" y="20" width="484" height="158"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children>
|
||||||
|
<grid id="da18d" layout-manager="GridLayoutManager" row-count="1" column-count="1" 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="5841b" class="javax.swing.JButton" binding="volverButton" 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="Volver"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
<component id="b661c" 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="Correo:"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="d65b2" class="javax.swing.JTextField" binding="correoField">
|
||||||
|
<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>
|
||||||
|
<vspacer id="38cf5">
|
||||||
|
<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="40fa1">
|
||||||
|
<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="f3ec4">
|
||||||
|
<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>
|
||||||
|
</children>
|
||||||
|
</grid>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package xyz.danielcortes.views.correo;
|
||||||
|
|
||||||
|
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 CorreoViewPanel extends BasePanel {
|
||||||
|
|
||||||
|
private JPanel contentPane;
|
||||||
|
private JButton volverButton;
|
||||||
|
private JTextField correoField;
|
||||||
|
|
||||||
|
public JPanel getContentPane() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JButton getVolverButton() {
|
||||||
|
return volverButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getCorreoField() {
|
||||||
|
return correoField;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 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 JPanel panel1 = new JPanel();
|
||||||
|
panel1.setLayout(new GridLayoutManager(1, 1, 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));
|
||||||
|
volverButton = new JButton();
|
||||||
|
volverButton.setText("Volver");
|
||||||
|
panel1.add(volverButton, 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("Correo:");
|
||||||
|
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));
|
||||||
|
correoField = new JTextField();
|
||||||
|
correoField.setEditable(false);
|
||||||
|
contentPane.add(correoField,
|
||||||
|
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 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return contentPane;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user