use of javax.swing.text.AbstractDocument in project processdash by dtuma.
the class CustomColumnEditor method buildGUI.
private void buildGUI() {
layout = new GridBagLayout();
contents = new JPanel(layout);
GridBagConstraints l = new GridBagConstraints();
l.gridx = 0;
l.anchor = GridBagConstraints.EAST;
l.insets = new Insets(0, 0, 5, 5);
GridBagConstraints f = new GridBagConstraints();
f.gridx = 1;
f.anchor = GridBagConstraints.WEST;
f.insets = new Insets(0, 0, 5, 0);
l.gridy = f.gridy = 0;
add(new JLabel(resources.getString("Column_ID")), l);
add(columnID = hintField("Column_ID_Hint", 15), f);
add(columnIDLabel = new JLabel(), f);
((AbstractDocument) columnID.getDocument()).setDocumentFilter(new ColumnIDFilter());
l.gridy = ++f.gridy;
add(new JLabel(resources.getString("Column_Name")), l);
add(columnName = hintField("Column_Name_Hint", 15), f);
l.gridy = ++f.gridy;
add(new JLabel(resources.getString("Column_Type")), l);
add(textColumnType = new JComboBox(resources.getStrings("Column_Type_", TEXT_TYPES)), f);
++f.gridy;
add(autocomplete = checkbox("Autocomplete", true), f);
GridBagConstraints ff = (GridBagConstraints) f.clone();
ff.fill = GridBagConstraints.HORIZONTAL;
add(allowedValues = hintField("Values_Hint", 0), ff);
add(Box.createHorizontalStrut(new JLabel(allowedValues.getHint()).getPreferredSize().width), f);
++f.gridy;
add(multivalued = checkbox("Multivalued", false), f);
++f.gridy;
add(inherited = checkbox("Inherited", true), f);
++f.gridy;
add(syncAsLabel = checkbox("Sync_As_Label", false), f);
textColumnType.addActionListener(this);
actionPerformed(null);
}
use of javax.swing.text.AbstractDocument in project knime-core by knime.
the class DialogComponentAuthentication method updateNoListener.
private static void updateNoListener(final JTextField txtField, final String text) {
final AbstractDocument doc = (AbstractDocument) txtField.getDocument();
DocumentListener[] listeners = doc.getDocumentListeners();
for (DocumentListener listener : listeners) {
doc.removeDocumentListener(listener);
}
txtField.setText(text);
for (DocumentListener listener : listeners) {
doc.addDocumentListener(listener);
}
}
Aggregations