Search in sources :

Example 6 with TestIdManager

use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.

the class WindowBreadCrumbs method componentAttachedToUI.

protected void componentAttachedToUI() {
    adjustParentStyles();
    if (ui.isTestMode()) {
        linksLayout.setCubaId("breadCrumbs");
        if (closeBtn != null) {
            closeBtn.setCubaId("closeBtn");
        }
    }
    if (ui.isPerformanceTestMode()) {
        TestIdManager testIdManager = ui.getTestIdManager();
        linksLayout.setId(testIdManager.getTestId("breadCrumbs"));
        if (closeBtn != null) {
            closeBtn.setId(testIdManager.getTestId("closeBtn"));
        }
    }
}
Also used : TestIdManager(com.haulmont.cuba.gui.sys.TestIdManager)

Example 7 with TestIdManager

use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.

the class WebFieldGroup method assignDebugId.

protected void assignDebugId(FieldConfig fc, com.vaadin.ui.Component composition) {
    AppUI ui = AppUI.getCurrent();
    if (ui == null) {
        return;
    }
    String debugId = getDebugId();
    if (ui.isTestMode()) {
        if (composition != null) {
            composition.setCubaId(fc.getId());
        }
    }
    if (ui.isPerformanceTestMode()) {
        if (composition != null && debugId != null) {
            TestIdManager testIdManager = ui.getTestIdManager();
            composition.setId(testIdManager.getTestId(debugId + "_" + fc.getId()));
        }
    }
}
Also used : TestIdManager(com.haulmont.cuba.gui.sys.TestIdManager) AppUI(com.haulmont.cuba.web.AppUI)

Example 8 with TestIdManager

use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.

the class WebAccordion method setDebugId.

@Override
public void setDebugId(String id) {
    super.setDebugId(id);
    String debugId = getDebugId();
    AppUI ui = AppUI.getCurrent();
    if (debugId != null && ui != null) {
        TestIdManager testIdManager = ui.getTestIdManager();
        for (Map.Entry<com.vaadin.ui.Component, ComponentDescriptor> tabEntry : tabMapping.entrySet()) {
            com.vaadin.ui.Component tabComponent = tabEntry.getKey();
            com.vaadin.ui.Accordion.Tab tab = component.getTab(tabComponent);
            ComponentDescriptor componentDescriptor = tabEntry.getValue();
            String name = componentDescriptor.name;
            component.setTestId(tab, testIdManager.getTestId(debugId + "." + name));
        }
    }
}
Also used : TestIdManager(com.haulmont.cuba.gui.sys.TestIdManager) CubaAccordion(com.haulmont.cuba.web.widgets.CubaAccordion) AbstractComponent(com.vaadin.ui.AbstractComponent) AppUI(com.haulmont.cuba.web.AppUI)

Example 9 with TestIdManager

use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.

the class WebDateField method setDebugId.

@Override
public void setDebugId(String id) {
    super.setDebugId(id);
    if (id != null) {
        TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
        timeField.setId(testIdManager.getTestId(id + "_time"));
        dateField.setId(testIdManager.getTestId(id + "_date"));
    }
}
Also used : TestIdManager(com.haulmont.cuba.gui.sys.TestIdManager)

Example 10 with TestIdManager

use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.

the class WebTabSheet method setDebugId.

@Override
public void setDebugId(String id) {
    super.setDebugId(id);
    String debugId = getDebugId();
    if (debugId != null) {
        TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
        for (Map.Entry<com.vaadin.ui.Component, ComponentDescriptor> tabEntry : tabMapping.entrySet()) {
            com.vaadin.ui.Component tabComponent = tabEntry.getKey();
            com.vaadin.ui.TabSheet.Tab tab = component.getTab(tabComponent);
            ComponentDescriptor componentDescriptor = tabEntry.getValue();
            String name = componentDescriptor.name;
            component.setTestId(tab, testIdManager.getTestId(debugId + "." + name));
        }
    }
}
Also used : TestIdManager(com.haulmont.cuba.gui.sys.TestIdManager) CubaTabSheet(com.haulmont.cuba.web.widgets.CubaTabSheet)

Aggregations

TestIdManager (com.haulmont.cuba.gui.sys.TestIdManager)13 AppUI (com.haulmont.cuba.web.AppUI)8 CubaButton (com.haulmont.cuba.web.widgets.CubaButton)5 Action (com.haulmont.cuba.gui.components.Action)1 CubaAccordion (com.haulmont.cuba.web.widgets.CubaAccordion)1 CubaPopupButton (com.haulmont.cuba.web.widgets.CubaPopupButton)1 CubaTabSheet (com.haulmont.cuba.web.widgets.CubaTabSheet)1 ShortcutAction (com.vaadin.event.ShortcutAction)1 AbstractComponent (com.vaadin.ui.AbstractComponent)1 Button (com.vaadin.ui.Button)1 StringUtils.defaultString (org.apache.commons.lang3.StringUtils.defaultString)1