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

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

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

Element.getString介绍

[英]Gets a string representation of this element (as outer HTML). We do not override #toString() because it is final in com.google.gwt.core.client.JavaScriptObject.
[中]获取此元素的字符串表示形式(作为外部HTML)。我们不重写#toString(),因为它在com中是最终的。谷歌。gwt。果心客户JavaScriptObject。

代码示例

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

  1. /**
  2. * Returns a stringized version of the element. This string is for debugging
  3. * purposes and will NOT be consistent on different browsers.
  4. *
  5. * @param elem the element to stringize
  6. * @return a string form of the element
  7. * @deprecated Use {@link Element#getString()} instead.
  8. */
  9. @Deprecated
  10. public static String toString(Element elem) {
  11. return elem.getString();
  12. }

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

  1. /**
  2. * Returns a stringized version of the element. This string is for debugging
  3. * purposes and will NOT be consistent on different browsers.
  4. *
  5. * @param elem the element to stringize
  6. * @return a string form of the element
  7. * @deprecated Use {@link Element#getString()} instead.
  8. */
  9. @Deprecated
  10. public static String toString(Element elem) {
  11. return elem.getString();
  12. }

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

  1. /**
  2. * Returns a stringized version of the element. This string is for debugging
  3. * purposes and will NOT be consistent on different browsers.
  4. *
  5. * @param elem the element to stringize
  6. * @return a string form of the element
  7. * @deprecated Use {@link Element#getString()} instead.
  8. */
  9. @Deprecated
  10. public static String toString(Element elem) {
  11. return elem.getString();
  12. }

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

  1. /**
  2. * Produces a string representation of the matched elements.
  3. */
  4. public String toString(boolean pretty) {
  5. String r = "";
  6. for (Element e : elements) {
  7. if (window.equals(e)) {
  8. continue;
  9. }
  10. String elStr;
  11. try {
  12. elStr = JsUtils.isXML(e) ? JsUtils.XML2String(e) : e.getString();
  13. } catch (Exception e2) {
  14. elStr =
  15. "< " + (e == null ? "null" : e.getNodeName())
  16. + "(gquery, error getting the element string representation: " + e2.getMessage()
  17. + ")/>";
  18. }
  19. r += (pretty && r.length() > 0 ? "\n " : "") + elStr;
  20. }
  21. return r;
  22. }

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-java-ext-lang-client

  1. @Override
  2. public void render(Context context, PackageFragmentRoot value, SafeHtmlBuilder sb) {
  3. sb.appendHtmlConstant(resources.sourceFolder().getSvg().getElement().getString())
  4. .appendEscaped(" ");
  5. sb.appendEscaped(value.getUri().substring(project.getUri().length()));
  6. }
  7. },

代码示例来源:origin: fr.lteconsulting/hexa.core

  1. void updateInnerHTML()
  2. {
  3. String html = callback.getGhostInnerHTML( cookie, source );
  4. if( html == null )
  5. getElement().setInnerHTML( source.getString() );
  6. else
  7. getElement().setInnerHTML( html );
  8. }

代码示例来源:origin: ltearno/hexa.tools

  1. void updateInnerHTML()
  2. {
  3. String html = callback.getGhostInnerHTML( cookie, source );
  4. if( html == null )
  5. getElement().setInnerHTML( source.getString() );
  6. else
  7. getElement().setInnerHTML( html );
  8. }

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-java-ext-lang-client

  1. @Override
  2. public void render(Context context, PackageFragment value, SafeHtmlBuilder sb) {
  3. sb.appendHtmlConstant(resources.packageItem().getSvg().getElement().getString())
  4. .appendEscaped(" ");
  5. if (value.getName().isEmpty()) {
  6. sb.appendEscaped("(default package)");
  7. } else {
  8. sb.appendEscaped(value.getName());
  9. }
  10. }
  11. },

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-java-ext-lang-client

  1. @Override
  2. public void render(Context context, JavaProjectStructure value, SafeHtmlBuilder sb) {
  3. sb.appendHtmlConstant(resources.javaCategoryIcon().getSvg().getElement().getString())
  4. .appendEscaped(" ");
  5. sb.appendEscaped(value.getName());
  6. }
  7. },

代码示例来源:origin: org.kuali.student.core/ks-common-ui

  1. /**
  2. * Shows the uiObject content in a printable form in a new window
  3. * @param uiObject
  4. */
  5. public static void print(UIObject uiObject){
  6. String headTag = "";
  7. String styleTags = "";
  8. NodeList<com.google.gwt.dom.client.Element> head = Document.get().getElementsByTagName("head");
  9. if(head.getItem(0) != null){
  10. com.google.gwt.dom.client.Element e = head.getItem(0);
  11. NodeList<com.google.gwt.dom.client.Element> styles = e.getElementsByTagName("style");
  12. for(int i = 0; i < styles.getLength(); i++){
  13. styleTags = styleTags + styles.getItem(i).getString();
  14. }
  15. }
  16. headTag = "<HEAD><TITLE>Print - " + Window.getTitle() + "</TITLE>" + styleTags + "</HEAD>";
  17. openPrintWindow(uiObject.getElement().getString(), headTag, num);
  18. num++;
  19. }

代码示例来源:origin: kiegroup/appformer

  1. @Override
  2. protected void render(Context context,
  3. SafeHtml data,
  4. SafeHtmlBuilder sb) {
  5. hideAllPopover();
  6. final String content = data.asString();
  7. if (Strings.isNullOrEmpty(content)) {
  8. return;
  9. }
  10. final Element div = DOM.createDiv();
  11. div.setId(DOM.createUniqueId());
  12. div.setInnerHTML(content);
  13. div.getStyle().setOverflow(Style.Overflow.HIDDEN);
  14. div.getStyle().setTextOverflow(Style.TextOverflow.ELLIPSIS);
  15. div.getStyle().setWhiteSpace(Style.WhiteSpace.NOWRAP);
  16. final String html = div.getString();
  17. sb.appendHtmlConstant(html);
  18. Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
  19. @Override
  20. public void execute() {
  21. initPopover(div.getId(),
  22. placement.name().toLowerCase());
  23. }
  24. });
  25. }

代码示例来源:origin: org.uberfire/uberfire-widgets-commons

  1. @Override
  2. protected void render(Context context,
  3. SafeHtml data,
  4. SafeHtmlBuilder sb) {
  5. hideAllPopover();
  6. final String content = data.asString();
  7. if (Strings.isNullOrEmpty(content)) {
  8. return;
  9. }
  10. final Element div = DOM.createDiv();
  11. div.setId(DOM.createUniqueId());
  12. div.setInnerHTML(content);
  13. div.getStyle().setOverflow(Style.Overflow.HIDDEN);
  14. div.getStyle().setTextOverflow(Style.TextOverflow.ELLIPSIS);
  15. div.getStyle().setWhiteSpace(Style.WhiteSpace.NOWRAP);
  16. final String html = div.getString();
  17. sb.appendHtmlConstant(html);
  18. Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
  19. @Override
  20. public void execute() {
  21. initPopover(div.getId(),
  22. placement.name().toLowerCase());
  23. }
  24. });
  25. }

相关文章

Element类方法