@Test public void testAddHeaderButton() { TestSection section = new TestSection("CAP", true); HorizontalLayout header = section.getHeader(); assertThat(header.getComponentCount(), is(3)); assertThat(header.isVisible(), is(true)); Button button1 = new Button(); section.addHeaderButton(button1); assertThat(header.getComponentCount(), is(4)); assertThat(header.getComponent(1), is(button1)); Button button2 = new Button(); section.addHeaderButton(button2); assertThat(header.getComponentCount(), is(5)); assertThat(header.getComponent(1), is(button2)); assertThat(header.getComponent(2), is(button1)); section.setCaption("UPDATE"); assertThat(header.getComponentCount(), is(5)); assertThat(header.getComponent(1), is(button2)); assertThat(header.getComponent(2), is(button1)); }
public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption);  AbstractSection(@CheckForNull String caption, boolean closeable); @Deprecated  AbstractSection(@CheckForNull String caption, boolean closeable, Optional<Button> editButton); }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); 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 { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); 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();  }