List of usage examples for com.google.gwt.dom.client Document createSpanElement
public SpanElement createSpanElement()
From source file:com.bfr.client.selection.RangeEndPoint.java
License:Apache License
public static RangeEndPoint findLocation(Element element, int absX, int absY) { // Convert to document-relative coordinates Document doc = element.getOwnerDocument(); int relX = absX - doc.getBodyOffsetLeft(); int offY = getTotalOffsetY(doc); int relY = absY + offY; if (spn == null) { spn = doc.createSpanElement(); spn.setInnerText("X"); }/*from w w w . j a va 2 s . co m*/ Element body = doc.getBody(); body.appendChild(spn); spn.getStyle().setPosition(Position.ABSOLUTE); spn.getStyle().setTop(relY, Unit.PX); spn.getStyle().setLeft(relX, Unit.PX); FindLocRes locRes = findLocation(doc, element, relX, relY); return (locRes == null) ? null : locRes.ep; }
From source file:com.bfr.client.selection.RangeEndPoint.java
License:Apache License
private static FindLocRes findLocation(Document doc, Text text, int relX, int relY) { FindLocRes res = null;/*from w w w. ja va 2 s . c om*/ String str = text.getData(); if ((str == null) || str.isEmpty()) { // Theoretically it could be in here still.. } else { // Insert 2 spans and do a binary search to find the single // character that fits Element span1 = doc.createSpanElement(); Element span2 = doc.createSpanElement(); Element span3 = doc.createSpanElement(); Element span4 = doc.createSpanElement(); Element parent = text.getParentElement(); parent.insertBefore(span1, text); parent.insertBefore(span2, text); parent.insertBefore(span3, text); parent.insertBefore(span4, text); parent.removeChild(text); try { int len = str.length() / 2; span2.setInnerText(str.substring(0, len)); span3.setInnerText(str.substring(len)); res = findLocation(text, span1, span2, span3, span4, relX, relY); } catch (Exception ex) { } finally { parent.insertAfter(text, span4); parent.removeChild(span1); parent.removeChild(span2); parent.removeChild(span3); parent.removeChild(span4); } } return res; }
From source file:com.google.speedtracer.client.SourceViewer.java
License:Apache License
protected SourceViewer(Element myElement, Element headerElem, IFrameElement sourceFrame, Resources resources) { this.element = myElement; this.sourceFrame = sourceFrame; this.styles = resources.sourceViewerCodeCss(); this.element.setClassName(resources.sourceViewerCss().base()); // Create the title element and the close link. Document document = myElement.getOwnerDocument(); this.titleElement = document.createDivElement(); titleElement.setClassName(resources.sourceViewerCss().titleText()); AnchorElement closeLink = document.createAnchorElement(); closeLink.setClassName(resources.sourceViewerCss().closeLink()); closeLink.setHref("javascript:;"); closeLink.setInnerText("Close"); headerElem.appendChild(titleElement); headerElem.appendChild(closeLink);/*from w w w. ja v a 2 s . co m*/ this.columnMarker = document.createSpanElement(); // TODO(jaimeyap): I guess this listener is going to leak. ClickEvent.addClickListener(closeLink, closeLink, new ClickListener() { public void onClick(ClickEvent event) { hide(); } }); injectStyles(sourceFrame, this.styles.getText()); }
From source file:com.google.speedtracer.client.visualizations.view.SluggishnessEventFilterPanel.java
License:Apache License
private void buildFilterPanel(Container parent, SluggishnessModel model) { Div row1 = new Div(parent); Container row1Container = new DefaultContainerImpl(row1.getElement()); Document doc = parent.getDocument(); // Min Duration: ________ Element minLabel = doc.createSpanElement(); row1.getElement().appendChild(minLabel); minLabel.setInnerText("Minimum duration: "); minInput = new InputText(row1Container); minInput.setStyleName(css.filterPanelMinInput()); minInput.addKeyUpListener(new KeyUpListener() { public void onKeyUp(KeyUpEvent event) { int minValue = 0; boolean exceptionEncountered = false; try { minValue = Integer.valueOf(minInput.getText()); } catch (NumberFormatException ex) { // leave the filter alone exceptionEncountered = true; minInput.getElement().getStyle().setBackgroundColor("#ebb"); }/*w ww .j a v a 2s. c om*/ if (!exceptionEncountered && minValue >= 0) { eventFilter.setMinDuration(minValue); minInput.getElement().getStyle().setBackgroundColor("#fff"); eventTable.renderTable(); } } }); // Event Type ======== % Element eventTypeLabel = doc.createSpanElement(); row1.getElement().appendChild(eventTypeLabel); eventTypeLabel.getStyle().setPropertyPx("marginLeft", 10); eventTypeLabel.setInnerText("Event Type: "); createEventTypeSelect(row1Container, model); createEventTypePercentSelect(row1Container); // Always show events with: o logs o hintlets Element alwaysShowLabel = doc.createSpanElement(); alwaysShowLabel.setInnerText("Always show: "); alwaysShowLabel.getStyle().setPropertyPx("marginLeft", 10); row1.getElement().appendChild(alwaysShowLabel); final CheckBox logsCheckBox = new CheckBox(row1Container); logsCheckBox.setChecked(true); Element logsLabel = doc.createSpanElement(); logsLabel.setInnerText("Logs"); row1.getElement().appendChild(logsLabel); logsCheckBox.addClickListener(new ClickListener() { public void onClick(ClickEvent event) { eventFilter.setFilterUserLogs(!logsCheckBox.isChecked()); eventTable.renderTable(); } }); final CheckBox hintletsCheckBox = new CheckBox(row1Container); hintletsCheckBox.setChecked(true); Element hintletsLabel = doc.createSpanElement(); hintletsLabel.setInnerText("Hints"); row1.getElement().appendChild(hintletsLabel); hintletsCheckBox.addClickListener(new ClickListener() { public void onClick(ClickEvent event) { eventFilter.setFilterHints(!hintletsCheckBox.isChecked()); eventTable.renderTable(); } }); }
From source file:com.haulmont.cuba.web.widgets.client.addons.dragdroplayouts.ui.VDragCaptionProvider.java
License:Apache License
public Element getDragCaptionElement(Widget w) { ComponentConnector component = Util.findConnectorFor(w); DDLayoutState state = ((DragAndDropAwareState) root.getState()).getDragAndDropState(); DragCaptionInfo dci = state.dragCaptions.get(component); Document document = Document.get(); Element dragCaptionImage = document.createDivElement(); Element dragCaption = document.createSpanElement(); String dragCaptionText = dci.caption; if (dragCaptionText != null) { if (dci.contentMode == ContentMode.TEXT) { dragCaption.setInnerText(dragCaptionText); } else if (dci.contentMode == ContentMode.HTML) { dragCaption.setInnerHTML(dragCaptionText); } else if (dci.contentMode == ContentMode.PREFORMATTED) { PreElement preElement = document.createPreElement(); preElement.setInnerText(dragCaptionText); dragCaption.appendChild(preElement); }//from ww w .j a v a2s . com } String dragIconKey = state.dragCaptions.get(component).iconKey; if (dragIconKey != null) { String resourceUrl = root.getResourceUrl(dragIconKey); Icon icon = component.getConnection().getIcon(resourceUrl); dragCaptionImage.appendChild(icon.getElement()); } dragCaptionImage.appendChild(dragCaption); return dragCaptionImage; }
From source file:com.pronoiahealth.olhie.client.widgets.booklist3d.BookLIWidget.java
License:Open Source License
/** * Constructor//from ww w . j a va2 s . c om * */ public BookLIWidget() { // Create the tocWidget tocWidget = new TOCDivWidget(); // Create the root Document doc = Document.get(); root = doc.createLIElement(); setElement(root); // Book id div bkBook = createDivWithClassStyle(doc, "bk-book book-1 bk-bookdefault", null); root.appendChild(bkBook); // Book front DivElement bookFront = createDivWithClassStyle(doc, "bk-front", null); bkBook.appendChild(bookFront); // Front Cover bookFrontCover = createDivWithClassStyle(doc, "bk-cover", null); bookFront.appendChild(bookFrontCover); // MyCollection Indicator DivElement cd1 = createDivWithClassStyle(doc, null, "float: right; margin: 10px;"); bookFrontCover.appendChild(cd1); DivElement cd2 = createDivWithClassStyle(doc, null, null); cd1.appendChild(cd2); myCollectionBtnIndicator = doc.createAnchorElement(); cd2.appendChild(myCollectionBtnIndicator); myCollectionBtnIndicatorIcon = doc.createElement("i"); myCollectionBtnIndicator.appendChild(myCollectionBtnIndicatorIcon); // BK Cover Back bkCoverBack = this.createDivWithClassStyle(doc, "bk-cover-back", "background-color: #FFFF00;"); bookFront.appendChild(bkCoverBack); // Book Page bkPage = createDivWithClassStyle(doc, "bk-page", null); bkBook.appendChild(bkPage); // Book Back bkBack = this.createDivWithClassStyle(doc, "bk-back", null); bkBook.appendChild(bkBack); bookDescription = doc.createPElement(); bkBack.appendChild(bookDescription); // Book Right DivElement bkRight = createDivWithClassStyle(doc, "bk-right", null); bkBook.appendChild(bkRight); // Left bkLeft = createDivWithClassStyle(doc, "bk-left", "background-color: #FFFF00;"); bkBook.appendChild(bkLeft); bookBinding = doc.createHElement(2); bkLeft.appendChild(bookBinding); bookBindingAuthor = doc.createSpanElement(); bookBinding.appendChild(bookBindingAuthor); bookBindingTitle = doc.createSpanElement(); bookBinding.appendChild(bookBindingTitle); // Book top and botton bkBook.appendChild(createDivWithClassStyle(doc, "bk-top", null)); bkBook.appendChild(createDivWithClassStyle(doc, "bk-bottom", null)); // Book info DivElement bkInfo = createDivWithClassStyle(doc, "bk-info", null); root.appendChild(bkInfo); // Back button ButtonElement bkBookback = doc.createButtonElement(); bkBookback.setClassName("bk-bookback"); bkInfo.appendChild(bkBookback); // Front button ButtonElement bkBookview = doc.createButtonElement(); bkBookview.setClassName("bk-bookview"); bkInfo.appendChild(bkBookview); // Rating DivElement rh = createDivWithClassStyle(doc, null, "margin-top: 15px;"); bkInfo.appendChild(rh); DivElement rh1 = createDivWithClassStyle(doc, null, "float: left; padding-right: 10px;"); rh.appendChild(rh1); Element rh11 = doc.createElement("b"); rh1.appendChild(rh11); rh11.setInnerText("Rating:"); // Holder for rating ratingHolder = doc.createDivElement(); rh.appendChild(ratingHolder); // Book hours DivElement bh = createDivWithClassStyle(doc, null, "margin-top: 15px;"); bkInfo.appendChild(bh); DivElement bh1 = createDivWithClassStyle(doc, null, "float: left; padding-right: 10px;"); bh.appendChild(bh1); Element bh11 = doc.createElement("b"); bh1.appendChild(bh11); bh11.setInnerText("Book Hours:"); // Holder for hours bookHoursHolder = doc.createDivElement(); bh.appendChild(bookHoursHolder); }
From source file:com.smartgwt.mobile.client.widgets.tableview.TableView.java
License:Open Source License
/** * Renders the records in <code>recordsToShow</code> on screen. * * @see #getShowRecordComponents()//from w w w . j a v a2s . c o m */ public void loadRecords(List<Record> recordsToShow) { destroyRecordComponents(); final boolean hadShowDeletableRecordsClassName, hadShowMoveableRecordsClassName; if (_ul != null) { hadShowDeletableRecordsClassName = ElementUtil.hasClassName(_ul, _CSS.tableViewShowDeleteDisclosuresClass()); hadShowMoveableRecordsClassName = ElementUtil.hasClassName(_ul, _CSS.tableViewShowMoveIndicatorsClass()); if (_ul.hasParentElement()) { _ul.removeFromParent(); } } else { hadShowDeletableRecordsClassName = false; hadShowMoveableRecordsClassName = false; } final Document document = Document.get(); _ul = document.createULElement(); _ul.addClassName(COMPONENT_CLASS_NAME); if (parentNavStack != null) { _ul.addClassName(_CSS.tableViewHasParentNavStackClass()); } if (hadShowDeletableRecordsClassName) { _ul.addClassName(_CSS.tableViewShowDeleteDisclosuresClass()); } if (hadShowMoveableRecordsClassName) { _ul.addClassName(_CSS.tableViewShowMoveIndicatorsClass()); } if (this.tableMode == TableMode.GROUPED) { _ul.addClassName(_CSS.groupedTableViewClass()); } if (recordsToShow == null) recordsToShow = Collections.emptyList(); for (int i = 0; i < recordsToShow.size(); ++i) { final Record record = recordsToShow.get(i); if (record == null) throw new NullPointerException("The Record at index " + i + " is null."); record.setAttribute(recordIndexProperty, Integer.valueOf(i)); } ListGridField groupByField = null; GroupNode[] sortedGroupNodes = null; // Handle table grouping if (groupByFieldName != null) { final ListGridField[] fields = getFields(); if (fields != null) { for (ListGridField field : fields) { if (field != null && groupByFieldName.equals(field.getName())) { groupByField = field; break; } } } if (groupByField == null) { SC.logWarn("Could not find groupByField '" + groupByFieldName + "'"); } else if (groupByField.getGroupValueFunction() == null) { SC.logWarn("The groupByField '" + groupByFieldName + "' does not have a GroupByFunction."); } else { final GroupValueFunction groupByFunction = groupByField.getGroupValueFunction(); final Map<Object, GroupNode> groupNodes = new LinkedHashMap<Object, GroupNode>(); for (Record record : recordsToShow) { final Object groupValue = groupByFunction.getGroupValue( record.getAttributeAsObject(groupByFieldName), record, groupByField, groupByFieldName, this); GroupNode groupNode = groupNodes.get(groupValue); if (groupNode == null) { groupNode = new GroupNode(groupValue); groupNodes.put(groupValue, groupNode); } groupNode._add(record); } sortedGroupNodes = groupNodes.values().toArray(new GroupNode[groupNodes.size()]); Arrays.sort(sortedGroupNodes, GroupNode._COMPARATOR); } } elementMap = new HashMap<Object, Element>(); if (getShowRecordComponents()) recordComponents = new ArrayList<Canvas>(); if (recordsToShow.isEmpty()) { if (_getData() instanceof ResultSet && !((ResultSet) _getData()).lengthIsKnown()) { _ul.setInnerText(this.getLoadingMessage()); } else { if (emptyMessage != null) _ul.setInnerText(emptyMessage); } getElement().appendChild(_ul); } else { UListElement ul = _ul; LIElement lastLI; if (sortedGroupNodes == null) { lastLI = showGroup(recordsToShow, ul); } else { assert groupByField != null; assert sortedGroupNodes.length >= 1; final GroupTitleRenderer groupTitleRenderer = groupByField.getGroupTitleRenderer(); int i = 0; LIElement li; do { final GroupNode groupNode = sortedGroupNodes[i]; groupNode._setGroupTitle( groupTitleRenderer == null ? SafeHtmlUtils.htmlEscape(groupNode._getGroupValueString()) : groupTitleRenderer.getGroupTitle(groupNode.getGroupValue(), groupNode, groupByField, groupByFieldName, this)); li = document.createLIElement(); li.setAttribute(GROUP_VALUE_STRING_ATTRIBUTE_NAME, groupNode._getGroupValueString()); if (ul == null || _ul.equals(ul)) li.addClassName(_CSS.firstTableViewGroupClass()); final String groupTitle = groupNode.getGroupTitle(); if (groupTitle == null) { li.addClassName(_CSS.tableViewGroupWithoutGroupTitleClass()); } else { final DivElement labelDiv = document.createDivElement(); labelDiv.setClassName(Label.COMPONENT_CLASS_NAME); labelDiv.setInnerHTML(groupTitle); li.appendChild(labelDiv); } ul = document.createULElement(); ul.setClassName(COMPONENT_CLASS_NAME); ul.addClassName(TABLE_GROUP_CLASS_NAME); lastLI = showGroup(groupNode._getGroupMembersList(), ul); if (i != sortedGroupNodes.length - 1 && lastLI != null) { lastLI.addClassName(_CSS.lastTableViewRowClass()); } li.appendChild(ul); _ul.appendChild(li); } while (++i < sortedGroupNodes.length); assert li != null; li.addClassName(_CSS.lastTableViewGroupClass()); } if (_getData() instanceof ResultSet) { ResultSet rs = (ResultSet) _getData(); if (rs.getFetchMode() == FetchMode.PAGED && !rs.allRowsCached()) { LIElement li = document.createLIElement(); li.setClassName(ROW_CLASS_NAME); com.google.gwt.user.client.Element loadMoreRecordsElement = (com.google.gwt.user.client.Element) li .cast(); DOM.setEventListener(loadMoreRecordsElement, this); SpanElement span = document.createSpanElement(); span.addClassName(RECORD_TITLE_CLASS_NAME); span.setInnerText(SmartGwtMessages.INSTANCE.listGrid_loadMoreRecords()); span.setAttribute(IS_LOAD_MORE_RECORDS_ATTRIBUTE_NAME, "true"); li.setAttribute(IS_LOAD_MORE_RECORDS_ATTRIBUTE_NAME, "true"); li.appendChild(span); ul.appendChild(li); lastLI = li; } } if (lastLI != null) { lastLI.addClassName(_CSS.lastTableViewRowClass()); } getElement().appendChild(_ul); setSelecteds(); } if (isAttached()) { _fireContentChangedEvent(); // If this `TableView' is not currently attached, defer the firing of the content // changed event. } else { fireContentChangedOnLoad = true; } }
From source file:com.smartgwt.mobile.client.widgets.tableview.TableView.java
License:Open Source License
private LIElement showGroup(List<Record> recordsToShow, UListElement ul) { final Document document = Document.get(); final String primaryKeyField = getPrimaryKeyFieldName(), iconField = getIconField(), titleField = getTitleField(), infoField = getInfoField(), descriptionField = getDescriptionField(); LIElement lastLI = null;//w ww. java 2 s .c om for (final Record record : recordsToShow) { final Canvas recordComponent; if (getShowRecordComponents()) { recordComponent = createRecordComponent(record); if (recordComponent == null) { continue; } else recordComponents.add(recordComponent); } else recordComponent = null; final LIElement li = document.createLIElement(); li.addClassName(ROW_CLASS_NAME); com.google.gwt.user.client.Element element = li.cast(); final Object recordID = record.getAttributeAsObject(primaryKeyField); elementMap.put(recordID, element); final Integer recordIndex = record.getAttributeAsInt(recordIndexProperty); li.setAttribute(RECORD_INDEX_ATTRIBUTE_NAME, recordIndex.toString()); if (lastLI == null) { li.addClassName(_CSS.firstTableViewRowClass()); } if (showSelectedIcon && selectedIcon == null && getSelectionType() == SelectionStyle.MULTIPLE) { DivElement selectionDisclosure = document.createDivElement(); selectionDisclosure.setClassName(_CSS.recordSelectionDisclosureClass()); if (!_canSelectRecord(record)) { selectionDisclosure.addClassName(_CSS.nonselectableSelectionDisclosureClass()); } SpanElement span = document.createSpanElement(); selectionDisclosure.appendChild(span); li.appendChild(selectionDisclosure); } if (canRemoveRecords) { Boolean deletable = record.getAttributeAsBoolean(canRemoveProperty); if (deletable == null || (deletable != null && deletable.booleanValue())) { DivElement div = document.createDivElement(); div.addClassName(_CSS.recordDeleteDisclosureClass()); SpanElement span = document.createSpanElement(); div.appendChild(span); li.appendChild(div); if (markedForRemoval != null && markedForRemoval.contains(record)) { _markRecordRemoved(record, div, true); } } } if (canReorderRecords) { MoveIndicator draggableRow = new MoveIndicator(element); add(draggableRow, element); } if (!getShowRecordComponents()) { if (recordFormatter != null) { DivElement div = document.createDivElement(); div.setClassName("content"); div.setInnerHTML(recordFormatter.format(record)); li.appendChild(div); } else { if (getShowNavigation(record)) { final ImageResource navIcon = getNavigationIcon(record); if (navigationMode == NavigationMode.NAVICON_ONLY) { Boolean navigate = record.getAttributeAsBoolean(getRecordNavigationProperty()); if (navigate == null || (navigate != null && navigate.booleanValue())) { final DetailsRow detailsRow = new DetailsRow(navIcon); add(detailsRow, element); } } else if (navIcon != null) { final Image image = new Image(navIcon); image.getElement().addClassName(TableView._CSS.recordDetailDisclosureNavIconClass()); add(image, element); } else { li.addClassName(_CSS.tableViewRowHasNavigationDisclosureClass()); } } if (showIcons) { Object icon = record.get(iconField); if (!(icon instanceof ImageResource) && !(icon instanceof Image)) { icon = formatCellValue(record, recordIndex.intValue(), iconField); } if (icon != null) { SpanElement span = document.createSpanElement(); span.addClassName(RECORD_ICON_CLASS_NAME); li.appendChild(span); li.addClassName(_CSS.tableViewRowHasIconClass()); ImageElement img = document.createImageElement(); if (icon instanceof ImageResource) { img.setSrc(((ImageResource) icon).getSafeUri().asString()); } else if (icon instanceof Image) { img.setSrc(((Image) icon).getUrl()); } else { img.setSrc(icon.toString()); } span.appendChild(img); } } if (showDetailCount) { String count = formatCellValue(record, recordIndex.intValue(), detailCountProperty); if (count != null) { SpanElement span = document.createSpanElement(); span.addClassName(RECORD_COUNTER_CLASS_NAME); span.setInnerHTML(count); li.appendChild(span); } } String title = formatCellValue(record, recordIndex.intValue(), titleField); if (title != null) { SpanElement span = document.createSpanElement(); final String baseStyle = getBaseStyle(record, recordIndex.intValue(), getFieldNum(titleField)); if (baseStyle != null) span.setClassName(baseStyle); span.addClassName(RECORD_TITLE_CLASS_NAME); span.setInnerHTML(title); li.appendChild(span); } if (recordLayout == RecordLayout.AUTOMATIC || recordLayout == RecordLayout.SUMMARY_FULL || recordLayout == RecordLayout.SUMMARY_INFO) { String info = formatCellValue(record, recordIndex.intValue(), infoField); if (info != null) { ul.addClassName(_CSS.stackedTableViewClass()); li.addClassName(_CSS.tableViewRowHasRecordInfoClass()); SpanElement span = document.createSpanElement(); final String baseStyle = getBaseStyle(record, recordIndex.intValue(), getFieldNum(infoField)); if (baseStyle != null) span.setClassName(baseStyle); span.addClassName(RECORD_INFO_CLASS_NAME); span.appendChild(document.createTextNode(info)); li.appendChild(span); } } if (recordLayout == RecordLayout.AUTOMATIC || recordLayout == RecordLayout.TITLE_DESCRIPTION || recordLayout == RecordLayout.SUMMARY_DATA || recordLayout == RecordLayout.SUMMARY_FULL || recordLayout == RecordLayout.SUMMARY_INFO) { String description = formatCellValue(record, recordIndex.intValue(), descriptionField); if (description != null) { SpanElement span = document.createSpanElement(); final String baseStyle = getBaseStyle(record, recordIndex.intValue(), getFieldNum(descriptionField)); if (baseStyle != null) span.setClassName(baseStyle); span.addClassName(RECORD_DESCRIPTION_CLASS_NAME); span.appendChild(document.createTextNode(description)); li.appendChild(span); } } } } else { assert recordComponent != null; recordComponent.getElement().addClassName(RECORD_COMPONENT_CLASS_NAME); add(recordComponent, element); } ul.appendChild(li); lastLI = li; } return lastLI; }
From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.decorator.AnnoteaDecoratorVisitor.java
License:Apache License
private SpanElement getSpanElement(Document document) { SpanElement spanElement = document.createSpanElement(); DOM.sinkEvents((Element) spanElement.cast(), Event.ONMOUSEOVER | Event.ONMOUSEOUT); DOM.setEventListener((Element) spanElement.cast(), AnnotationPopupEventListener.getAnnotationPopupEventListener(annotation, controller)); spanElement.setClassName(AnnotationConstant.IGNORED_ELEMENT + " " + controller.getDecorateClassName() + " " + AnnotationConstant.DECORATE_CLASS_NAME + annotation.getId()); return spanElement; }
From source file:org.nuxeo.ecm.platform.annotations.gwt.client.view.decorator.NuxeoDecoratorVisitor.java
License:Apache License
protected SpanElement getSpanElement(Document document) { SpanElement spanElement = document.createSpanElement(); DOM.sinkEvents((Element) spanElement.cast(), Event.ONMOUSEOVER | Event.ONMOUSEOUT); DOM.setEventListener((Element) spanElement.cast(), AnnotationPopupEventListener.getAnnotationPopupEventListener(annotation, controller)); return spanElement; }