use of com.vaadin.flow.shared.ui.LoadMode in project flow by vaadin.
the class MessageHandler method handleDependencies.
private void handleDependencies(JsonObject inputJson) {
Console.log("Handling dependencies");
JsMap<LoadMode, JsonArray> dependencies = JsCollections.map();
for (LoadMode loadMode : LoadMode.values()) {
if (inputJson.hasKey(loadMode.name())) {
dependencies.set(loadMode, inputJson.getArray(loadMode.name()));
}
}
if (!dependencies.isEmpty()) {
registry.getDependencyLoader().loadDependencies(dependencies);
}
}
use of com.vaadin.flow.shared.ui.LoadMode in project flow by vaadin.
the class DependencyList method handleDuplicateDependency.
private void handleDuplicateDependency(Dependency newDependency, Dependency currentDependency) {
if (newDependency.getLoadMode() != currentDependency.getLoadMode()) {
final LoadMode moreEagerLoadMode = LoadMode.values()[Math.min(newDependency.getLoadMode().ordinal(), currentDependency.getLoadMode().ordinal())];
getLogger().warn("Dependency with url {} was imported with two different loading strategies: {} and {}. The dependency will be loaded as {}.", newDependency.getUrl(), newDependency.getLoadMode(), currentDependency.getLoadMode(), moreEagerLoadMode);
urlToLoadedDependency.replace(newDependency.getUrl(), new Dependency(newDependency.getType(), newDependency.getUrl(), moreEagerLoadMode));
}
}
Aggregations