com.google.gwt.dom.client.Element.getInnerText()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(333)

本文整理了Java中com.google.gwt.dom.client.Element.getInnerText()方法的一些代码示例,展示了Element.getInnerText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getInnerText()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getInnerText

Element.getInnerText介绍

[英]The text between the start and end tags of the object.
[中]对象的开始标记和结束标记之间的文本。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public String getText() {
  3. return contentElem.getInnerText();
  4. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public final String getText() {
  2. return labelTD.getInnerText();
  3. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets the text contained within an element. If the element has child
  3. * elements, only the text between them will be retrieved.
  4. *
  5. * @param elem the element whose inner text is to be retrieved
  6. * @return the text inside this element
  7. * @deprecated Use {@link Element#getInnerText()} instead.
  8. */
  9. @Deprecated
  10. public static String getInnerText(Element elem) {
  11. return elem.getInnerText();
  12. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets the face's contents as text.
  3. *
  4. * @return face's contents as text
  5. *
  6. */
  7. @Override
  8. public String getText() {
  9. return getFace().getInnerText();
  10. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. @Override
  2. public final String getText() {
  3. return beforeInitPlaceholder == null ? getTextImpl() : beforeInitPlaceholder.getInnerText();
  4. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Get the inner text or html of the element, taking the inner span wrap into consideration, if
  3. * needed. Prefer using {@link #getText} or {@link #getHtml} instead of this method.
  4. *
  5. * @param isHtml true to get the inner html, false to get the inner text
  6. * @return the text or html
  7. */
  8. public String getTextOrHtml(boolean isHtml) {
  9. Element elem = isSpanWrapped ? element.getFirstChildElement() : element;
  10. return isHtml ? elem.getInnerHTML() : elem.getInnerText();
  11. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Gets the text within the specified cell.
  3. *
  4. * @param row the cell's row
  5. * @param column the cell's column
  6. * @return the cell's text contents
  7. * @throws IndexOutOfBoundsException
  8. */
  9. public String getText(int row, int column) {
  10. checkCellBounds(row, column);
  11. Element e = cellFormatter.getElement(row, column);
  12. return e.getInnerText();
  13. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Creates a ValueLabel widget that wraps an existing <span> element.
  3. * <p>
  4. * The ValueLabel's value will be initialized with the element's content,
  5. * passed through the <code>parser</code>.
  6. * <p>
  7. * This element must already be attached to the document. If the element is
  8. * removed from the document, you must call
  9. * {@link RootPanel#detachNow(Widget)}.
  10. *
  11. * @param element the element to be wrapped
  12. * @param renderer the renderer used to render values into the element
  13. * @param parser the parser used to initialize the ValueLabel's value from the
  14. * element's content
  15. */
  16. public static <T> ValueLabel<T> wrap(Element element,
  17. Renderer<? super T> renderer, Parser<? extends T> parser)
  18. throws ParseException {
  19. ValueLabel<T> label = wrap(element, renderer);
  20. label.setValue(parser.parse(element.getInnerText()));
  21. // Mark it attached and remember it for cleanup.
  22. label.onAttach();
  23. RootPanel.detachOnWindowClose(label);
  24. return label;
  25. }

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

  1. /**
  2. * Returns the value of the "main" text element
  3. */
  4. @Override
  5. public String getText() {
  6. return headerElem != null ? headerElem.getInnerText() : null;
  7. }

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone

  1. /**
  2. * Returns the value of the "main" text element
  3. */
  4. @Override
  5. public String getText() {
  6. return headerElem != null ? headerElem.getInnerText() : null;
  7. }

代码示例来源:origin: jqm4gwt/jqm4gwt

  1. /**
  2. * Returns the value of the count bubble or null if no count has been set
  3. */
  4. public Integer getCount() {
  5. if (countElem == null) return null;
  6. return Integer.parseInt(countElem.getInnerText());
  7. }

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

  1. /**
  2. * Returns the value of the count bubble or null if no count has been set
  3. */
  4. public Integer getCount() {
  5. if (countElem == null) return null;
  6. return Integer.parseInt(countElem.getInnerText());
  7. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Gets the face's contents as text.
  3. *
  4. * @return face's contents as text
  5. *
  6. */
  7. @Override
  8. public String getText() {
  9. return getFace().getInnerText();
  10. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Gets the face's contents as text.
  3. *
  4. * @return face's contents as text
  5. *
  6. */
  7. @Override
  8. public String getText() {
  9. return getFace().getInnerText();
  10. }

代码示例来源:origin: geogebra/geogebra

  1. /**
  2. * Gets the face's contents as text.
  3. *
  4. * @return face's contents as text
  5. *
  6. */
  7. @Override
  8. public String getText() {
  9. return getFace().getInnerText();
  10. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. public void addElement(Element element) {
  2. sb.append("<").append(element.getTagName());
  3. // TODO : append attributes
  4. sb.append(">").append(element.getInnerText()).append("</").append(element.getTagName()).append(
  5. ">");
  6. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. public Label create(Element e) {
  2. Label label = new Label();
  3. label.setText(e.getInnerText());
  4. WidgetsUtils.replaceOrAppend(e, label);
  5. return label;
  6. }
  7. }

代码示例来源:origin: net.sf.gwt-widget/gwt-sl

  1. private Message decodeMessage(Element e) {
  2. Message message = new Message();
  3. String content = e.getInnerText();
  4. String[] parts = content.split(",");
  5. message.setContent(URL.decodeQueryString(parts[0]));
  6. for (int i = 1; i < parts.length; i++) {
  7. String[] keyValuePair = parts[i].split("=");
  8. message.getAttributes().put(URL.decodeQueryString(keyValuePair[0]), URL.decodeQueryString(keyValuePair[1]));
  9. }
  10. message.setSerialNumber(Integer.parseInt(e.getAttribute("id")));
  11. return message;
  12. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. public T create(Element e) {
  2. T textBox = createWidget();
  3. if (getEquivalentTagName().equalsIgnoreCase(e.getTagName())) {
  4. copyAttributes((InputElement) e.cast(),
  5. (InputElement) textBox.getElement().cast());
  6. } else {
  7. textBox.setValue(e.getInnerText());
  8. }
  9. WidgetsUtils.replaceOrAppend(e, textBox);
  10. return (T) textBox;
  11. }

代码示例来源:origin: oVirt/ovirt-engine

  1. void attachAlert(AlertPanel alertPanel) {
  2. // Add widget's DOM element straight into HTML body
  3. RootPanel.get().add(alertPanel);
  4. // Use tool tip in case the textual content overflows
  5. Element messageDivElement = alertPanel.getMessageAt(0).getElement();
  6. if (ElementUtils.detectHorizontalOverflow(messageDivElement)) {
  7. alertPanel.getAlertTooltip().setText(messageDivElement.getInnerText());
  8. alertPanel.getAlertTooltip().setPlacement(Placement.BOTTOM);
  9. }
  10. }

相关文章

Element类方法