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.

EmbeddedInSubWindow.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package com.vaadin.tests.components.window;
  2. import com.vaadin.server.ThemeResource;
  3. import com.vaadin.tests.components.TestBase;
  4. import com.vaadin.ui.Embedded;
  5. import com.vaadin.ui.VerticalLayout;
  6. import com.vaadin.ui.Window;
  7. public class EmbeddedInSubWindow extends TestBase {
  8. @Override
  9. protected String getDescription() {
  10. return "The sub window contains a large icon and should be sized according to the icon. The icon contains a blue border of 10px at the outer edges. The layout in the sub window has margins enabled.";
  11. }
  12. @Override
  13. protected Integer getTicketNumber() {
  14. return null;
  15. }
  16. @Override
  17. protected void setup() {
  18. setTheme("tests-tickets");
  19. VerticalLayout layout = new VerticalLayout();
  20. layout.setMargin(true);
  21. layout.setSizeUndefined();
  22. Window zoom = new Window("Image Preview", layout);
  23. zoom.setSizeUndefined();
  24. String res = "icons/EmbeddedInSubWindow-image.png";
  25. Embedded imagePreview = new Embedded(null, new ThemeResource(res));
  26. imagePreview.setSizeUndefined();
  27. layout.addComponent(imagePreview);
  28. zoom.setModal(true);
  29. zoom.setResizable(false);
  30. getMainWindow().addWindow(zoom);
  31. }
  32. }