Examples of replaceComponent()


Examples of com.vaadin.ui.AbstractOrderedLayout.replaceComponent()

        layout.setExpandRatio(first, ratio);
        layout.setExpandRatio(second, 1);

        AbstractComponent replace = new AbstractComponent() {
        };
        layout.replaceComponent(first, replace);

        Assert.assertEquals("Expand ratio for replaced component is not "
                + "the same as for previous one", ratio,
                layout.getExpandRatio(replace), 0.0001);
    }
View Full Code Here

Examples of com.vaadin.ui.AbstractOrderedLayout.replaceComponent()

        layout.setComponentAlignment(first, alignment);
        layout.setComponentAlignment(second, Alignment.MIDDLE_CENTER);

        AbstractComponent replace = new AbstractComponent() {
        };
        layout.replaceComponent(first, replace);

        Assert.assertEquals("Alignment for replaced component is not "
                + "the same as for previous one", alignment,
                layout.getComponentAlignment(replace));
    }
View Full Code Here

Examples of com.vaadin.ui.ComponentContainer.replaceComponent()

            @Override
            public void buttonClick(ClickEvent event) {
                TabSheet tabsheet = new TabSheet();
                ComponentContainer mainParent = (ComponentContainer) mainLayout
                        .getParent();
                mainParent.replaceComponent(mainLayout, tabsheet);
                tabsheet.addTab(mainLayout, "Default tab");
            }
        });
        mainLayout.addComponent(b);
    }
View Full Code Here

Examples of com.vaadin.ui.CssLayout.replaceComponent()

          Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
          editLayout.addComponent(okButton);
          editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
         
          // replace
          descriptionLayout.replaceComponent(descriptionLabel, editLayout);
         
          // When OK is clicked -> update task data + ui
          okButton.addListener(new ClickListener() {
            public void buttonClick(ClickEvent event) {
              // Update data
View Full Code Here

Examples of com.vaadin.ui.CssLayout.replaceComponent()

              task.setDescription(descriptionTextArea.getValue().toString());
              taskService.saveTask(task);
             
              // Update UI
              descriptionLabel.setValue(task.getDescription());
              descriptionLayout.replaceComponent(editLayout, descriptionLabel);
            }
          });
        }
      }
    });
View Full Code Here

Examples of com.vaadin.ui.CssLayout.replaceComponent()

          Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
          editLayout.addComponent(okButton);
          editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
         
          // replace
          descriptionLayout.replaceComponent(descriptionLabel, editLayout);
         
          // When OK is clicked -> update task data + ui
          okButton.addListener(new ClickListener() {
            public void buttonClick(ClickEvent event) {
              // Update data
View Full Code Here

Examples of com.vaadin.ui.CssLayout.replaceComponent()

              task.setDescription(descriptionTextArea.getValue().toString());
              taskService.saveTask(task);
             
              // Update UI
              descriptionLabel.setValue(task.getDescription());
              descriptionLayout.replaceComponent(editLayout, descriptionLabel);
            }
          });
        }
      }
    });
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout.replaceComponent()

        addComponent(new Button("Swap sources", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (source1.getParent() != null) {
                    horizontalLayout.replaceComponent(source1, source2);
                } else {
                    horizontalLayout.replaceComponent(source2, source1);
                }
                target.markAsDirty();
            }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout.replaceComponent()

            @Override
            public void buttonClick(ClickEvent event) {
                if (source1.getParent() != null) {
                    horizontalLayout.replaceComponent(source1, source2);
                } else {
                    horizontalLayout.replaceComponent(source2, source1);
                }
                target.markAsDirty();
            }
        }));
View Full Code Here

Examples of com.vaadin.ui.Layout.replaceComponent()

                    if (useWorkaround) {
                        container.setVisible(false);
                        lastHeight = root.getHeight();
                        lastHeightUnit = root.getHeightUnits();
                        root.setHeight("26px");
                        buttonContainer.replaceComponent(collapse, expand);
                    } else {
                        boolean visible = container.isVisible();
                        container.setVisible(!visible);
                        if (visible) {
                            lastHeight = root.getHeight();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.