use of java.beans.PropertyVetoException in project sic by belluccifranco.
the class FacturasVentaGUI method formInternalFrameOpened.
//GEN-LAST:event_chk_NumFacturaItemStateChanged
private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
//GEN-FIRST:event_formInternalFrameOpened
try {
this.setSize(sizeInternalFrame);
this.setColumnas();
this.setMaximum(true);
rb_soloImpagas.setSelected(true);
dc_FechaDesde.setDate(new Date());
dc_FechaHasta.setDate(new Date());
} catch (PropertyVetoException ex) {
String mensaje = "Se produjo un error al intentar maximizar la ventana.";
LOGGER.error(mensaje + " - " + ex.getMessage());
JOptionPane.showInternalMessageDialog(this, mensaje, "Error", JOptionPane.ERROR_MESSAGE);
this.dispose();
}
}
use of java.beans.PropertyVetoException in project sic by belluccifranco.
the class CajasGUI method internalFrameOpened.
//GEN-LAST:event_btn_AbrirCajaActionPerformed
private void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
//GEN-FIRST:event_internalFrameOpened
this.setSize(sizeInternalFrame);
this.setColumnasCaja();
cmb_Usuarios.addItem(usuarioParaMostrar);
cmb_Usuarios.setEnabled(false);
dc_FechaDesde.setDate(new Date());
dc_FechaHasta.setDate(new Date());
try {
this.setMaximum(true);
} catch (PropertyVetoException ex) {
String mensaje = "Se produjo un error al intentar maximizar la ventana.";
LOGGER.error(mensaje + " - " + ex.getMessage());
JOptionPane.showInternalMessageDialog(this, mensaje, "Error", JOptionPane.ERROR_MESSAGE);
this.dispose();
}
}
use of java.beans.PropertyVetoException in project sic by belluccifranco.
the class CajasGUI method verDetalle.
private void verDetalle(Caja caja) {
JInternalFrame iFrameCaja = Utilidades.estaEnDesktop(getDesktopPane(), CajaGUI.class);
if (iFrameCaja != null) {
iFrameCaja.dispose();
}
iFrameCaja = new CajaGUI(caja);
iFrameCaja.setLocation(getDesktopPane().getWidth() / 2 - iFrameCaja.getWidth() / 2, getDesktopPane().getHeight() / 2 - iFrameCaja.getHeight() / 2);
getDesktopPane().add(iFrameCaja);
iFrameCaja.setVisible(true);
try {
iFrameCaja.setSelected(true);
} catch (PropertyVetoException ex) {
String msjError = "No se pudo seleccionar la ventana requerida.";
LOGGER.error(msjError + " - " + ex.getMessage());
JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
}
}
use of java.beans.PropertyVetoException in project dhis2-core by dhis2.
the class DefaultDataSourceManager method getReadOnlyDataSources.
// -------------------------------------------------------------------------
// Supportive methods
// -------------------------------------------------------------------------
private List<DataSource> getReadOnlyDataSources() {
String mainUser = config.getProperty(ConfigurationKey.CONNECTION_USERNAME);
String mainPassword = config.getProperty(ConfigurationKey.CONNECTION_PASSWORD);
String driverClass = config.getProperty(CONNECTION_DRIVER_CLASS);
String maxPoolSize = config.getPropertyOrDefault(CONNECTION_POOL_MAX_SIZE, DEFAULT_POOL_SIZE);
Properties props = config.getProperties();
List<DataSource> dataSources = new ArrayList<>();
for (int i = 1; i <= MAX_READ_REPLICAS; i++) {
String jdbcUrl = props.getProperty(String.format(FORMAT_CONNECTION_URL, i));
String user = props.getProperty(String.format(FORMAT_CONNECTION_USERNAME, i));
String password = props.getProperty(String.format(FORMAT_CONNECTION_PASSWORD, i));
user = StringUtils.defaultIfEmpty(user, mainUser);
password = StringUtils.defaultIfEmpty(password, mainPassword);
if (ObjectUtils.allNonNull(jdbcUrl, user, password)) {
try {
ComboPooledDataSource ds = new ComboPooledDataSource();
ds.setDriverClass(driverClass);
ds.setJdbcUrl(jdbcUrl);
ds.setUser(user);
ds.setPassword(password);
ds.setMaxPoolSize(Integer.valueOf(maxPoolSize));
ds.setAcquireIncrement(VAL_ACQUIRE_INCREMENT);
ds.setMaxIdleTime(VAL_MAX_IDLE_TIME);
dataSources.add(ds);
log.info("Found read replica, connection URL: " + jdbcUrl);
} catch (PropertyVetoException ex) {
throw new IllegalArgumentException("Invalid configuration of read replica: " + jdbcUrl, ex);
}
}
}
log.info("Read only configuration initialized, read replicas found: " + dataSources.size());
return dataSources;
}
Aggregations