/** * A helper method for creating unique IDs for elements within dynamically- * generated HTML. This is important because no two elements in a document * should have the same id. * * @return a new unique identifier */ public static String createUniqueId() { return Document.get().createUniqueId(); }
/** * Generates a unique DOM id. The id is of the form "gwt-id-<unique integer>". * * @return a unique DOM id */ public static String createUniqueId() { return Document.get().createUniqueId(); }
/** * Enables column-specific event handling for the specified element. If a * column is sortable, then clicking on the element or a child of the element * will trigger a sort event. * * @param builder the builder to associate with the column. The builder should * be a child element of a row returned by {@link #startRow} and must * be in a state where an attribute can be added. * @param column the column to associate */ protected final void enableColumnHandlers(ElementBuilderBase<?> builder, Column<T, ?> column) { String columnId = "column-" + Document.get().createUniqueId(); idToColumnMap.put(columnId, column); builder.attribute(COLUMN_ATTRIBUTE, columnId); }
cellId = "cell-" + Document.get().createUniqueId(); idToCellMap.put(cellId, column); cellToIdMap.put(column, cellId);
/** * Renders a given Header into a given ElementBuilderBase. This method ensures * that the CellTable widget will handle events events originating in the * Header. * * @param <H> the data type of the header * @param out the {@link ElementBuilderBase} to render into. The builder * should be a child element of a row returned by {@link #startRow} * and must be in a state that allows both attributes and elements to * be added * @param context the {@link Context} of the header being rendered * @param header the {@link Header} to render */ protected final <H> void renderHeader(ElementBuilderBase<?> out, Context context, Header<H> header) { // Generate a unique ID for the header. String headerId = idToHeaderMap.getKey(header); if (headerId == null) { headerId = "header-" + Document.get().createUniqueId(); idToHeaderMap.put(headerId, header); } out.attribute(HEADER_ATTRIBUTE, headerId); // Render the cell into the builder. SafeHtmlBuilder sb = new SafeHtmlBuilder(); header.render(context, sb); out.html(sb.toSafeHtml()); }
/** * A helper method for creating unique IDs for elements within dynamically- * generated HTML. This is important because no two elements in a document * should have the same id. * * @return a new unique identifier */ public static String createUniqueId() { return Document.get().createUniqueId(); }
/** * A helper method for creating unique IDs for elements within dynamically- * generated HTML. This is important because no two elements in a document * should have the same id. * * @return a new unique identifier */ public static String createUniqueId() { return Document.get().createUniqueId(); }
/** * Assign an automatically generated id */ protected void setId() { withId(Document.get().createUniqueId()); }
/** * Ensures the given element has a non-empty id. * * @param element The element being examined. * @see Document#createUniqueId() */ private void ensureId(final Element element) { final String id = element.getId(); if (id == null || id.isEmpty()) { element.setId(Document.get().createUniqueId()); } }
/** * Ensures the given element has a non-empty id. * * @param element The element being examined. * @see Document#createUniqueId() */ private void ensureId(final Element element) { final String id = element.getId(); if (id == null || id.isEmpty()) { element.setId(Document.get().createUniqueId()); } }
@Override public void setDataTargetWidgets(final List<Widget> widgets) { final String styleName = Document.get().createUniqueId(); for (final Widget widget : widgets) { widget.addStyleName(styleName); } this.setDataTarget("." + styleName); }
@Override public void setDataTargetWidgets(final List<Widget> widgets) { final String styleName = Document.get().createUniqueId(); for (final Widget widget : widgets) { widget.addStyleName(styleName); } this.setDataTarget("." + styleName); }
/** * Setting ID on gwt UIObjects for selenium tests. * * @param obj * @param prefix */ public static void setId(UIObject obj, String prefix) { obj.getElement().setId(prefix + Document.get().createUniqueId()); } }
@Override public void init(MultiplePermissionNodeViewer presenter) { this.presenter = presenter; String collapseId = Document.get().createUniqueId(); collapsePanel.setId(collapseId); nodeAnchor.setDataToggle(Toggle.COLLAPSE); nodeAnchor.setDataTarget("#" + collapseId); }
/** * Creates an empty Navbar. */ public Navbar() { setStyleName(NavbarConstants.NAVBAR); navbarInner.add(container); super.add(navbarInner); setId(Document.get().createUniqueId()); }
@UiConstructor public DataSetDefPreviewTableView() { initWidget(Binder.BINDER.createAndBindUi(this)); // Set id for selenium tests mainPanel.getElement() .setId("ds-preview-editor-" + Document.get().createUniqueId()); }
private void setDetails(ProcessInstanceLogSummary model) { if (model.getWorkItemId() == null) { detailsPanelDiv.setHidden(true); } else { String panelId = Document.get().createUniqueId(); detailsLink.setAttribute("href", "#" + panelId); detailsInfoDiv.setId(panelId); detailsPanelDiv.setHidden(false); } }
JQMRadio() { Element element = input.getElement(); element.setId(Document.get().createUniqueId()); element.setAttribute("type", "radio"); setElement(element); setLabel(new FormLabel()); }
@Override public void init(MultiplePermissionNodeEditor presenter) { this.presenter = presenter; String collapseId = Document.get().createUniqueId(); collapsePanel.setId(collapseId); nodeAnchor.setHref("#" + collapseId); addChildAnchor.setTextContent(" " + SecurityManagementConstants.INSTANCE.addChildException()); clearChildrenAnchor.setTextContent(" " + SecurityManagementConstants.INSTANCE.clearChildren()); }
public JQMListDivider() { super(Document.get().createLIElement()); getElement().setAttribute(ATTR_NAME, ATTR_VALUE); getElement().setId(Document.get().createUniqueId()); }