Search in sources :

Example 21 with ToStringBuilder

use of org.eclipse.scout.rt.platform.util.ToStringBuilder in project scout.rt by eclipse.

the class AbstractSmartField2 method newByTextLookupRowProvider.

/**
 * Creates a {@link ILookupRowProvider} to fetch rows matching the given text.
 *
 * @see LookupCall#getDataByText()
 * @see LookupCall#getDataByTextInBackground(ILookupRowFetchedCallback)
 */
protected ILookupRowProvider<VALUE> newByTextLookupRowProvider(final String text) {
    return new ILookupRowProvider<VALUE>() {

        @Override
        public void beforeProvide(ILookupCall<VALUE> lookupCall) {
            prepareTextLookup(lookupCall, text);
        }

        @Override
        public void afterProvide(ILookupCall<VALUE> call, List<ILookupRow<VALUE>> result) {
            interceptFilterLookupResult(call, result);
            interceptFilterTextLookupResult(call, result);
            cleanupResultList(result);
        }

        @Override
        public void provideSync(ILookupCall<VALUE> lookupCall, ILookupRowFetchedCallback<VALUE> callback) {
            callback.onSuccess(provide(lookupCall));
        }

        @Override
        public IFuture<Void> provideAsync(ILookupCall<VALUE> lookupCall, ILookupRowFetchedCallback<VALUE> callback, ClientRunContext clientRunContext) {
            return lookupCall.getDataByTextInBackground(clientRunContext, callback);
        }

        @SuppressWarnings("unchecked")
        @Override
        public List<ILookupRow<VALUE>> provide(ILookupCall<VALUE> lookupCall) {
            return (List<ILookupRow<VALUE>>) lookupCall.getDataByText();
        }

        @Override
        public String toString() {
            ToStringBuilder sb = new ToStringBuilder(this).attr("Text Lookup").attr("text", text);
            return sb.toString();
        }
    };
}
Also used : ClientRunContext(org.eclipse.scout.rt.client.context.ClientRunContext) ILookupRow(org.eclipse.scout.rt.shared.services.lookup.ILookupRow) ILookupRowProvider(org.eclipse.scout.rt.client.ui.form.fields.smartfield.ILookupRowProvider) ILookupRowFetchedCallback(org.eclipse.scout.rt.shared.services.lookup.ILookupRowFetchedCallback) ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder) List(java.util.List) ArrayList(java.util.ArrayList) ILookupCall(org.eclipse.scout.rt.shared.services.lookup.ILookupCall)

Example 22 with ToStringBuilder

use of org.eclipse.scout.rt.platform.util.ToStringBuilder in project scout.rt by eclipse.

the class AbstractSmartField2 method newByAllLookupRowProvider.

/**
 * Creates a {@link ILookupRowProvider} to fetch all rows.
 *
 * @see LookupCall#getDataByAll()
 * @see LookupCall#getDataByAllInBackground(ILookupRowFetchedCallback)
 */
protected ILookupRowProvider<VALUE> newByAllLookupRowProvider(final String browseHint, final TriState activeState) {
    return new ILookupRowProvider<VALUE>() {

        @Override
        public void beforeProvide(ILookupCall<VALUE> lookupCall) {
            prepareBrowseLookup(lookupCall, browseHint, activeState);
        }

        @Override
        public void afterProvide(ILookupCall<VALUE> lookupCall, List<ILookupRow<VALUE>> result) {
            interceptFilterLookupResult(lookupCall, result);
            interceptFilterBrowseLookupResult(lookupCall, result);
            cleanupResultList(result);
        }

        @Override
        public void provideSync(ILookupCall<VALUE> lookupCall, ILookupRowFetchedCallback<VALUE> callback) {
            callback.onSuccess(provide(lookupCall));
        }

        @Override
        public IFuture<Void> provideAsync(ILookupCall<VALUE> lookupCall, ILookupRowFetchedCallback<VALUE> callback, ClientRunContext clientRunContext) {
            return lookupCall.getDataByAllInBackground(clientRunContext, callback);
        }

        @SuppressWarnings("unchecked")
        @Override
        public List<ILookupRow<VALUE>> provide(ILookupCall<VALUE> lookupCall) {
            return (List<ILookupRow<VALUE>>) lookupCall.getDataByAll();
        }

        @Override
        public String toString() {
            ToStringBuilder sb = new ToStringBuilder(this).attr("All Lookup").attr("browseHint", browseHint).attr("activeState", activeState);
            return sb.toString();
        }
    };
}
Also used : ClientRunContext(org.eclipse.scout.rt.client.context.ClientRunContext) ILookupRow(org.eclipse.scout.rt.shared.services.lookup.ILookupRow) ILookupRowProvider(org.eclipse.scout.rt.client.ui.form.fields.smartfield.ILookupRowProvider) ILookupRowFetchedCallback(org.eclipse.scout.rt.shared.services.lookup.ILookupRowFetchedCallback) ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder) List(java.util.List) ArrayList(java.util.ArrayList) ILookupCall(org.eclipse.scout.rt.shared.services.lookup.ILookupCall)

Example 23 with ToStringBuilder

use of org.eclipse.scout.rt.platform.util.ToStringBuilder in project scout.rt by eclipse.

the class JobInput method toString.

@Override
public String toString() {
    final ToStringBuilder builder = new ToStringBuilder(this);
    builder.attr("name", m_name);
    builder.ref("executionSemaphore", m_executionSemaphore);
    builder.attr("expirationTime", m_expirationTime);
    builder.ref("exceptionHandler", m_exceptionHandler);
    builder.attr("swallowException", m_swallowException);
    builder.attr("threadName", m_threadName);
    builder.attr("executionTrigger", m_executionTrigger);
    builder.attr("runContext", m_runContext);
    builder.attr("executionHints", m_executionHints);
    return builder.toString();
}
Also used : ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder)

Example 24 with ToStringBuilder

use of org.eclipse.scout.rt.platform.util.ToStringBuilder in project scout.rt by eclipse.

the class UrlHints method toString.

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this);
    interceptToStringBuilder(builder);
    return builder.toString();
}
Also used : ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder)

Aggregations

ToStringBuilder (org.eclipse.scout.rt.platform.util.ToStringBuilder)24 ArrayList (java.util.ArrayList)8 List (java.util.List)8 ClientRunContext (org.eclipse.scout.rt.client.context.ClientRunContext)8 ILookupCall (org.eclipse.scout.rt.shared.services.lookup.ILookupCall)8 ILookupRow (org.eclipse.scout.rt.shared.services.lookup.ILookupRow)8 ILookupRowFetchedCallback (org.eclipse.scout.rt.shared.services.lookup.ILookupRowFetchedCallback)8 ILookupRowProvider (org.eclipse.scout.rt.client.ui.form.fields.smartfield.ILookupRowProvider)4 EventListenerList (org.eclipse.scout.rt.platform.util.EventListenerList)4