Search in sources :

Example 16 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class IdentifierField method updateFieldValue.

@Override
public void updateFieldValue() {
    final String text = getText();
    final Identifier id = TypedIdentifier.newIdentifier(text);
    setFieldValue(id);
}
Also used : TypedIdentifier(com.revolsys.identifier.TypedIdentifier) Identifier(com.revolsys.identifier.Identifier)

Example 17 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class IdentifierField method getFieldValue.

@SuppressWarnings("unchecked")
@Override
public <T> T getFieldValue() {
    final String text = getText();
    final Identifier id = TypedIdentifier.newIdentifier(text);
    return (T) id;
}
Also used : TypedIdentifier(com.revolsys.identifier.TypedIdentifier) Identifier(com.revolsys.identifier.Identifier)

Example 18 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class AbstractRecordQueryField method valueChanged.

@Override
public void valueChanged(final ListSelectionEvent e) {
    if (!e.getValueIsAdjusting() && this.eventsEnabled.isTrue()) {
        try (final BaseCloseable eventsEnabled = eventsDisabled()) {
            final Record record = (Record) this.list.getSelectedValue();
            if (record != null) {
                setSelectedRecord(record);
                final Identifier identifier = record.getIdentifier();
                final String label = record.getString(this.displayField);
                this.idToDisplayMap.put(identifier, label);
                if (!DataType.equal(label, this.searchField.getText())) {
                    this.searchField.setFieldValue(label);
                }
                super.setFieldValue(identifier);
            }
            this.menu.setVisible(false);
            this.searchField.requestFocus();
        }
    }
}
Also used : BaseCloseable(com.revolsys.io.BaseCloseable) Identifier(com.revolsys.identifier.Identifier) Record(com.revolsys.record.Record)

Example 19 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class LayerRecordForm method getFieldValue.

@SuppressWarnings("unchecked")
public <T> T getFieldValue(final String name) {
    final Object value = this.fieldValues.get(name);
    final CodeTable codeTable = this.recordDefinition.getCodeTableByFieldName(name);
    if (codeTable == null) {
        if (value != null && name.endsWith("_IND")) {
            if ("Y".equals(value) || Boolean.TRUE.equals(value)) {
                return (T) "Y";
            } else {
                return (T) "N";
            }
        } else {
            return (T) value;
        }
    } else {
        final Identifier id = codeTable.getIdentifier(value);
        return (T) id;
    }
}
Also used : CodeTable(com.revolsys.record.code.CodeTable) Identifier(com.revolsys.identifier.Identifier)

Example 20 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class LayerRecordForm method getTitle.

public static String getTitle(final LayerRecord record) {
    final AbstractRecordLayer layer = record.getLayer();
    final Identifier id = record.getIdentifier();
    String title;
    final String layerName = layer.getName();
    if (record.getState() == RecordState.NEW) {
        title = "Add New " + layerName;
    } else if (layer.isCanEditRecords()) {
        title = "Edit " + layerName;
        if (id != null) {
            title += " #" + id;
        }
    } else {
        title = "View " + layerName;
        if (id != null) {
            title += " #" + id;
        }
    }
    return title;
}
Also used : Identifier(com.revolsys.identifier.Identifier) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Aggregations

Identifier (com.revolsys.identifier.Identifier)56 Record (com.revolsys.record.Record)17 ArrayList (java.util.ArrayList)12 RecordDefinition (com.revolsys.record.schema.RecordDefinition)11 SingleIdentifier (com.revolsys.identifier.SingleIdentifier)8 ListIdentifier (com.revolsys.identifier.ListIdentifier)7 TypedIdentifier (com.revolsys.identifier.TypedIdentifier)6 CodeTable (com.revolsys.record.code.CodeTable)6 RecordReader (com.revolsys.record.io.RecordReader)5 RecordStore (com.revolsys.record.schema.RecordStore)5 Transaction (com.revolsys.transaction.Transaction)5 List (java.util.List)5 Geometry (com.revolsys.geometry.model.Geometry)4 BaseCloseable (com.revolsys.io.BaseCloseable)4 PathName (com.revolsys.io.PathName)4 ArrayRecord (com.revolsys.record.ArrayRecord)4 Query (com.revolsys.record.query.Query)4 OsmElement (com.revolsys.record.io.format.openstreetmap.model.OsmElement)3 FieldDefinition (com.revolsys.record.schema.FieldDefinition)3 CompoundCoordinateSystem (com.revolsys.geometry.cs.CompoundCoordinateSystem)2