Example usage for com.vaadin.server AbstractClientConnector getExtensions

List of usage examples for com.vaadin.server AbstractClientConnector getExtensions

Introduction

In this page you can find the example usage for com.vaadin.server AbstractClientConnector getExtensions.

Prototype

@Override
    public Collection<Extension> getExtensions() 

Source Link

Usage

From source file:com.wcs.wcslib.vaadin.widget.jqinputmask.extension.JqInputMask.java

License:Apache License

private static JqInputMaskExtension findExtensionInstance(final AbstractClientConnector target) {
    Collection<Extension> extensions = target.getExtensions();
    for (Extension extension : extensions) {
        if (extension.getClass().isAssignableFrom(JqInputMaskExtension.class)) {
            return (JqInputMaskExtension) extension;
        }// w ww  .  j  a v a2  s  .c  om
    }
    return null;
}

From source file:org.vaadin.addon.ewopener.demo.HighlightJS.java

License:Apache License

public static HighlightJS of(AbstractClientConnector component) {
    return component.getExtensions().stream().filter(HighlightJS.class::isInstance).findFirst()
            .map(HighlightJS.class::cast).orElseGet(() -> new HighlightJS(component));
}