Search in sources :

Example 1 with ILookUpService

use of org.jowidgets.cap.common.api.service.ILookUpService in project jo-client-platform by jo-source.

the class CapServiceProviderBuilder method addLookUpService.

public void addLookUpService(final Object lookUpId, final ISyncLookUpService lookUpService) {
    final IAdapterFactory<ILookUpService, ISyncLookUpService> adapterFactoryProvider;
    adapterFactoryProvider = CapServiceToolkit.adapterFactoryProvider().lookup();
    final ILookUpService asyncService = adapterFactoryProvider.createAdapter(lookUpService);
    final ServiceId<ILookUpService> serviceId = new ServiceId<ILookUpService>(lookUpId, ILookUpService.class);
    addService(serviceId, asyncService);
}
Also used : ISyncLookUpService(org.jowidgets.cap.service.api.adapter.ISyncLookUpService) ILookUpService(org.jowidgets.cap.common.api.service.ILookUpService) IServiceId(org.jowidgets.service.api.IServiceId) ServiceId(org.jowidgets.service.tools.ServiceId)

Example 2 with ILookUpService

use of org.jowidgets.cap.common.api.service.ILookUpService in project jo-client-platform by jo-source.

the class LookUpAccessImpl method readLookUp.

private void readLookUp() {
    if (executionTask == null) {
        executionTask = CapUiToolkit.executionTaskFactory().create();
        fireTaskCreated(executionTask);
        for (final ILookUpCallback callback : callbacks.keySet()) {
            callback.beforeChange();
        }
        final ILookUpService lazyLookUpService = getLookUpServiceLazy();
        if (lazyLookUpService != null) {
            lazyLookUpService.readValues(lookUpCallback, executionTask);
        } else {
            lookUpCallback.exception(new IllegalStateException("No look up service found for the lookUp '" + lookUpId + "'"));
        }
    }
}
Also used : ILookUpCallback(org.jowidgets.cap.ui.api.lookup.ILookUpCallback) ILookUpService(org.jowidgets.cap.common.api.service.ILookUpService)

Aggregations

ILookUpService (org.jowidgets.cap.common.api.service.ILookUpService)2 ISyncLookUpService (org.jowidgets.cap.service.api.adapter.ISyncLookUpService)1 ILookUpCallback (org.jowidgets.cap.ui.api.lookup.ILookUpCallback)1 IServiceId (org.jowidgets.service.api.IServiceId)1 ServiceId (org.jowidgets.service.tools.ServiceId)1