本文整理了Java中com.vaadin.ui.UI.setPollInterval()
方法的一些代码示例,展示了UI.setPollInterval()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UI.setPollInterval()
方法的具体详情如下:
包路径:com.vaadin.ui.UI
类名称:UI
方法名:setPollInterval
[英]Sets the interval with which the UI should poll the server to see if there are any changes. Polling is disabled by default.
Note that it is possible to enable push and polling at the same time but it should not be done to avoid excessive server traffic.
Add-on developers should note that this method is only meant for the application developer. An add-on should not set the poll interval directly, rather instruct the user to set it.
[中]设置UI轮询服务器以查看是否有任何更改的间隔。默认情况下,轮询处于禁用状态。
请注意,可以同时启用推送和轮询,但不应这样做以避免过多的服务器流量。
附加组件开发人员应该注意,此方法仅适用于应用程序开发人员。附加组件不应直接设置轮询间隔,而应指示用户进行设置。
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
@Override
public void uploadFinished(FinishedEvent event) {
UI.getCurrent().setPollInterval(-1);
progressIndicatorCloseHandle.close();
}
});
代码示例来源:origin: info.magnolia.dam/magnolia-dam-app
@Override
public void uploadStarted(StartedEvent event) {
UI.getCurrent().setPollInterval(1000);
progressIndicator = new ProgressPopup(upload, i18n);
progressIndicatorCloseHandle = layer.openOverlay(new ViewAdapter(progressIndicator), ModalityLevel.NON_MODAL);
progressIndicator.progressIndicator.setProgress(0);
progressIndicator.progressIndicator.setVisible(true);
}
});
代码示例来源:origin: org.opennms.features.topology/netutils
pingService.cancel();
resultArea.setValue(resultArea.getValue() + "\n" + "Ping cancelled by user");
getUI().setPollInterval(initialPollInterval);
setRunning(false);
} );
final PingRequest pingRequest = pingForm.getPingRequest();
setRunning(true);
getUI().setPollInterval(POLL_INTERVAL);
resultArea.setValue(""); // Clear
pingService.ping(pingRequest, (result) -> {
resultArea.setValue(result.toDetailString());
if (result.isComplete()) {
getUI().setPollInterval(initialPollInterval);
getUI().setPollInterval(initialPollInterval);
});
代码示例来源:origin: OpenNMS/opennms
cancel(pingFuture);
resultArea.setValue(resultArea.getValue() + "\n" + "Ping cancelled by user");
getUI().setPollInterval(initialPollInterval);
setRunning(false);
} );
try {
resultArea.setValue(""); // Clear
getUI().setPollInterval(POLL_INTERVAL);
resultArea.setValue(PingStringUtils.renderAll(summary));
if (summary.isComplete()) {
getUI().setPollInterval(initialPollInterval);
UI.getCurrent().setPollInterval(initialPollInterval);
});
代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.netutils
cancel(pingFuture);
resultArea.setValue(resultArea.getValue() + "\n" + "Ping cancelled by user");
getUI().setPollInterval(initialPollInterval);
setRunning(false);
} );
try {
resultArea.setValue(""); // Clear
getUI().setPollInterval(POLL_INTERVAL);
resultArea.setValue(PingStringUtils.renderAll(summary));
if (summary.isComplete()) {
getUI().setPollInterval(initialPollInterval);
UI.getCurrent().setPollInterval(initialPollInterval);
});
内容来源于网络,如有侵权,请联系作者删除!