Search in sources :

Example 6 with ToStringBuilder

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

the class AbstractContentAssistField method newByTextLookupRowProvider.

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

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

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

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

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

        @SuppressWarnings("unchecked")
        @Override
        public List<ILookupRow<LOOKUP_KEY>> provide(ILookupCall<LOOKUP_KEY> lookupCall) {
            return (List<ILookupRow<LOOKUP_KEY>>) 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) ILookupRowFetchedCallback(org.eclipse.scout.rt.shared.services.lookup.ILookupRowFetchedCallback) ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder) EventListenerList(org.eclipse.scout.rt.platform.util.EventListenerList) List(java.util.List) ArrayList(java.util.ArrayList) ILookupCall(org.eclipse.scout.rt.shared.services.lookup.ILookupCall)

Example 7 with ToStringBuilder

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

the class JobEventData method toString.

@Override
public String toString() {
    final ToStringBuilder builder = new ToStringBuilder(this);
    builder.attr("future", m_future.get());
    builder.ref("state", m_state.get());
    builder.ref("executionHint", m_executionHint.get());
    builder.attr("blockingCondition", m_blockingCondition.get());
    return builder.toString();
}
Also used : ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder)

Example 8 with ToStringBuilder

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

the class ClientNotificationClusterNotification method toString.

@Override
public String toString() {
    ToStringBuilder tsb = new ToStringBuilder(this);
    tsb.attr("ClientNotificationMessage", m_cnMessages);
    return tsb.toString();
}
Also used : ToStringBuilder(org.eclipse.scout.rt.platform.util.ToStringBuilder)

Example 9 with ToStringBuilder

use of org.eclipse.scout.rt.platform.util.ToStringBuilder 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();
        }
    };
}
Also used : ILookupRow(org.eclipse.scout.rt.shared.services.lookup.ILookupRow) ClientRunContext(org.eclipse.scout.rt.client.context.ClientRunContext) 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 10 with ToStringBuilder

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

the class ClientNotificationMessage method toString.

@Override
public String toString() {
    final ToStringBuilder builder = new ToStringBuilder(this);
    builder.attr("address", getAddress());
    builder.attr("notification", getNotification());
    builder.attr("cid", getCorrelationId());
    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