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; }