Exemplo n.º 1
0
 private void typeComboBoxActionPerformed(
     java.awt.event.ActionEvent evt) // GEN-FIRST:event_typeComboBoxActionPerformed
     { // GEN-HEADEREND:event_typeComboBoxActionPerformed
   PodVariant.Type type = (PodVariant.Type) typeComboBox.getSelectedItem();
   CardLayout cardLayout = (CardLayout) (valueControlPanel.getLayout());
   String cardName =
       type.equals(PodVariant.Type.BOOLEAN)
           ? "BOOLEAN"
           : type.equals(PodVariant.Type.DOUBLE)
               ? "NUMBER"
               : type.equals(PodVariant.Type.INTEGER)
                   ? "NUMBER"
                   : type.equals(PodVariant.Type.STRING)
                       ? "TEXT"
                       : type.equals(PodVariant.Type.PATH) ? "TEXT" : "BOOLEAN";
   cardLayout.show(valueControlPanel, cardName);
 } // GEN-LAST:event_typeComboBoxActionPerformed
Exemplo n.º 2
0
 private void okButtonActionPerformed(
     java.awt.event.ActionEvent evt) // GEN-FIRST:event_okButtonActionPerformed
     { // GEN-HEADEREND:event_okButtonActionPerformed
   PodVariant.Type type = (PodVariant.Type) typeComboBox.getSelectedItem();
   Object value =
       type.equals(PodVariant.Type.BOOLEAN)
           ? booleanCheck.isSelected()
           : type.equals(PodVariant.Type.DOUBLE)
               ? numberSpinner.getValue()
               : type.equals(PodVariant.Type.INTEGER)
                   ? numberSpinner.getValue()
                   : type.equals(PodVariant.Type.STRING)
                       ? textPane.getText()
                       : type.equals(PodVariant.Type.PATH) ? textPane.getText() : null;
   String category = categoryCombo.getSelectedItem().toString();
   if (value != null) {
     theValue =
         new EnvironmentVar(type, category, varNameInput.getText(), true, new PodVariant(value));
   }
   setVisible(false);
 } // GEN-LAST:event_okButtonActionPerformed