Esempio n. 1
0
  @Override
  protected void setup(VaadinRequest request) {
    htmlWindow = new Window("", new Label("HTML caption"));
    htmlWindow.setId("htmlWindow");
    htmlWindow.setCaptionAsHtml(true);
    htmlWindow.setPositionX(300);
    htmlWindow.setPositionY(200);

    textWindow = new Window("", new Label("Text caption"));
    textWindow.setId("textWindow");
    textWindow.setCaptionAsHtml(false);
    textWindow.setPositionX(300);
    textWindow.setPositionY(400);

    addWindow(htmlWindow);
    addWindow(textWindow);

    Button red =
        new Button(
            "Red",
            new ClickListener() {
              @Override
              public void buttonClick(ClickEvent event) {
                setWindowCaption("<font style='color: red;'>This may or may not be red</font>");
              }
            });
    Button plainText =
        new Button(
            "Plain text",
            new ClickListener() {
              @Override
              public void buttonClick(ClickEvent event) {
                setWindowCaption("This is just text");
              }
            });
    Button nullCaption =
        new Button(
            "Null",
            new ClickListener() {
              @Override
              public void buttonClick(ClickEvent event) {
                setWindowCaption(null);
              }
            });
    Button empty =
        new Button(
            "Empty",
            new ClickListener() {
              @Override
              public void buttonClick(ClickEvent event) {
                setWindowCaption("");
              }
            });

    addComponents(red, plainText, nullCaption, empty);
    red.click();
  }
Esempio n. 2
0
 public void setComponentValue(final String name, final Object object) {
   super.setComponentValue(name, object);
   if (name.equals("title")) {
     dialog.setCaption((String) object);
   }
   if ("icon".equals(name)) {
     dialog.setIcon(getResource(object));
   }
   if ("h".equals(name)) {
     dialog.setHeight("" + object + "px");
   }
   if ("w".equals(name)) {
     dialog.setWidth("" + object + "px");
   }
   if ("x".equals(name)) {
     dialog.setPositionX((Integer) object);
   }
   if ("y".equals(name)) {
     dialog.setPositionY((Integer) object);
   }
   if ("closable".equals(name)) {
     dialog.setClosable((Boolean) object);
   }
   if ("resizable".equals(name)) {
     dialog.setResizable((Boolean) object);
   }
 }
Esempio n. 3
0
  @Override
  protected void setup(VaadinRequest request) {
    Window def = new Window("default", new Label("Some content"));
    def.setWidth("300px");
    def.setHeight("100%");
    addWindow(def);

    Window light = new Window("WINDOW_LIGHT", new Label("Some content"));
    light.setStyleName(Reindeer.WINDOW_LIGHT);
    light.setPositionX(300);
    light.setWidth("300px");
    light.setHeight("100%");
    addWindow(light);

    Window black = new Window("WINDOW_BLACK", new Label("Some content"));
    black.setStyleName(Reindeer.WINDOW_BLACK);
    black.setPositionX(600);
    black.setWidth("300px");
    black.setHeight("100%");
    addWindow(black);
  }