use of com.vaadin.server.Extension in project cuba by cuba-platform.
the class AppUI method getTimers.
public List<CubaTimer> getTimers() {
AbstractComponent timersHolder = getTopLevelWindowComposition();
List<CubaTimer> timers = new ArrayList<>();
for (Extension extension : timersHolder.getExtensions()) {
if (extension instanceof CubaTimer) {
timers.add((CubaTimer) extension);
}
}
return timers;
}
use of com.vaadin.server.Extension in project cuba by cuba-platform.
the class CubaImageObjectFitPolyfillExtension method get.
public static CubaImageObjectFitPolyfillExtension get(UI ui) {
CubaImageObjectFitPolyfillExtension extension = null;
// Search singleton extension
for (Extension uiExtension : ui.getExtensions()) {
if (uiExtension instanceof CubaImageObjectFitPolyfillExtension) {
extension = (CubaImageObjectFitPolyfillExtension) uiExtension;
break;
}
}
// Create new extension if not found
if (extension == null) {
extension = new CubaImageObjectFitPolyfillExtension();
extension.extend(ui);
}
return extension;
}
use of com.vaadin.server.Extension in project cuba by cuba-platform.
the class ComponentGridDecorator method refresh.
/**
* Refreshes the grid preserving its current cell focus.
*
* @return the decorator for method chaining
*/
public ComponentGridDecorator<T> refresh() {
focusPreserveExtension.saveFocus();
// https://github.com/viritin/viritin/blob/viritin-1.44/src/main/java/org/vaadin/viritin/grid/MGrid.java#L218
for (Extension extension : grid.getExtensions()) {
if (extension instanceof RpcDataProviderExtension) {
((RpcDataProviderExtension) extension).refreshCache();
break;
}
}
focusPreserveExtension.restoreFocus();
return this;
}
use of com.vaadin.server.Extension in project charts by vaadin.
the class ChartOptions method get.
/**
* Returns a ChartOptions extension for the given UI. If a ChartOptions
* extension has not yet been added, a new one is created and added.
*
* @param ui
* the UI for which the ChartOptions should be returned
* @return the ChartOptions instance connected to the given UI
*/
public static ChartOptions get(UI ui) {
ChartOptions optioner = null;
// Search singleton optioner
for (Extension extension : ui.getExtensions()) {
if (extension instanceof ChartOptions) {
optioner = (ChartOptions) extension;
break;
}
}
// Create new optioner if not found
if (optioner == null) {
optioner = new ChartOptions();
optioner.extendConnector(ui);
}
return optioner;
}
use of com.vaadin.server.Extension in project v-leaflet by mstahv.
the class LMap method getLayersControl.
public LLayers getLayersControl() {
for (Extension e : getExtensions()) {
if (e instanceof LLayers) {
return (LLayers) e;
}
}
LLayers lLayers = new LLayers();
addExtension(lLayers);
return lLayers;
}
Aggregations