List of usage examples for com.google.gwt.dom.client StyleElement setInnerSafeHtml
@Override
public void setInnerSafeHtml(SafeHtml html)
From source file:org.eclipse.hawkbit.ui.dd.client.criteria.ViewClientCriterion.java
License:Open Source License
/** * Styles a multi-row selection with the number of elements. * * @param drag/*from www. j a va 2 s . com*/ * the current drag event holding the context. */ void setMultiRowDragDecoration(final VDragEvent drag) { final Widget widget = drag.getTransferable().getDragSource().getWidget(); if (widget instanceof VScrollTable) { final VScrollTable table = (VScrollTable) widget; final int rowCount = table.selectedRowKeys.size(); Element dragCountElement = Document.get().getElementById(SP_DRAG_COUNT); if (rowCount > 1 && table.selectedRowKeys.contains(table.focusedRow.getKey())) { if (dragCountElement == null) { dragCountElement = Document.get().createStyleElement(); dragCountElement.setId(SP_DRAG_COUNT); final HeadElement head = HeadElement .as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0)); head.appendChild(dragCountElement); } final SafeHtml formattedCssStyle = getDraggableTemplate() .multiSelectionStyle(determineActiveTheme(drag), String.valueOf(rowCount)); final StyleElement dragCountStyleElement = StyleElement.as(dragCountElement); dragCountStyleElement.setInnerSafeHtml(formattedCssStyle); } else if (dragCountElement != null) { dragCountElement.removeFromParent(); } } }