List<String> () { if (myCurrentCard.equals(CARD_COMMAND_LINE)) { return StringUtil.split(myCommandLineField.getText(), " "); } List<String> result = new ArrayList<>(); for (Map.Entry<SetupTask.Option, JComponent> entry : myOptionComponents.entrySet()) { final SetupTask.Option option = entry.getKey(); if (option.checkbox) { JCheckBox checkBox = (JCheckBox)entry.getValue(); if (checkBox.isSelected() != option.negative) { result.add("--" + option.name); } } else { LabeledComponent<JTextField> textField = (LabeledComponent<JTextField>)entry.getValue(); String text = textField.getComponent().getText(); if (text.length() > 0) { result.add("--" + option.name + text); } } } return result; }