Example usage for com.vaadin.ui GridLayout newLine

List of usage examples for com.vaadin.ui GridLayout newLine

Introduction

In this page you can find the example usage for com.vaadin.ui GridLayout newLine.

Prototype

public void newLine() 

Source Link

Document

Forces the next component to be added at the beginning of the next line.

Usage

From source file:com.peergreen.webconsole.scope.deployment.internal.deployable.repository.RepositoryEntry.java

License:Open Source License

private void showDetailsView() {
    if (detailsView == null) {
        detailsView = new VerticalLayout();
        detailsView.setWidth("100%");

        Button hideDetails = new Button("Hide");
        hideDetails.addStyleName("link");
        hideDetails.addClickListener(new Button.ClickListener() {
            @Override//  w  w  w .  jav a  2  s. c  om
            public void buttonClick(Button.ClickEvent event) {
                showDefaultView();
            }
        });
        detailsView.addComponent(hideDetails);
        detailsView.setComponentAlignment(hideDetails, Alignment.TOP_RIGHT);

        GridLayout layout = new GridLayout(3, 1);
        layout.addComponent(new Label("<b>Name</b>", ContentMode.HTML));
        layout.addComponent(new Label("&nbsp;", ContentMode.HTML));
        layout.addComponent(new Label(repository.getName()));
        layout.newLine();

        layout.addComponent(new Label("<b>URL</b>", ContentMode.HTML));
        layout.addComponent(new Label("&nbsp;", ContentMode.HTML));
        layout.addComponent(new Label(repository.getUrl()));
        layout.newLine();

        layout.addComponent(new Label("<b>Type</b>", ContentMode.HTML));
        layout.addComponent(new Label("&nbsp;", ContentMode.HTML));
        layout.addComponent(new Label(repository.getType()));

        detailsView.addComponent(layout);
        detailsView.setComponentAlignment(layout, Alignment.TOP_LEFT);
    }

    removeAllComponents();
    addComponent(detailsView);
}

From source file:com.peergreen.webconsole.scope.system.internal.service.ServiceReferenceItem.java

License:Open Source License

public Component getInterfaces() {
    if (!opened) {
        return new Label(searchInterfaces());
    } else {// w  ww  .  j a v a 2  s  . com
        GridLayout layout = new GridLayout(3, 1);

        for (String name : reference.getPropertyKeys()) {
            layout.addComponent(new Label(format("<b>%s</b>", name), ContentMode.HTML));
            layout.addComponent(new Label("&nbsp;", ContentMode.HTML));
            layout.addComponent(
                    new Label(convert(reference.getProperty(name)).toString(), ContentMode.PREFORMATTED));
            layout.newLine();
        }

        return layout;
    }
}