Example usage for com.vaadin.ui AbstractOrderedLayout isVisible

List of usage examples for com.vaadin.ui AbstractOrderedLayout isVisible

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractOrderedLayout isVisible.

Prototype

@Override
    public boolean isVisible() 

Source Link

Usage

From source file:org.eclipse.emf.ecp.view.group.vaadin.GroupLayoutRendererVaadin.java

License:Open Source License

@Override
protected Component getRenderComponent(final AbstractOrderedLayout orderedLayout) {
    if (GroupType.COLLAPSIBLE.equals(getVElement().getGroupType())) {
        final VerticalLayout mainLayout = new VerticalLayout();
        final NativeButton collapseButton = new NativeButton(StringUtils.EMPTY, new Button.ClickListener() {

            @Override//from ww w.ja  va2s  . c o m
            public void buttonClick(ClickEvent event) {
                final boolean switchVisible = !orderedLayout.isVisible();
                setCollapseStyle(event.getButton(), switchVisible);
                orderedLayout.setVisible(switchVisible);
            }

        });
        collapseButton.setWidth(100, Unit.PERCENTAGE);
        mainLayout.addComponent(collapseButton);
        mainLayout.addComponent(orderedLayout);
        orderedLayout.setMargin(true);
        orderedLayout.setSpacing(true);
        orderedLayout.setVisible(getVElement().isCollapsed());
        setCollapseStyle(collapseButton, getVElement().isCollapsed());
        mainLayout.addStyleName(GROUP_STYLE_NAME);
        return mainLayout;
    }
    return super.getRenderComponent(orderedLayout);
}