private SingleConfigurationConfigurable(RunnerAndConfigurationSettingsImpl settings) { super(new ConfigurationSettingsEditorWrapper(settings), settings); final Config configuration = (Config) getSettings().getConfiguration(); myDisplayName = getSettings().getName(); myHelpTopic = null; // TODO myIcon = configuration.getType().getIcon(); myBrokenConfiguration = configuration instanceof UnknownRunConfiguration; setNameText(configuration.getName()); myNameDocument.addDocumentListener( new DocumentAdapter() { public void textChanged(DocumentEvent event) { setModified(true); } }); getEditor() .addSettingsEditorListener( new SettingsEditorListener() { public void stateChanged(SettingsEditor settingsEditor) { myValidationResultValid = false; } }); }
public void testIsWriteLocked() throws Exception { PlainDocument doc = new PlainDocument(); assertFalse(DocumentUtilities.isWriteLocked(doc)); doc.addDocumentListener( new DocumentListener() { public void insertUpdate(DocumentEvent evt) { assertTrue(DocumentUtilities.isWriteLocked(evt.getDocument())); } public void removeUpdate(DocumentEvent evt) {} public void changedUpdate(DocumentEvent evt) {} }); doc.insertString(0, "test", null); }
/** @return */ private JTextField getJTextFieldKomm() { if (jTextFieldKomm == null) { jTextFieldKomm = new JTextField(); jTextFieldKomm.setBounds(20, 30, 400, 25); jTextFieldKomm.setFont(getFontA()); PlainDocument docTitel = new PlainDocument(); jTextFieldKomm.setDocument(docTitel); docTitel.addDocumentListener( new DocumentListener() { public void insertUpdate(DocumentEvent e) { handleTextChange(); } public void removeUpdate(DocumentEvent e) { handleTextChange(); } public void changedUpdate(DocumentEvent e) {} }); } return jTextFieldKomm; }
public final void addNameListner(DocumentListener listener) { myNameDocument.addDocumentListener(listener); }