boolean () { String newValue = getText(); if (newValue.equals(myOldValue)) { return true; } if (myValueEditor.isValid(newValue)) { if (myModel.contains(newValue)) { setBorder(false); showError(FileTypesBundle.message("filetype.ignore.error.already.exists")); return false; } if (myOldValue != null) { myModel.removeElement(myOldValue); } myModel.addElement(newValue); int index = myModel.indexOf(newValue); myPatternList.setSelectedIndex(index); setBorder(true); reorderList(); return true; } else { showError(FileTypesBundle.message("filetype.ignore.error.invalid")); setBorder(false); return false; } }