use of org.eclipse.scout.rt.shared.services.lookup.ILookupCall in project scout.rt by eclipse.
the class BatchLookupService method getBatchDataByText.
@Override
public List<List<ILookupRow<?>>> getBatchDataByText(BatchLookupCall batch) {
List<ILookupCall<?>> calls = batch.getCallBatch();
List<List<ILookupRow<?>>> result = new ArrayList<List<ILookupRow<?>>>();
BatchLookupResultCache cache = new BatchLookupResultCache();
for (ILookupCall<?> call : calls) {
result.add(new ArrayList<ILookupRow<?>>(cache.getDataByText(call)));
}
return result;
}
use of org.eclipse.scout.rt.shared.services.lookup.ILookupCall in project scout.rt by eclipse.
the class BatchLookupService method getBatchDataByAll.
@Override
public List<List<ILookupRow<?>>> getBatchDataByAll(BatchLookupCall batch) {
List<ILookupCall<?>> calls = batch.getCallBatch();
List<List<ILookupRow<?>>> result = new ArrayList<List<ILookupRow<?>>>();
BatchLookupResultCache cache = new BatchLookupResultCache();
for (ILookupCall<?> call : calls) {
result.add(new ArrayList<ILookupRow<?>>(cache.getDataByAll(call)));
}
return result;
}
use of org.eclipse.scout.rt.shared.services.lookup.ILookupCall in project scout.rt by eclipse.
the class AbstractSmartField2 method newByRecLookupRowProvider.
/**
* @see LookupCall#getDataByRec()
*/
protected ILookupRowProvider<VALUE> newByRecLookupRowProvider(final VALUE parentKey, final TriState activeState) {
return new ILookupRowProvider<VALUE>() {
@SuppressWarnings("unchecked")
@Override
public List<ILookupRow<VALUE>> provide(ILookupCall<VALUE> lookupCall) {
return (List<ILookupRow<VALUE>>) lookupCall.getDataByRec();
}
@Override
public void beforeProvide(ILookupCall<VALUE> lookupCall) {
prepareRecLookup(lookupCall, parentKey, activeState);
}
@Override
public void afterProvide(ILookupCall<VALUE> lookupCall, List<ILookupRow<VALUE>> result) {
interceptFilterLookupResult(lookupCall, result);
interceptFilterRecLookupResult(lookupCall, result);
cleanupResultList(result);
}
@Override
public void provideSync(ILookupCall<VALUE> lookupCall, ILookupRowFetchedCallback<VALUE> callback) {
throw new UnsupportedOperationException("Legacy calls not supported");
}
@Override
public IFuture<Void> provideAsync(ILookupCall<VALUE> lookupCall, ILookupRowFetchedCallback<VALUE> callback, ClientRunContext clientRunContext) {
throw new UnsupportedOperationException("Legacy calls not supported");
}
@Override
public String toString() {
ToStringBuilder sb = new ToStringBuilder(this).attr("Rec Lookup").attr("parentKey", parentKey).attr("activeState", activeState);
return sb.toString();
}
};
}
use of org.eclipse.scout.rt.shared.services.lookup.ILookupCall in project scout.rt by eclipse.
the class SmartFieldLookupTest method testSubteeLookup_WithPrepare.
@Test
public void testSubteeLookup_WithPrepare() {
ISmartField<Long> field = new AbstractSmartField<Long>() {
@Override
protected void execPrepareLookup(ILookupCall<Long> call) {
call.setMaster(testMasterValue);
}
};
field.setLookupCall(new TestLookupCall());
List<? extends ILookupRow<Long>> rows2 = field.callSubTreeLookup(1L);
assertEquals(2, rows2.size());
}
use of org.eclipse.scout.rt.shared.services.lookup.ILookupCall in project scout.rt by eclipse.
the class SmartFieldLookupTest method testSubteeLookup_WithPrepareRec.
@Test
public void testSubteeLookup_WithPrepareRec() {
ISmartField<Long> field = new AbstractSmartField<Long>() {
@Override
protected void execPrepareRecLookup(ILookupCall<Long> call, Long parentKey) {
call.setMaster(testMasterValue);
}
};
field.setLookupCall(new TestLookupCall());
List<? extends ILookupRow<Long>> rows2 = field.callSubTreeLookup(1L);
assertEquals(2, rows2.size());
}
Aggregations