@Test public void testSetCaption() { TestSection section = new TestSection("CAP", false); HorizontalLayout header = section.getHeader(); Label captionLabel = (Label)header.getComponent(0); assertThat(header.isVisible(), is(true)); assertThat(captionLabel.isVisible(), is(true)); assertThat(captionLabel.getValue(), is("CAP")); section.setCaption("TION"); assertThat(header.isVisible(), is(true)); assertThat(captionLabel.isVisible(), is(true)); assertThat(captionLabel.getValue(), is("TION")); }
@Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption);  AbstractSection(@CheckForNull String caption, boolean closeable); @Deprecated  AbstractSection(@CheckForNull String caption, boolean closeable, Optional<Button> editButton); }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption);  AbstractSection(@CheckForNull String caption, boolean closeable); @Deprecated  AbstractSection(@CheckForNull String caption, boolean closeable, Optional<Button> editButton); @Override void setCaption(@CheckForNull String caption); void addHeaderButton(Button button); void addHeaderComponent(Component component); boolean isOpen(); boolean isClosed(); void open(); void close(); }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption);  AbstractSection(@CheckForNull String caption, boolean closeable); @Deprecated  AbstractSection(@CheckForNull String caption, boolean closeable, Optional<Button> editButton); @Override void setCaption(@CheckForNull String caption); void addHeaderButton(Button button); void addHeaderComponent(Component component); boolean isOpen(); boolean isClosed(); void open(); void close();  }