/** * Creates new form ConfigDialog. * @param owner the owner of the dialog * @param context the droid global context */ public ConfigDialog(Frame owner, GlobalContext context) { super(owner, true); this.context = context; init(context.getGlobalConfig().getPropertiesMap()); initComponents(); setPanelComponents(autoUpdatePanel, autoUpdateCheckbox.isSelected()); updateFrequencyTextBox.setEnabled(updateScheduleRadioButton.isSelected() && autoUpdateCheckbox.isSelected()); setLocationRelativeTo(owner); }
/** * Creates new form ConfigDialog. * @param owner the owner of the dialog * @param context the droid global context */ public ConfigDialog(Frame owner, GlobalContext context) { super(owner, true); this.context = context; init(context.getGlobalConfig().getPropertiesMap()); initComponents(); setPanelComponents(autoUpdatePanel, autoUpdateCheckbox.isSelected()); updateFrequencyTextBox.setEnabled(updateScheduleRadioButton.isSelected() && autoUpdateCheckbox.isSelected()); setLocationRelativeTo(owner); }
private void settingsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_settingsMenuItemActionPerformed // initialise the dialog's values Map<String, Object> settings = globalContext.getGlobalConfig().getPropertiesMap(); configDialog.init(settings); configDialog.setVisible(true); if (configDialog.getResponse() == ConfigDialog.OK) { try { globalContext.getGlobalConfig().update(configDialog.getGlobalConfig()); } catch (ConfigurationException e) { log.error("Error updating properties: " + e.getMessage(), e); JOptionPane.showMessageDialog(configDialog, NbBundle.getMessage(ConfigDialog.class, "ConfigDialog.error.text"), NbBundle.getMessage(ConfigDialog.class, "ConfigDialog.error.title"), JOptionPane.ERROR_MESSAGE); } } }// GEN-LAST:event_settingsMenuItemActionPerformed
private void settingsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_settingsMenuItemActionPerformed // initialise the dialog's values Map<String, Object> settings = globalContext.getGlobalConfig().getPropertiesMap(); configDialog.init(settings); configDialog.setVisible(true); if (configDialog.getResponse() == ConfigDialog.OK) { try { globalContext.getGlobalConfig().update(configDialog.getGlobalConfig()); } catch (ConfigurationException e) { log.error("Error updating properties: " + e.getMessage(), e); JOptionPane.showMessageDialog(configDialog, NbBundle.getMessage(ConfigDialog.class, "ConfigDialog.error.text"), NbBundle.getMessage(ConfigDialog.class, "ConfigDialog.error.title"), JOptionPane.ERROR_MESSAGE); } } }// GEN-LAST:event_settingsMenuItemActionPerformed