private void llenarListaProveedores(String busqueda) throws Exception { listaInvProveedorTO = shrimp.inventario.delegate.InventarioDelegate.getInstance() .getProveedorTO(sisUsuarioEmpresaTO.getEmpCodigo(), busqueda); if (listaInvProveedorTO.size() > 0) { invProveedorTO = listaInvProveedorTO.get(0); proveedorId = invProveedorTO.getProvCodigo(); jtfProveedor.setText(invProveedorTO.getProvNombre()); } else { shrimp.inventario.formularios.JDBuscarProveedores dialog = new shrimp.inventario.formularios.JDBuscarProveedores( mDIShrimp, new javax.swing.JFrame(), true, sisUsuarioEmpresaTO.getEmpCodigo(), busqueda, sisUsuarioEmpresaTO.getUsrCodigo(), false); dialog.setLocationRelativeTo(null); invProveedorTO = dialog.invProveedorTO; if (invProveedorTO != null) { proveedorId = invProveedorTO.getProvCodigo(); jtfProveedor.setText(invProveedorTO.getProvNombre()); } else { proveedorId = null; jtfProveedor.setText(""); } } }
private void obtenerEstructura() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); this.contabilidadBBEstructura1 = new shrimp.contabilidad.beanbinding.ContabilidadBBEstructura(); this.contabilidadBBEstructura1.setListaConEstructuraTO( shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .getListaConEstructura(sisUsuarioEmpresaTO.getEmpCodigo())); this.bindingGroup.bind(); // consigue los datos listaEstructuraTO = this.contabilidadBBEstructura1.getListaConEstructuraTO(); }
private void llenarComboPlanCuentas(String codigoCuenta) throws Exception { this.contabilidadBBCuentas1 = new shrimp.contabilidad.beanbinding.ContabilidadBBCuentas(); this.contabilidadBBCuentas1.setListaConCuentasTO( shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .getListaBuscarConCuentas(sisUsuarioEmpresaTO.getEmpCodigo(), codigoCuenta, null)); // this.contabilidadBBCuentas1.setListaConCuentasTO(ContabilidadDelegate.getInstance(). // getListaConCuentas(empCodigo)); this.bindingGroup.bind(); listaConCuentasTO = contabilidadBBCuentas1.getListaConCuentasTO(); }
private void obtenerRangoCuentas() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); this.contabilidadBBCuentas = new shrimp.contabilidad.beanbinding.ContabilidadBBCuentas(); this.contabilidadBBCuentas.setListaConCuentasTO( shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .getRangoCuentasTO( sisUsuarioEmpresaTO.getEmpCodigo(), codigoCuentaDesdeAux, codigoCuentaHastaAux, largoCuenta, sisUsuarioEmpresaTO.getUsrCodigo(), mDIShrimp.getSisInfoTO())); this.bindingGroup.bind(); // consigue los datos }
private void llenarCombo() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); produccionBBSector1 = new shrimp.produccion.beanbinding.ProduccionBBSector(); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, produccionBBSector1.getListaPrdListaSectorTO(), jcboCP); bindingGroup.addBinding(jComboBoxBinding); this.bindingGroup.bind(); this.produccionBBSector1.setPrdListaSectorTO( shrimp.produccion.delegate.ProduccionDelegate.getInstance() .getListaSectorTO(sisUsuarioEmpresaTO.getEmpCodigo(), false)); this.bindingGroup.bind(); this.jcboCP.updateUI(); jcboCP.requestFocus(); }
private void llenarComboPeriodo() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, rRHHBBFunciones.getRhComboUtilidadesPeriodoTO(), jcboPeriodo); bindingGroup.addBinding(jComboBoxBinding); this.rRHHBBFunciones.setRhComboUtilidadesPeriodoTO( shrimp.rrhh.delegate.RrhhDelegate.getInstance() .getRhComboUtilidadesPeriodoTO(sisUsuarioEmpresaTO.getEmpCodigo())); this.bindingGroup.bind(); this.jcboPeriodo.updateUI(); this.jcboPeriodo.setSelectedItem(null); jcboPeriodo.setRenderer(new shrimp.validaciones.ComboTooltipRenderer()); }
private void jbtnRestaurarActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jbtnRestaurarActionPerformed // TODO add your handling code here: try { String mensaje = shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .restaurarConContable( sisUsuarioEmpresaTO.getEmpCodigo(), perCodigo, tipCodigo, conNumero, sisUsuarioEmpresaTO.getUsrCodigo(), mDIShrimp.getSisInfoTO()); if (mensaje.charAt(0) == 'T') { shrimp.helper.JDVentanaMensajes.showMessageDialog( new java.awt.Frame(), mensaje.substring(1), javax.swing.JOptionPane.INFORMATION_MESSAGE, javax.swing.JOptionPane.DEFAULT_OPTION); limpiar(); bloquearDesbloquearControles(true); } else { shrimp.helper.JDVentanaMensajes.showMessageDialog( new java.awt.Frame(), mensaje.substring(1), javax.swing.JOptionPane.ERROR_MESSAGE, javax.swing.JOptionPane.DEFAULT_OPTION); } } catch (java.rmi.RemoteException re) { javax.swing.JOptionPane.showMessageDialog( null, "Se perdio la conexion. Contacte con el administrador..."); this.requestFocus(); } catch (javax.ejb.EJBException eje) { javax.swing.JOptionPane.showMessageDialog( null, "Se perdio la conexion. Contacte con el administrador..."); this.requestFocus(); } catch (javax.naming.NameNotFoundException nnfe) { javax.swing.JOptionPane.showMessageDialog( null, "El programa servidor no esta listo. Intente mas tarde..."); this.requestFocus(); } catch (Exception e) { shrimp.helper.Excepciones.guardarExcepcionesAC( e, getClass().getName(), mDIShrimp.getSisInfoTO()); this.requestFocus(); } } // GEN-LAST:event_jbtnRestaurarActionPerformed
/** Creates new form JIFRrhhAnticipo */ public JIFRrhhUtilidadesConsulta(shrimp.componentes.GUI.MDIShrimp mDIShrimp, String titulo) { super( titulo, true, // resizable true, // closable true, // maximizable true); // iconifiable mDIShrimp.jTabbedPane.setVisible(false); this.mDIShrimp = mDIShrimp; this.sisUsuarioEmpresaTO = mDIShrimp.getSisUsuarioEmpresaTO(); this.empresa = sisUsuarioEmpresaTO.getEmpCodigo(); this.usuario = sisUsuarioEmpresaTO.getUsrCodigo(); initComponents(); accion = "INICIO"; eventosKeyFormulario(); tabulacion(); teclasBotonesCalientes(); manejoControles(false); limpiar(); try { llenarComboSector(); llenarComboPeriodo(); sisGrupoTO = shrimp.sistema.delegate.SistemaDelegate.getInstance() .sisGrupoUsuariosTO(mDIShrimp.getSisInfoTO()); manejoBotones(); this.setVisible(true); mDIShrimp.desktopPane.add(this); eventos(); } catch (java.rmi.RemoteException re) { javax.swing.JOptionPane.showMessageDialog( null, "Se perdio la conexion. Contacte con el administrador..."); } catch (javax.ejb.EJBException eje) { javax.swing.JOptionPane.showMessageDialog( null, "Se perdio la conexion. Contacte con el administrador..."); } catch (javax.naming.NameNotFoundException nnfe) { javax.swing.JOptionPane.showMessageDialog( null, "El programa servidor no esta listo. Intente mas tarde..."); } catch (Exception e) { shrimp.helper.Excepciones.guardarExcepcionesAC( e, getClass().getName(), mDIShrimp.getSisInfoTO()); } }
private void llenarComboTipoContable() throws Exception { this.contabilidadBBTipo1.setListaConTipoTO( shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .getListaConTipo(sisUsuarioEmpresaTO.getEmpCodigo())); this.bindingGroup.bind(); this.jcboTipo.updateUI(); if (contabilidadBBTipo1.getListaConTipoTO().size() > 0) { this.jcboTipo.setSelectedIndex(0); contabilidad.TO.ConTipoTO conTipoTO = this.contabilidadBBTipo1.getListaConTipoTO().get(this.jcboTipo.getSelectedIndex()); tipCodigo = conTipoTO.getTipCodigo(); } else { tipCodigo = ""; javax.swing.JOptionPane.showMessageDialog( this, "No se pudieron cargar datos de la Base de Datos...\n\nPosibles razones:" + "\n- No existen datos en el formulario Tipo de Contable." + "\n\nCorrija el error ingresando los datos necesarios o contacte con el administrador"); this.requestFocus(); } }
private void llenarComboPeriodo() throws Exception { this.sistemaBBPeriodo1.setListaPeriodoTO( shrimp.sistema.delegate.SistemaDelegate.getInstance() .getListaSisPeriodoTO(sisUsuarioEmpresaTO.getEmpCodigo())); this.bindingGroup.bind(); this.jcboPeriodo.updateUI(); listaPeriodoTO = sistemaBBPeriodo1.getListaPeriodoTO(); if (listaPeriodoTO.size() > 0) { this.jcboPeriodo.setSelectedIndex(0); sistema.TO.SisListaPeriodoTO sisListaPeriodoTO = this.sistemaBBPeriodo1.getListaPeriodoTO().get(this.jcboPeriodo.getSelectedIndex()); perCodigo = sisListaPeriodoTO.getPerCodigo(); } else { perCodigo = ""; javax.swing.JOptionPane.showMessageDialog( this, "No se pudieron cargar datos de la Base de Datos...\n\nPosibles razones:" + "\n- No existen datos en la tabla Periodo." + "\n\nCorrija el error ingresando los datos necesarios o contacte con el administrador"); this.requestFocus(); } }
/** Creates new form JIFReporteBalanceGeneral */ public JIFReporteMayorAuxiliarMultiple( shrimp.componentes.GUI.MDIShrimp mDIShrimp, String titulo, String cuenta, String desde, String hasta) { initComponents(); this.setVisible(true); mDIShrimp.desktopPane.add(this); super.inicializar(); this.setTitle(titulo); jPanel3.setBounds(0, 0, 520, 110); jPanelDatos.add(jPanel3, jlblNombreCuentaDesde); this.cuenta = cuenta; //////////////////////////////////////////////////////// mDIShrimp.jTabbedPane.setVisible(false); this.mDIShrimp = mDIShrimp; this.sisUsuarioEmpresaTO = mDIShrimp.getSisUsuarioEmpresaTO(); guardarParametroAux(); initCombos(); tabulacion(); eventosKeyFormulario(); eventoKeyPress(); teclasBotonesCalientes(); barraEstado(false); // guardarParametroAux(); if (cuenta != null) { try { this.contabilidadBBCuentas1 = new shrimp.contabilidad.beanbinding.ContabilidadBBCuentas(); this.contabilidadBBCuentas1.setListaConCuentasTO( shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .getListaBuscarConCuentas(sisUsuarioEmpresaTO.getEmpCodigo(), cuenta, null)); listaConCuentasTO = contabilidadBBCuentas1.getListaConCuentasTO(); for (contabilidad.TO.ConCuentasTO conCuentasTO : listaConCuentasTO) { if (conCuentasTO.getCuentaCodigo().equals(cuenta)) { jlblNombreCuentaDesde.setText(conCuentasTO.getCuentaDetalle().trim()); break; } } } catch (Exception e) { shrimp.helper.Excepciones.guardarExcepcionesAC( e, getClass().getName(), mDIShrimp.getSisInfoTO()); } } jtable.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jtblMayorMouseClicked(evt); } }); try { eventoKeyPressPadre(); contabilidadBBMayorAuxiliar1 = new shrimp.contabilidad.beanbinding.ContabilidadBBMayorAuxiliar(); obtenerEstructura(); this.estGrupo1 = listaEstructuraTO.get(0).getEstGrupo1(); this.estGrupo2 = listaEstructuraTO.get(0).getEstGrupo2(); this.estGrupo3 = listaEstructuraTO.get(0).getEstGrupo3(); this.estGrupo4 = listaEstructuraTO.get(0).getEstGrupo4(); this.estGrupo5 = listaEstructuraTO.get(0).getEstGrupo5(); this.estGrupo6 = listaEstructuraTO.get(0).getEstGrupo6(); largoCuenta = listaEstructuraTO.get(0).getEstGrupo1() + listaEstructuraTO.get(0).getEstGrupo2() + listaEstructuraTO.get(0).getEstGrupo3() + listaEstructuraTO.get(0).getEstGrupo4() + listaEstructuraTO.get(0).getEstGrupo5() + listaEstructuraTO.get(0).getEstGrupo6(); obtenerRangoCuentas(); llenarCombo(); if (cuenta != null || desde != null || hasta != null) { jtfCuentaDesde.setText(cuenta); jftfFechaDesde.setValue(validaciones.Validacion.fecha(desde, "yyyy-MM-dd", "dd-MM-yyyy")); jftfFechaHasta.setValue(validaciones.Validacion.fecha(hasta, "yyyy-MM-dd", "dd-MM-yyyy")); buscar(); } sisGrupoTO = shrimp.sistema.delegate.SistemaDelegate.getInstance() .sisGrupoUsuariosTO(mDIShrimp.getSisInfoTO()); } catch (java.rmi.RemoteException re) { javax.swing.JOptionPane.showMessageDialog( null, "Se perdio la conexion. Contacte con el administrador o intentelo más tarde..."); jtable.requestFocus(); if (jtable.getRowCount() > 0) { jtable.changeSelection(0, 0, false, false); } } catch (javax.ejb.EJBException eje) { javax.swing.JOptionPane.showMessageDialog( null, "Se perdio la conexion. Contacte con el administrador o intentelo más tarde..."); jtable.requestFocus(); if (jtable.getRowCount() > 0) { jtable.changeSelection(0, 0, false, false); } } catch (javax.naming.NameNotFoundException nnfe) { javax.swing.JOptionPane.showMessageDialog( null, "El programa servidor no esta listo. Intente mas tarde..."); jtable.requestFocus(); if (jtable.getRowCount() > 0) { jtable.changeSelection(0, 0, false, false); } } catch (Exception e) { shrimp.helper.Excepciones.guardarExcepcionesAC( e, getClass().getName(), mDIShrimp.getSisInfoTO()); } jbtnActualizar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnActualizarActionPerformed(evt); } }); jbtnExportar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnExportarActionPerformed(evt); } }); jbtnImprimir.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnImprimirActionPerformed(evt); } }); if (cuenta != null) { jbtnActualizarActionPerformed(null); } else { try { robot = new Robot(); robot.keyPress(KeyEvent.VK_ESCAPE); robot.keyRelease(KeyEvent.VK_ESCAPE); } catch (Exception ex) { } } }
private void llenarjTBalanceComprobacion() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); contabilidadBBMayorAuxiliar1 = new shrimp.contabilidad.beanbinding.ContabilidadBBMayorAuxiliar(); /* * 101050101001 201070101004 */ obtenerRangoCuentas(); List<contabilidad.TO.ConMayorAuxiliarTO> conMayorAuxiliarMultipleTOs = new java.util.ArrayList(1); List<contabilidad.TO.ConMayorAuxiliarTO> conMayorAuxiliarMultipleAuxTOs = null; contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarMultipleAuxTO = null; for (ConCuentasTO conCuentasTO : contabilidadBBCuentas.getListaConCuentasTO()) { contabilidadBBMayorAuxiliar1.setListaConMayorAuxiliarTO( shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance() .getListaMayorAuxiliarTO( sisUsuarioEmpresaTO.getEmpCodigo(), conCuentasTO.getCuentaCodigo(), fechaDesde, fechaHasta, codigoSector)); conMayorAuxiliarMultipleAuxTOs = contabilidadBBMayorAuxiliar1.getListaConMayorAuxiliarTO(); int posicion = 0; for (contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarMultipleTO : conMayorAuxiliarMultipleAuxTOs) { if (posicion == 0) { conMayorAuxiliarMultipleTO.setMaContable( conCuentasTO.getCuentaCodigo() + " | " + conCuentasTO.getCuentaDetalle()); conMayorAuxiliarMultipleTO.setMaCuenta(""); } else { conMayorAuxiliarMultipleTO.setMaCuenta(conCuentasTO.getCuentaCodigo()); conMayorAuxiliarMultipleTO.setMaCuentaDetalle(conCuentasTO.getCuentaDetalle()); } conMayorAuxiliarMultipleTOs.add(conMayorAuxiliarMultipleTO); posicion++; } conMayorAuxiliarMultipleAuxTO = new contabilidad.TO.ConMayorAuxiliarTO(); conMayorAuxiliarMultipleTOs.add(conMayorAuxiliarMultipleAuxTO); } this.contabilidadBBMayorAuxiliar1.setListaConMayorAuxiliarTO(conMayorAuxiliarMultipleTOs); this.bindingGroup.bind(); this.jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE, this.contabilidadBBMayorAuxiliar1.getListaConMayorAuxiliarTO(), jtable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding0 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maContable}")); columnBinding0.setColumnName("Contable"); columnBinding0.setColumnClass(String.class); columnBinding0.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maCuenta}")); columnBinding1.setColumnName("Cuenta"); columnBinding1.setColumnClass(String.class); columnBinding1.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maCuentaDetalle}")); columnBinding2.setColumnName("Cuenta Detalle"); columnBinding2.setColumnClass(String.class); columnBinding2.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maFecha}")); columnBinding3.setColumnName("Fecha"); columnBinding3.setColumnClass(String.class); columnBinding3.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maDocumento}")); columnBinding4.setColumnName("Documento"); columnBinding4.setColumnClass(String.class); columnBinding4.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maDebe}")); columnBinding5.setColumnName("Debe"); columnBinding5.setColumnClass(java.math.BigDecimal.class); columnBinding5.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maHaber}")); columnBinding6.setColumnName("Haber"); columnBinding6.setColumnClass(java.math.BigDecimal.class); columnBinding6.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maSaldo}")); columnBinding7.setColumnName("Saldo"); columnBinding7.setColumnClass(java.math.BigDecimal.class); columnBinding7.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${maObservaciones}")); columnBinding8.setColumnName("Observaciones"); columnBinding8.setColumnClass(String.class); columnBinding8.setEditable(false); /// java.math.BigDecimal this.bindingGroup.addBinding(this.jTableBinding); this.bindingGroup.bind(); jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); // Metemos el modelo ordenable en la tabla. javax.swing.table.TableRowSorter modeloOrdenado = new javax.swing.table.TableRowSorter(jtable.getModel()); jtable.setRowSorter(modeloOrdenado); ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS javax.swing.table.TableColumn col = null; col = jtable.getColumnModel().getColumn(0); col.setPreferredWidth(200); col = jtable.getColumnModel().getColumn(1); col.setPreferredWidth(100); col = jtable.getColumnModel().getColumn(2); col.setPreferredWidth(100); col = jtable.getColumnModel().getColumn(3); col.setPreferredWidth(80); col = jtable.getColumnModel().getColumn(4); col.setPreferredWidth(80); col = jtable.getColumnModel().getColumn(5); col.setPreferredWidth(80); col = jtable.getColumnModel().getColumn(6); col.setPreferredWidth(400); }
private void llenarjTable() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); bindingGroup.bind(); this.carBBPagosCobrosConsulta.setCarFunPagosDetalleTOs( shrimp.cartera.delegate.CarDelegate.getInstance() .getCarFunPagosDetalleTO( sisUsuarioEmpresaTO.getEmpCodigo(), codigoSector, fechaDesde, fechaHasta, proveedorId, null)); this.bindingGroup.bind(); // consigue los datos this.jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE, this.carBBPagosCobrosConsulta.getCarFunPagosDetalleTOs(), jtable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagNumeroSistema}")); columnBinding.setColumnName("Número"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagFecha}")); // ${nombreAtributo} columnBinding1.setColumnName("Fecha"); columnBinding1.setColumnClass(String.class); columnBinding1.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagProveedor}")); columnBinding2.setColumnName("Proveedor"); columnBinding2.setColumnClass(String.class); columnBinding2.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagValor}")); columnBinding3.setColumnName("Valor"); columnBinding3.setColumnClass(java.math.BigDecimal.class); columnBinding3.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagObservaciones}")); columnBinding4.setColumnName("Observaciones"); columnBinding4.setColumnClass(String.class); columnBinding4.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagPendiente}")); columnBinding5.setColumnName("Pendiente"); columnBinding5.setColumnClass(Boolean.class); columnBinding5.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${pagAnulado}")); columnBinding6.setColumnName("Anulado"); columnBinding6.setColumnClass(Boolean.class); columnBinding6.setEditable(false); this.bindingGroup.addBinding(this.jTableBinding); this.bindingGroup.bind(); jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); // Metemos el modelo ordenable en la tabla. javax.swing.table.TableRowSorter modeloOrdenado = new javax.swing.table.TableRowSorter(jtable.getModel()); jtable.setRowSorter(modeloOrdenado); ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS javax.swing.table.TableColumn col = null; col = jtable.getColumnModel().getColumn(0); col.setPreferredWidth(200); col = jtable.getColumnModel().getColumn(1); col.setPreferredWidth(100); col = jtable.getColumnModel().getColumn(2); col.setPreferredWidth(200); col = jtable.getColumnModel().getColumn(3); col.setPreferredWidth(100); col = jtable.getColumnModel().getColumn(4); col.setPreferredWidth(200); col = jtable.getColumnModel().getColumn(5); col.setPreferredWidth(80); col = jtable.getColumnModel().getColumn(6); col.setPreferredWidth(80); }
private void llenarjTable() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listaConsolidadoBonosViaticosTO}"); bindingGroup.bind(); this.bbRRHHFunciones.setListaConsolidadoBonosViaticosTO( shrimp.rrhh.delegate.RrhhDelegate.getInstance() .getRhConsolidadoBonosViaticosTO( sisUsuarioEmpresaTO.getEmpCodigo(), fechaDesde, fechaHasta)); this.bindingGroup.bind(); // consigue los datos this.jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE, this.bbRRHHFunciones.getListaConsolidadoBonosViaticosTO(), jtable); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvCategoria}")); columnBinding.setColumnName("Categoria"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvId}")); columnBinding1.setColumnName("ID"); columnBinding1.setColumnClass(String.class); columnBinding1.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvNombres}")); // ${nombreAtributo} columnBinding2.setColumnName("Nombres"); columnBinding2.setColumnClass(String.class); columnBinding2.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvBonos}")); columnBinding3.setColumnName("Bonos"); columnBinding3.setColumnClass(java.math.BigDecimal.class); columnBinding3.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvBonosND}")); columnBinding4.setColumnName("Bonos ND"); columnBinding4.setColumnClass(java.math.BigDecimal.class); columnBinding4.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvBonoFijo}")); columnBinding5.setColumnName("Bono Fijo"); columnBinding5.setColumnClass(java.math.BigDecimal.class); columnBinding5.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvBonoFijoND}")); columnBinding6.setColumnName("Bono Fijo ND"); columnBinding6.setColumnClass(java.math.BigDecimal.class); columnBinding6.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvViaticos}")); columnBinding7.setColumnName("Viaticos"); columnBinding7.setColumnClass(java.math.BigDecimal.class); columnBinding7.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvTotal}")); columnBinding8.setColumnName("Total"); columnBinding8.setColumnClass(java.math.BigDecimal.class); columnBinding8.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding9 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${cbvOrden}")); columnBinding9.setColumnName("Orden"); columnBinding9.setColumnClass(String.class); columnBinding9.setEditable(false); this.bindingGroup.addBinding(this.jTableBinding); this.bindingGroup.bind(); ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS javax.swing.table.TableColumn col = null; col = jtable.getColumnModel().getColumn(0); col.setPreferredWidth(70); col = jtable.getColumnModel().getColumn(1); col.setPreferredWidth(90); col = jtable.getColumnModel().getColumn(2); col.setPreferredWidth(90); col = jtable.getColumnModel().getColumn(3); col.setPreferredWidth(300); jtable.setColumnSelectionAllowed(true); jtable.repaint(); jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); // Metemos el modelo ordenable en la tabla. javax.swing.table.TableRowSorter modeloOrdenado = new javax.swing.table.TableRowSorter(jtable.getModel()); jtable.setRowSorter(modeloOrdenado); }
private void llenarjTableUtilidades() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); // bindingGroup.bind(); this.rRHHBBFunciones.setRhFunXivSueldoConsultarTO( shrimp.rrhh.delegate.RrhhDelegate.getInstance() .getRhFunConsultarXivSueldo( accion.equals("CANCELAR") ? "" : sisUsuarioEmpresaTO.getEmpCodigo(), sector, fechaDesde, fechaHasta)); this.bindingGroup.bind(); // consigue los datos this.jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE, this.rRHHBBFunciones.getRhFunUtilidadesConsultarTOs(), jtblXiiiSueldo); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiCategoria}")); columnBinding.setColumnName("Categoría"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiSector}")); columnBinding1.setColumnName("Sector"); columnBinding1.setColumnClass(String.class); columnBinding1.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiId}")); // ${nombreAtributo} columnBinding2.setColumnName("Id"); columnBinding2.setColumnClass(String.class); columnBinding2.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiApellidos} ${utiNombres}")); columnBinding3.setColumnName("Nombres"); columnBinding3.setColumnClass(String.class); columnBinding3.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiGenero}")); columnBinding4.setColumnName("Género"); columnBinding4.setColumnClass(Character.class); columnBinding4.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiFechaIngreso}")); columnBinding5.setColumnName("Fecha Ingreso"); columnBinding5.setColumnClass(String.class); columnBinding5.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiCargo}")); columnBinding6.setColumnName("Cargo"); columnBinding6.setColumnClass(String.class); columnBinding6.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiTotalIngresos}")); columnBinding7.setColumnName("Total Ingresos"); columnBinding7.setColumnClass(java.math.BigDecimal.class); columnBinding7.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiDiasLaborados}")); columnBinding8.setColumnName("Días Laborados"); columnBinding8.setColumnClass(Short.class); columnBinding8.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding9 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiValorUtilidades}")); columnBinding9.setColumnName("Valor Utilidades"); columnBinding9.setColumnClass(java.math.BigDecimal.class); columnBinding9.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding10 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiCodigoMinisterial}")); columnBinding10.setColumnName("Código Ministerial"); columnBinding10.setColumnClass(String.class); columnBinding10.setEditable(false); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding11 = this.jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${utiPeriodo}|${utiTipo}|${utiNumero}")); columnBinding11.setColumnName("Contable"); columnBinding11.setColumnClass(String.class); columnBinding11.setEditable(false); this.bindingGroup.addBinding(this.jTableBinding); this.bindingGroup.bind(); ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS javax.swing.table.TableColumn col = null; col = jtblXiiiSueldo.getColumnModel().getColumn(0); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(1); col.setPreferredWidth(50); col = jtblXiiiSueldo.getColumnModel().getColumn(2); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(3); col.setPreferredWidth(300); col = jtblXiiiSueldo.getColumnModel().getColumn(4); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(5); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(6); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(7); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(8); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(9); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(10); col.setPreferredWidth(100); col = jtblXiiiSueldo.getColumnModel().getColumn(11); col.setPreferredWidth(200); javax.swing.table.DefaultTableCellRenderer tcrCenter = new javax.swing.table.DefaultTableCellRenderer(); javax.swing.table.DefaultTableCellRenderer tcrRight = new javax.swing.table.DefaultTableCellRenderer(); tcrCenter.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jtblXiiiSueldo .getColumnModel() .getColumn(buscarColumna("Fecha Ingreso")) .setCellRenderer(tcrCenter); jtblXiiiSueldo.getColumnModel().getColumn(buscarColumna("Género")).setCellRenderer(tcrCenter); jtblXiiiSueldo .getColumnModel() .getColumn(buscarColumna("Código Ministerial")) .setCellRenderer(tcrCenter); tcrRight.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jtblXiiiSueldo .getColumnModel() .getColumn(buscarColumna("Total Ingresos")) .setCellRenderer(tcrRight); jtblXiiiSueldo .getColumnModel() .getColumn(buscarColumna("Días Laborados")) .setCellRenderer(tcrRight); jtblXiiiSueldo .getColumnModel() .getColumn(buscarColumna("Xiii Sueldo")) .setCellRenderer(tcrRight); jtblXiiiSueldo.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); // Metemos el modelo ordenable en la tabla. javax.swing.table.TableRowSorter modeloOrdenado = new javax.swing.table.TableRowSorter(jtblXiiiSueldo.getModel()); jtblXiiiSueldo.setRowSorter(modeloOrdenado); jtblXiiiSueldo.setColumnSelectionAllowed(true); }