Search in sources :

Example 1 with RecordStoreConnection

use of com.revolsys.record.io.RecordStoreConnection in project com.revolsys.open by revolsys.

the class RecordStoreConnectionForm method addHandlers.

public static void addHandlers() {
    RecordStoreConnectionManager.setInvalidRecordStoreFunction((connection, exception) -> {
        return Invoke.andWait(() -> {
            final RecordStoreConnectionRegistry registry = connection.getRegistry();
            final RecordStoreConnectionForm form = new RecordStoreConnectionForm(registry, connection, exception);
            return form.showDialog();
        });
    });
    RecordStoreConnectionManager.setMissingRecordStoreFunction((name) -> {
        final RecordStoreConnectionRegistry registry = RecordStoreConnectionManager.get().getUserConnectionRegistry();
        Invoke.andWait(() -> {
            final RecordStoreConnectionForm form = new RecordStoreConnectionForm(registry, name);
            form.showDialog();
        });
        final RecordStoreConnection connection = registry.getConnection(name);
        if (connection == null) {
            return null;
        } else {
            return connection.getRecordStore();
        }
    });
}
Also used : RecordStoreConnection(com.revolsys.record.io.RecordStoreConnection) RecordStoreConnectionRegistry(com.revolsys.record.io.RecordStoreConnectionRegistry)

Aggregations

RecordStoreConnection (com.revolsys.record.io.RecordStoreConnection)1 RecordStoreConnectionRegistry (com.revolsys.record.io.RecordStoreConnectionRegistry)1