You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VCodeLabel.java 734B

1234567891011121314151617181920212223242526272829
  1. package com.vaadin.demo.sampler.gwt.client.ui;
  2. import com.google.gwt.dom.client.Element;
  3. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  4. import com.vaadin.terminal.gwt.client.UIDL;
  5. import com.vaadin.terminal.gwt.client.ui.VLabel;
  6. public class VCodeLabel extends VLabel {
  7. public VCodeLabel() {
  8. super();
  9. }
  10. @Override
  11. public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
  12. super.updateFromUIDL(uidl, client);
  13. Element pre = getElement().getFirstChildElement();
  14. if (null != pre) {
  15. pre.setClassName("prettyprint");
  16. prettyPrint();
  17. }
  18. }
  19. private native void prettyPrint()
  20. /*-{
  21. $wnd.prettyPrint();
  22. }-*/;
  23. }