/** * Constructs a CssLayout with the given components in the given order. * * @see #addComponents(Component...) * * @param children * Components to add to the container. */ public CssLayout(Component... children) { this(); addComponents(children); }
@Override public void menuSelected(final MenuItem selectedItem) { if (!slot.getStyleName().contains("max")) { selectedItem.setIcon(FontAwesome.COMPRESS); slot.removeAllComponents(); card2.removeAllComponents(); card2.addComponents(toolbar, large); slot.addComponents(card2); toggleMaximized(slot, true); } else { slot.removeStyleName("max"); selectedItem.setIcon(FontAwesome.EXPAND); toggleMaximized(slot, false); card1.removeAllComponents(); card1.addComponents(toolbar, small); slot.removeAllComponents(); slot.addComponents(card1); } } });
public SingleLineListItem(String primaryText, boolean verticalPadding) { super(verticalPadding); addStyleName("single-line"); setHeight(Metrics.List.SINGLE_LINE_HEIGHT, Unit.PIXELS); primary = new Label(primaryText); primary.setPrimaryStyleName(Typography.Dark.Subheader.PRIMARY); content.addComponent(primary); actionPrimary.addComponents(iconPrimary, content); actionSecondary.addComponent(iconSecondary); addComponents(actionPrimary, actionSecondary, divider); }
public TwoLineListItem(String primaryText, String secondaryText, boolean verticalPadding) { super(verticalPadding); addStyleName("two-line"); setHeight(Metrics.List.TWO_LINE_HEIGHT, Unit.PIXELS); primary = new Label(primaryText); primary.setPrimaryStyleName(Typography.Dark.Subheader.PRIMARY); secondary = new Label(secondaryText); secondary.setPrimaryStyleName(Typography.Dark.Body1.SECONDARY); content.addComponents(primary, secondary); actionPrimary.addComponents(iconPrimary, content); actionSecondary.addComponent(iconSecondary); addComponents(actionPrimary, actionSecondary, divider); }
toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT); card1.addComponents(toolbar, small); slot.addComponent(card1); return slot;