Ejemplo n.º 1
0
  /**
   * Removes the selected ext value
   *
   * @param row the row in the table of the ext value to be deleted
   */
  public void remValue(int row) {
    if (row >= 0) {
      int answer =
          JOptionPane.showConfirmDialog(
              null,
              Bundle.getMessage(Bundle.MSG_DELETE_EXT_KEY),
              Bundle.getMessage(Bundle.MSG_DELETE_EXT_KEY_TITLE),
              JOptionPane.YES_NO_OPTION);

      if (answer == 0) {
        xVal.remove(row);
      }
    }
    fireTableDataChanged();
  }
Ejemplo n.º 2
0
  /**
   * Adds a ext value
   *
   * @return the position in table where the new ext value was added
   */
  public int addValue() {
    String newValue = new String(Bundle.getMessage(Bundle.NEW_VALUE));
    xVal.add(newValue);

    fireTableDataChanged();
    return xVal.size() - 1;
  }
Ejemplo n.º 3
0
 /**
  * Sets the value in the cell at col and row to value.
  *
  * @param value the new value
  * @param row the row whose value is to be changed
  * @param col the column whose value is to be changed
  */
 public void setValueAt(Object value, int row, int col) {
   String val = (String) value;
   if ((val != null) && (!val.equals(""))) {
     xVal.set(row, val);
   } else {
     JOptionPane.showMessageDialog(null, Bundle.getMessage(Bundle.MSG_VALUE_EMPTY));
   }
 }