private void storeSettings(ExternalFileType entry) { entry.setName(name.getText().trim()); entry.setMimeType(mimeType.getText().trim()); // Set extension, but remove initial dot if user has added that: String ext = extension.getText().trim(); if (!ext.isEmpty() && ext.charAt(0) == '.') { entry.setExtension(ext.substring(1)); } else { entry.setExtension(ext); } if (selectedIcon != null) { entry.setIconName(selectedIcon); entry.setIcon(IconTheme.getImage(entry.getIconName())); } if (!OS.WINDOWS) { entry.setOpenWith(application.getText().trim()); } else { // On Windows, store application as empty if the "Default" option is selected, // or if the application name is empty: if (useDefault.isSelected() || application.getText().trim().isEmpty()) { entry.setOpenWith(""); } else { entry.setOpenWith(application.getText().trim()); } } }