use of com.haulmont.cuba.web.AppUI in project cuba by cuba-platform.
the class CubaTreeTable method changeVariables.
@Override
protected boolean changeVariables(Map<String, Object> variables) {
boolean clientNeedsContentRefresh = super.changeVariables(variables);
if (variables.containsKey("resetsortorder")) {
resetSortOrder();
markAsDirty();
}
String profilerMarker = (String) variables.get("profilerMarker");
if (StringUtils.isNotEmpty(profilerMarker)) {
AppUI ui = AppUI.getCurrent();
ui.setProfilerMarker(profilerMarker);
}
return clientNeedsContentRefresh;
}
use of com.haulmont.cuba.web.AppUI in project cuba by cuba-platform.
the class WebAppMenu method assignTestIds.
protected void assignTestIds(MenuItem menuItem, String id) {
AppUI ui = (AppUI) component.getUI();
if (ui == null || !ui.isTestMode())
return;
MenuBar.MenuItem delegateItem = ((MenuItemImpl) menuItem).getDelegateItem();
component.setCubaId(delegateItem, id);
TestIdManager testIdManager = ui.getTestIdManager();
String testId = component.getId() + "_" + id;
component.setTestId(delegateItem, testIdManager.reserveId(testId));
}
use of com.haulmont.cuba.web.AppUI in project cuba by cuba-platform.
the class WebSideMenu method assignCubaId.
protected void assignCubaId(MenuItem menuItem) {
AppUI ui = (AppUI) component.getUI();
if (ui == null || !ui.isTestMode())
return;
assignCubaIdInternal(menuItem);
}
use of com.haulmont.cuba.web.AppUI in project cuba by cuba-platform.
the class CubaTreeTable method paintAdditionalData.
@Override
protected void paintAdditionalData(PaintTarget target) throws PaintException {
if (reqFirstRowToPaint == -1 && items instanceof AggregationContainer && isAggregatable() && !((AggregationContainer) items).getAggregationPropertyIds().isEmpty() && isShowTotalAggregation() && Table.AggregationStyle.TOP.equals(getAggregationStyle())) {
paintAggregationRow(target, ((AggregationContainer) items).aggregate(new Context(items.getItemIds())));
}
// paint cuba-ids
AppUI current = AppUI.getCurrent();
if (current != null && current.isTestMode()) {
ArrayList<String> visibleColOrder = new ArrayList<>();
for (Object columnId : visibleColumns) {
if (!isColumnCollapsed(columnId)) {
visibleColOrder.add(columnId.toString());
}
}
target.addAttribute("colcubaids", visibleColOrder.toArray());
}
}
use of com.haulmont.cuba.web.AppUI in project cuba by cuba-platform.
the class CubaFoldersPane method setupUpdateTimer.
protected void setupUpdateTimer() {
int period = webConfig.getAppFoldersRefreshPeriodSec() * 1000;
timer = new FoldersPaneTimer();
timer.setRepeating(true);
timer.setDelay(period);
timer.addActionListener(createAppFolderUpdater());
timer.start();
if (this.isAttached()) {
AppUI ui = AppUI.getCurrent();
stopExistingFoldersPaneTimer(ui);
ui.addTimer(timer);
} else if (frame != null) {
com.haulmont.cuba.gui.components.Window window = ComponentsHelper.getWindowImplementation(frame);
if (window == null) {
throw new IllegalStateException("Null window for CubaFoldersPane");
}
AbstractComponent topLevelFrame = window.unwrapComposition(AbstractComponent.class);
timer.extend(topLevelFrame);
}
}
Aggregations