use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.
the class ArcGisResponse method refresh.
@Override
public final void refresh() {
synchronized (this.resfreshSync) {
try (BaseCloseable noCache = FileResponseCache.disable()) {
refreshDo();
this.hasError = false;
} catch (final WrappedException e) {
this.hasError = true;
final Throwable cause = Exceptions.unwrap(e);
if (cause instanceof UnknownHostException) {
Logs.error(this, "Cannot find host " + cause.getMessage());
}
} catch (final Throwable e) {
this.hasError = true;
throw Exceptions.wrap("Unable to initialize: " + this, e);
}
}
}
use of com.revolsys.io.BaseCloseable 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.io.BaseCloseable in project com.revolsys.open by revolsys.
the class LayerRecordForm method setValues.
public final void setValues(final Map<String, Object> values) {
if (values != null) {
Invoke.later(() -> {
final Set<String> fieldNames = values.keySet();
try (final BaseCloseable c = setFieldValidationEnabled(false)) {
this.fieldValues.putAll(values);
for (final String fieldName : fieldNames) {
final Object value = values.get(fieldName);
final JComponent field = (JComponent) getField(fieldName);
if (field != null) {
SwingUtil.setFieldValue(field, value);
}
}
}
validateFields(fieldNames);
});
}
}
use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.
the class AbstractLayer method setName.
@Override
public void setName(final String name) {
final Object oldValue = this.name;
final LayerGroup layerGroup = getLayerGroup();
String newName = name;
if (layerGroup != null) {
int i = 1;
while (layerGroup.hasLayerWithSameName(this, newName)) {
newName = name + i;
i++;
}
}
this.name = newName;
try (final BaseCloseable eventsEnabled = eventsEnabled()) {
firePropertyChange("name", oldValue, this.name);
}
}
use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.
the class AbstractLayer method setIcon.
public void setIcon(final Icon icon) {
final Object oldValue = this.icon;
this.icon = icon;
try (final BaseCloseable eventsEnabled = eventsEnabled()) {
firePropertyChange("icon", oldValue, icon);
}
}
Aggregations