Creado registro de correo para un trabajador

This commit is contained in:
Daniel Cortés
2019-06-05 13:05:23 -04:00
parent a5a30b3a3d
commit b97d43f5e4
22 changed files with 1354 additions and 97 deletions

View File

@@ -15,6 +15,10 @@ import xyz.danielcortes.controllers.categoria.CategoriaCreateController;
import xyz.danielcortes.controllers.categoria.CategoriaSearchController;
import xyz.danielcortes.controllers.categoria.CategoriaUpdateController;
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.EditorialSearchController;
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.CategoriaUpdatePanel;
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.EditorialSearchPanel;
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_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()) {
BaseController controller = this.controllers.get(name);
this.frame.addCard(controller.getView().getContentPane(), name);

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -2,6 +2,7 @@ package xyz.danielcortes.controllers.trabajador;
import javax.swing.JOptionPane;
import xyz.danielcortes.controllers.LaunchController;
import xyz.danielcortes.controllers.correo.CorreoSearchController;
import xyz.danielcortes.controllers.usuario.UsuarioCreateController;
import xyz.danielcortes.controllers.usuario.UsuarioViewController;
import xyz.danielcortes.framework.BaseController;
@@ -31,9 +32,16 @@ public class TrabajadorViewController extends BaseController {
private void setupListeners() {
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());
}
private void gotoCorreosView() {
CorreoSearchController controller = (CorreoSearchController) this.getParentController().getCard(PanelName.CORREO_SEARCH);
controller.setTrabajador(trabajador);
this.getParentController().showCard(PanelName.CORREO_SEARCH);
}
private void gotoUsuarioView() {
if(this.trabajador.getUsuario() == null) {
int result = JOptionPane.showConfirmDialog(

View File

@@ -37,5 +37,10 @@ public enum PanelName {
USUARIO_CREATE,
USUARIO_UPDATE,
CORREO_VIEW,
CORREO_SEARCH,
CORREO_CREATE,
CORREO_UPDATE,
COMPRAR_LIBRO,
}

View 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);
}
}

View File

@@ -1,18 +1,24 @@
package xyz.danielcortes.models;
import java.time.LocalDate;
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.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name = "trabajador")
public class Trabajador {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@@ -35,6 +41,14 @@ public class Trabajador {
@OneToOne(mappedBy = "trabajador")
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() {
return id;
}
@@ -91,6 +105,16 @@ public class Trabajador {
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
public boolean equals(Object o) {
if (this == o)
@@ -103,11 +127,14 @@ public class Trabajador {
Objects.equals(nombre, that.nombre) &&
Objects.equals(apellidoPaterno, that.apellidoPaterno) &&
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
public int hashCode() {
return Objects.hash(id, rut, nombre, apellidoPaterno, apellidoMaterno, fechaContrato);
return Objects.hash(id, rut, nombre, apellidoPaterno, apellidoMaterno, fechaContrato, usuario, correos);
}
}

View File

@@ -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();
}
}

View File

@@ -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;
}
}

View File

@@ -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>

View File

@@ -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;
}
}

View File

@@ -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>

View File

@@ -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;
}
}

View File

@@ -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>

View File

@@ -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;
}
}

View File

@@ -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>

View File

@@ -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;
}
}