@Override public boolean accept(File dir, String name) { return name.endsWith(".lst") && !linearDefinition.getLists().contains(name); } });
public void update(DocumentEvent e) { Document document = e.getDocument(); try { String value = document.getText(0, document.getLength()); if (value.trim().length() == 0) { newListButton.setEnabled(false); newListButton.setText("Add"); } else if (value.contains(":")) { newListButton.setEnabled(false); newListButton.setText("Colon Char Forbidden"); } else if (linearDefinition.getLists().contains(value)) { // this list already exists in the gazetteer newListButton.setEnabled(false); newListButton.setText("Existing"); } else { newListButton.setEnabled(true); newListButton.setText("Add"); } } catch (BadLocationException ble) { ble.printStackTrace(); } } });