Search in sources :

Example 1 with JXSearchField

use of org.jdesktop.swingx.JXSearchField in project com.revolsys.open by revolsys.

the class FieldFilterPanel method removeListeners.

@SuppressWarnings("rawtypes")
private void removeListeners(final JComponent component) {
    if (component instanceof AbstractRecordQueryField) {
        final AbstractRecordQueryField queryField = (AbstractRecordQueryField) component;
        queryField.removePropertyChangeListener("selectedRecord", this);
    } else if (component instanceof JXSearchField) {
        final JXSearchField searchTextField = (JXSearchField) component;
        searchTextField.removeActionListener(this);
    } else if (component instanceof JComboBox) {
        final JComboBox comboField = (JComboBox) component;
        comboField.removeActionListener(this);
    } else if (component instanceof DateField) {
        final DateField dateField = (DateField) component;
        dateField.removeActionListener(this);
    }
    if (component instanceof Field) {
        final Field field = (Field) component;
        final String fieldName = field.getFieldName();
        Property.removeListener(field, fieldName, this);
    }
}
Also used : JXSearchField(org.jdesktop.swingx.JXSearchField) DateField(com.revolsys.swing.field.DateField) AbstractRecordQueryField(com.revolsys.swing.field.AbstractRecordQueryField) Field(com.revolsys.swing.field.Field) TextField(com.revolsys.swing.field.TextField) QueryWhereConditionField(com.revolsys.swing.field.QueryWhereConditionField) JXSearchField(org.jdesktop.swingx.JXSearchField) JComboBox(javax.swing.JComboBox) AbstractRecordQueryField(com.revolsys.swing.field.AbstractRecordQueryField) DateField(com.revolsys.swing.field.DateField)

Example 2 with JXSearchField

use of org.jdesktop.swingx.JXSearchField in project com.revolsys.open by revolsys.

the class FieldFilterPanel method addListeners.

private void addListeners(final JComponent component) {
    if (component instanceof AbstractRecordQueryField) {
        final AbstractRecordQueryField queryField = (AbstractRecordQueryField) component;
        queryField.addPropertyChangeListener("selectedRecord", this);
    } else if (component instanceof JXSearchField) {
        final JXSearchField searchTextField = (JXSearchField) component;
        searchTextField.addActionListener(this);
    } else if (component instanceof JTextComponent) {
        final JTextComponent searchTextField = (JTextComponent) component;
        searchTextField.getDocument().addDocumentListener(this);
    } else if (component instanceof DateField) {
        final DateField dateField = (DateField) component;
        dateField.addActionListener(this);
    }
    if (component instanceof Field) {
        final Field field = (Field) component;
        final String fieldName = field.getFieldName();
        Property.addListener(field, fieldName, this);
    }
}
Also used : JXSearchField(org.jdesktop.swingx.JXSearchField) DateField(com.revolsys.swing.field.DateField) AbstractRecordQueryField(com.revolsys.swing.field.AbstractRecordQueryField) Field(com.revolsys.swing.field.Field) TextField(com.revolsys.swing.field.TextField) QueryWhereConditionField(com.revolsys.swing.field.QueryWhereConditionField) JXSearchField(org.jdesktop.swingx.JXSearchField) JTextComponent(javax.swing.text.JTextComponent) AbstractRecordQueryField(com.revolsys.swing.field.AbstractRecordQueryField) DateField(com.revolsys.swing.field.DateField)

Aggregations

AbstractRecordQueryField (com.revolsys.swing.field.AbstractRecordQueryField)2 DateField (com.revolsys.swing.field.DateField)2 Field (com.revolsys.swing.field.Field)2 QueryWhereConditionField (com.revolsys.swing.field.QueryWhereConditionField)2 TextField (com.revolsys.swing.field.TextField)2 JXSearchField (org.jdesktop.swingx.JXSearchField)2 JComboBox (javax.swing.JComboBox)1 JTextComponent (javax.swing.text.JTextComponent)1