public AbstractMenuItemType getValue() {
    AbstractMenuItemType menuItem;
    if (commandComboBox.isVisible()) {
      MenuItemType menuItemType = new MenuItemType();
      CommandType command = new CommandType();
      command.setRef((String) commandComboBoxModel.getSelectedItem());
      for (int row = 0; row < argumentTableModel.getRowCount(); row++) {
        final String value = (String) argumentTableModel.getValueAt(row, 0);
        if (value != null && value.length() > 0) {
          command.getArgument().add(value);
        }
      }
      menuItemType.setCommand(command);
      menuItem = menuItemType;
    } else {
      menuItem = new MenuGroupType();
    }
    menuItem.setName(nameTextField.getText());
    menuItem.setDescription(descriptionTextField.getText());
    menuItem.setIcon(iconTextField.getText());

    return menuItem;
  }
 private void moveArgumentDownButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_moveArgumentDownButtonActionPerformed
   final int selectedRow = argumentTable.getSelectedRow();
   argumentTableModel.moveDown(selectedRow);
   argumentTable.getSelectionModel().setSelectionInterval(selectedRow + 1, selectedRow + 1);
 } // GEN-LAST:event_moveArgumentDownButtonActionPerformed
 private void deleteArgumentButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_deleteArgumentButtonActionPerformed
   argumentTableModel.delete(argumentTable.getSelectedRow());
   argumentTable.getSelectionModel().clearSelection();
 } // GEN-LAST:event_deleteArgumentButtonActionPerformed
 private void addArgumentButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_addArgumentButtonActionPerformed
   argumentTableModel.setValueAt(null, argumentTableModel.getRowCount(), 0);
 } // GEN-LAST:event_addArgumentButtonActionPerformed