Search in sources :

Example 1 with LoadExceptionEvent

use of org.eclipse.che.ide.ui.smartTree.event.LoadExceptionEvent in project che by eclipse.

the class NodeLoader method onLoadFailure.

/**
     * Called when children haven't been successfully loaded.
     * Also fire {@link org.eclipse.che.ide.ui.smartTree.event.LoadExceptionEvent} event.
     *
     * @param parent
     *         parent node, children which haven't been loaded
     * @return instance of {@link org.eclipse.che.api.promises.client.Operation} which contains promise with error
     */
@NotNull
private Operation<PromiseError> onLoadFailure(@NotNull final Node parent) {
    return new Operation<PromiseError>() {

        @Override
        public void apply(PromiseError t) throws OperationException {
            childRequested.remove(parent);
            fireEvent(new LoadExceptionEvent(parent, t.getCause()));
        }
    };
}
Also used : PromiseError(org.eclipse.che.api.promises.client.PromiseError) Operation(org.eclipse.che.api.promises.client.Operation) LoadExceptionEvent(org.eclipse.che.ide.ui.smartTree.event.LoadExceptionEvent) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) NotNull(javax.validation.constraints.NotNull)

Aggregations

Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)1 NotNull (javax.validation.constraints.NotNull)1 Operation (org.eclipse.che.api.promises.client.Operation)1 PromiseError (org.eclipse.che.api.promises.client.PromiseError)1 LoadExceptionEvent (org.eclipse.che.ide.ui.smartTree.event.LoadExceptionEvent)1