@HtmlImport(value="frontend://webapi/network.html") @Tag(value="rap-network") public class Network extends JavascriptTemplate<Network.NetworkTemplateModel>
| Modifier and Type | Class and Description |
|---|---|
static interface |
Network.NetworkTemplateModel |
| Constructor and Description |
|---|
Network(com.vaadin.flow.component.HasElement parent) |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addNetworkInformationListener(com.vaadin.flow.function.SerializableConsumer<NetworkInformation> listener)
Add a listener that will be notified when the network information of the current device has
changed.
|
void |
clearWatch()
Clears the listeners registered with
addNetworkInformationListener(SerializableConsumer) and stops the
client from sending more network information change events. |
static void |
getNetworkInformation(Consumer<NetworkInformation> callback)
Gather network information from the device and send it to the server via the onInformationReceived
callback.
|
clearConsumers, notifyConsumers, registerConsumer, registerConsumer, unregisterAllConsumers, unregisterAllConsumersgetModel, getModelType, getModelType, getStateNode, initModel, isSupportedClassaddListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisiblepublic com.vaadin.flow.shared.Registration addNetworkInformationListener(com.vaadin.flow.function.SerializableConsumer<NetworkInformation> listener)
listener - The listener that is triggered everytime the network information changes.public static void getNetworkInformation(Consumer<NetworkInformation> callback)
callback - The callback that consumes the received network information.public void clearWatch()
addNetworkInformationListener(SerializableConsumer) and stops the
client from sending more network information change events.Copyright © 2020 XDEV Software Corp.. All rights reserved.