Search in sources :

Example 41 with Field

use of com.revolsys.swing.field.Field in project com.revolsys.open by revolsys.

the class Form method addNewField.

@SuppressWarnings("unchecked")
public <F> F addNewField(final String fieldName, final DataType dataType) {
    final Field field = newField(fieldName, dataType);
    addField(field);
    return (F) field;
}
Also used : Field(com.revolsys.swing.field.Field)

Example 42 with Field

use of com.revolsys.swing.field.Field in project com.revolsys.open by revolsys.

the class Form method newPanelTitledLabelledFields.

public BasePanel newPanelTitledLabelledFields(final String title, final Field... fields) {
    final BasePanel panel = BasePanel.newPanelTitled(title);
    for (final Field field : fields) {
        final String fieldName = field.getFieldName();
        final Component component = field.getComponent();
        panel.addWithLabel(fieldName, component);
    }
    GroupLayouts.makeColumns(panel, 2, true, true);
    return panel;
}
Also used : Field(com.revolsys.swing.field.Field) JComponent(javax.swing.JComponent) Component(java.awt.Component)

Example 43 with Field

use of com.revolsys.swing.field.Field in project com.revolsys.open by revolsys.

the class ValueField method save.

private void save(final Container container) {
    final Component[] components = container.getComponents();
    for (final Component component : components) {
        if (component instanceof ValueField) {
            final ValueField valuePanel = (ValueField) component;
            valuePanel.save();
        } else if (component instanceof Field) {
            final Field field = (Field) component;
            field.updateFieldValue();
        } else if (component instanceof Container) {
            final Container childContainer = (Container) component;
            save(childContainer);
        }
    }
    this.saved = true;
}
Also used : Field(com.revolsys.swing.field.Field) Container(java.awt.Container) JComponent(javax.swing.JComponent) Component(java.awt.Component)

Aggregations

Field (com.revolsys.swing.field.Field)43 NumberTextField (com.revolsys.swing.field.NumberTextField)15 ObjectLabelField (com.revolsys.swing.field.ObjectLabelField)15 Component (java.awt.Component)13 TextField (com.revolsys.swing.field.TextField)12 JComponent (javax.swing.JComponent)9 JTextField (javax.swing.JTextField)8 AbstractRecordQueryField (com.revolsys.swing.field.AbstractRecordQueryField)7 DateField (com.revolsys.swing.field.DateField)7 ColorChooserField (com.revolsys.swing.field.ColorChooserField)5 QueryWhereConditionField (com.revolsys.swing.field.QueryWhereConditionField)5 JXSearchField (org.jdesktop.swingx.JXSearchField)5 Container (java.awt.Container)4 JComboBox (javax.swing.JComboBox)4 RecordDefinition (com.revolsys.record.schema.RecordDefinition)3 FontChooserField (com.revolsys.swing.field.FontChooserField)3 LengthMeasureTextField (com.revolsys.swing.field.LengthMeasureTextField)3 MarkerField (com.revolsys.swing.map.component.MarkerField)3 AbstractRecordLayer (com.revolsys.swing.map.layer.record.AbstractRecordLayer)3 BaseCloseable (com.revolsys.io.BaseCloseable)2