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.

VAudioPaintable.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.ui;
  5. import com.google.gwt.core.client.GWT;
  6. import com.google.gwt.dom.client.Style;
  7. import com.google.gwt.dom.client.Style.Unit;
  8. import com.google.gwt.user.client.ui.Widget;
  9. import com.vaadin.terminal.gwt.client.ApplicationConnection;
  10. import com.vaadin.terminal.gwt.client.BrowserInfo;
  11. import com.vaadin.terminal.gwt.client.UIDL;
  12. public class VAudioPaintable extends VMediaBasePaintable {
  13. @Override
  14. public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
  15. super.updateFromUIDL(uidl, client);
  16. if (!isRealUpdate(uidl)) {
  17. return;
  18. }
  19. Style style = getWidgetForPaintable().getElement().getStyle();
  20. // Make sure that the controls are not clipped if visible.
  21. if (shouldShowControls(uidl)
  22. && (style.getHeight() == null || "".equals(style.getHeight()))) {
  23. if (BrowserInfo.get().isChrome()) {
  24. style.setHeight(32, Unit.PX);
  25. } else {
  26. style.setHeight(25, Unit.PX);
  27. }
  28. }
  29. }
  30. @Override
  31. protected Widget createWidget() {
  32. return GWT.create(VAudio.class);
  33. }
  34. }