Search in sources :

Example 6 with Command

use of com.vaadin.flow.server.Command in project flow by vaadin.

the class ElementAttributeMap method deferRegistration.

private void deferRegistration(String attribute, AbstractStreamResource resource) {
    ensurePendingRegistrations();
    assert !pendingRegistrations.containsKey(attribute);
    Registration handle = getNode().addAttachListener(new Command() {

        @Override
        public void execute() {
            doSetResource(attribute, resource);
            registerResource(attribute, resource);
        }
    });
    pendingRegistrations.put(attribute, handle);
}
Also used : Command(com.vaadin.flow.server.Command) Registration(com.vaadin.flow.shared.Registration) StreamRegistration(com.vaadin.flow.server.StreamRegistration)

Aggregations

Command (com.vaadin.flow.server.Command)6 Registration (com.vaadin.flow.shared.Registration)3 StreamRegistration (com.vaadin.flow.server.StreamRegistration)2 Test (org.junit.Test)2 RouteRegistry (com.vaadin.flow.server.RouteRegistry)1 SessionRouteRegistry (com.vaadin.flow.server.SessionRouteRegistry)1 ApplicationRouteRegistry (com.vaadin.flow.server.startup.ApplicationRouteRegistry)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1