@Override public void setId(String id) { getRootOrThrow().setId(id); }
Component oldComponent = idToComponent.get(globalId); if (oldComponent != null && !oldComponent.equals(component)) { oldComponent.setId(null); idToComponent.remove(oldGID); component.setId(globalId); idToComponent.put(globalId, component); return oldComponent != null && !oldComponent.equals(component);
@Override public void setDebugId(String id) { component.setId(id); }
/** * Adds an unique id for component that is used in the client-side for * testing purposes. Keeping identifiers unique is the responsibility of the * programmer. * * @param id * An alphanumeric id * @return this (for method chaining) * @see #setId(java.lang.String) */ public default S withId(String id) { ((Component) this).setId(id); return (S) this; }
/** * You only need to override / implement this method if you are using TestBench, or another testing tool which looks for debug ids. If you do override it * to add your own subclass ids, make sure you call super */ protected void setIds() { getRootComponent().setId(ID.getId(Optional.empty(), this, getRootComponent())); }
@Override public void setId(String id) { this.id = id; AppUI ui = AppUI.getCurrent(); if (ui != null && ui.isPerformanceTestMode() && StringUtils.isEmpty(debugId)) { getComponent().setId(ui.getTestIdManager().getTestId("window_" + id)); } }
protected void assignDebugId(com.vaadin.ui.Component composition, String id) { AppUI ui = AppUI.getCurrent(); if (ui == null) { return; } String debugId = getDebugId(); if (ui.isPerformanceTestMode()) { if (composition != null && debugId != null) { TestIdManager testIdManager = ui.getTestIdManager(); composition.setId(testIdManager.getTestId(debugId + "_" + id)); } } }
@Override public void setDebugId(String id) { super.setDebugId(id); AppUI ui = AppUI.getCurrent(); if (ui != null && id != null) { for (final FieldConfig fc : fields.values()) { com.vaadin.ui.Component composition = WebComponentsHelper.getComposition(fc.getComponentNN()); if (composition != null) { composition.setId(ui.getTestIdManager().getTestId(id + "_" + fc.getId())); } } } }
c.setId(id);
@Override public void setDebugId(String id) { super.setDebugId(id); AppUI ui = AppUI.getCurrent(); if (ui != null && id != null) { for (final Component component : getOwnComponents()) { com.vaadin.ui.Component composition = WebComponentsHelper.getComposition(component); if (composition != null) { composition.setId(ui.getTestIdManager().getTestId(id + "_" + component.getId())); } } } }
/** * Creates the wrapper which contains the menu item and the adjacent label * for displaying the occurred events * * @param menuItemButton * the menu item * @param notificationLabel * the label for displaying the occurred events * @return Component of type CssLayout */ private static Component buildLabelWrapper(final ValoMenuItemButton menuItemButton, final Component notificationLabel) { final CssLayout dashboardWrapper = new CssLayout(menuItemButton); dashboardWrapper.addStyleName("labelwrapper"); dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM); notificationLabel.addStyleName(ValoTheme.MENU_BADGE); notificationLabel.setWidthUndefined(); notificationLabel.setVisible(false); notificationLabel.setId(UIComponentIdProvider.NOTIFICATION_MENU_ID + menuItemButton.getCaption().toLowerCase()); dashboardWrapper.addComponent(notificationLabel); return dashboardWrapper; }
/** * Creates the wrapper which contains the menu item and the adjacent label * for displaying the occurred events * * @param menuItemButton * the menu item * @param notificationLabel * the label for displaying the occurred events * @return Component of type CssLayout */ private static Component buildLabelWrapper(final ValoMenuItemButton menuItemButton, final Component notificationLabel) { final CssLayout dashboardWrapper = new CssLayout(menuItemButton); dashboardWrapper.addStyleName("labelwrapper"); dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM); notificationLabel.addStyleName(ValoTheme.MENU_BADGE); notificationLabel.setWidthUndefined(); notificationLabel.setVisible(false); notificationLabel.setId(UIComponentIdProvider.NOTIFICATION_MENU_ID + menuItemButton.getCaption().toLowerCase()); dashboardWrapper.addComponent(notificationLabel); return dashboardWrapper; }
SentStructureJsPanel(VisualizerInput visInput) { this.setHeight("100%"); this.setWidth("100%"); SentStructureJsComponent sentstructurejsComponent = new SentStructureJsComponent(visInput); VerticalLayout layout = new VerticalLayout(); layout.addComponent(sentstructurejsComponent); layout.getComponent(0).setId(sentstructurejsComponent.getContainerId()); this.setContent(layout); }
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())); } } }