Ahora todos los fields de las vistas vistas se mueven de la misma manera
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
|
||||
package danielcortes.xyz.controllers;
|
||||
|
||||
import danielcortes.xyz.controllers.actions.MoveToAction;
|
||||
import danielcortes.xyz.data.DAOManager;
|
||||
import danielcortes.xyz.models.caja.Caja;
|
||||
import danielcortes.xyz.models.egreso.Egreso;
|
||||
@@ -42,7 +41,7 @@ import java.awt.event.MouseEvent;
|
||||
* Controlador el cual esta orientado a manejar la vista de EgresosView
|
||||
* Maneja su contenido y las acciones que esta realiza
|
||||
*/
|
||||
public class EgresosController {
|
||||
public class EgresosController extends BaseController{
|
||||
private EgresosView view;
|
||||
private Caja caja;
|
||||
|
||||
@@ -103,15 +102,10 @@ public class EgresosController {
|
||||
* - Cuando se selecciona una fila en la tabla se llama a updateButtonsEnabled
|
||||
*/
|
||||
private void setUpViewEvents() {
|
||||
this.view.getNroField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "nextField");
|
||||
this.view.getValorField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "nextField");
|
||||
this.view.getDescripcionField().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "nextField");
|
||||
this.view.getTipoCombo().getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke("ENTER"), "save");
|
||||
|
||||
this.view.getNroField().getActionMap().put("nextField", new MoveToAction(this.view.getDescripcionField()));
|
||||
this.view.getDescripcionField().getActionMap().put("nextField", new MoveToAction(this.view.getValorField()));
|
||||
this.view.getValorField().getActionMap().put("nextField", new MoveToAction(this.view.getTipoCombo()));
|
||||
this.view.getTipoCombo().getActionMap().put("save", new GuardarAction(this));
|
||||
moveTo(this.view.getNroField(), this.view.getDescripcionField());
|
||||
moveTo(this.view.getDescripcionField(), this.view.getValorField());
|
||||
moveTo(this.view.getValorField(), this.view.getTipoCombo());
|
||||
doAction(this.view.getTipoCombo(), "save", KeyStroke.getKeyStroke("ENTER"), e -> this.guardarActionListener());
|
||||
|
||||
this.view.getEgresosTable().getSelectionModel().addListSelectionListener(e -> updateButtonsEnabled());
|
||||
this.view.getGuardarButton().addActionListener(e -> guardarActionListener());
|
||||
|
||||
Reference in New Issue
Block a user