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);
}
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;
}
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();
}
}
}
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;
}
}
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;
}
Aggregations