Example usage for com.vaadin.ui VerticalLayout removeAllComponents

List of usage examples for com.vaadin.ui VerticalLayout removeAllComponents

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout removeAllComponents.

Prototype

@Override
public void removeAllComponents() 

Source Link

Document

Removes all components from the container.

Usage

From source file:org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleDetails.java

License:Open Source License

private void updateSoftwareModuleDetailsLayout(final String type, final String vendor, final String maxAssign) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();

    detailsTabLayout.removeAllComponents();

    final Label vendorLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().get("label.dist.details.vendor"),
            HawkbitCommonUtil.trimAndNullIfEmpty(vendor) == null ? "" : vendor);
    vendorLabel.setId(UIComponentIdProvider.DETAILS_VENDOR_LABEL_ID);
    detailsTabLayout.addComponent(vendorLabel);

    if (type != null) {
        final Label typeLabel = SPUIComponentProvider
                .createNameValueLabel(getI18n().get("label.dist.details.type"), type);
        typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
        detailsTabLayout.addComponent(typeLabel);
    }//from  ww  w.  ja v  a2s  . co  m

    final Label assignLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.assigned.type"),
            HawkbitCommonUtil.trimAndNullIfEmpty(maxAssign) == null ? "" : maxAssign);
    assignLabel.setId(UIComponentIdProvider.SWM_DTLS_MAX_ASSIGN);
    detailsTabLayout.addComponent(assignLabel);

}

From source file:org.eclipse.hawkbit.ui.common.detailslayout.AbstractDistributionSetDetails.java

License:Open Source License

private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label typeLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type == null ? "" : type);
    typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
    detailsTabLayout.addComponent(typeLabel);

    detailsTabLayout.addComponent(//from  w  w w .ja va  2 s . c  o m
            SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("checkbox.dist.migration.required"),
                    getMigrationRequiredValue(isMigrationRequired)));
}

From source file:org.eclipse.hawkbit.ui.common.detailslayout.AbstractSoftwareModuleDetails.java

License:Open Source License

protected void updateSoftwareModuleDetailsLayout(final String type, final String vendor,
        final String maxAssign) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();

    detailsTabLayout.removeAllComponents();

    final Label vendorLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.dist.details.vendor"), vendor == null ? "" : vendor);
    vendorLabel.setId(UIComponentIdProvider.DETAILS_VENDOR_LABEL_ID);
    detailsTabLayout.addComponent(vendorLabel);

    if (type != null) {
        final Label typeLabel = SPUIComponentProvider
                .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type);
        typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
        detailsTabLayout.addComponent(typeLabel);
    }// w ww.j  a  v  a 2s. c om

    final Label assignLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.assigned.type"), maxAssign == null ? "" : maxAssign);
    assignLabel.setId(UIComponentIdProvider.SWM_DTLS_MAX_ASSIGN);
    detailsTabLayout.addComponent(assignLabel);
}

From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionDetails.java

License:Open Source License

private void updateDistributionDetailsLayout(final String type, final Boolean isMigrationRequired) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    if (type != null) {
        final Label typeLabel = SPUIComponentProvider
                .createNameValueLabel(getI18n().get("label.dist.details.type"), type);
        typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
        detailsTabLayout.addComponent(typeLabel);
    }// w ww.j  a v a  2  s  .com

    if (isMigrationRequired != null) {
        detailsTabLayout.addComponent(
                SPUIComponentProvider.createNameValueLabel(getI18n().get("checkbox.dist.migration.required"),
                        isMigrationRequired.equals(Boolean.TRUE) ? getI18n().get("label.yes")
                                : getI18n().get("label.no")));
    }
}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetDetails.java

License:Open Source License

private void updateDetailsLayout(final String controllerId, final URI address, final String securityToken,
        final String lastQueryDate) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label controllerLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.id"), controllerId == null ? "" : controllerId);
    controllerLabel.setId(UIComponentIdProvider.TARGET_CONTROLLER_ID);
    detailsTabLayout.addComponent(controllerLabel);

    final Label lastPollDtLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.lastpolldate"), lastQueryDate == null ? "" : lastQueryDate);
    lastPollDtLabel.setId(UIComponentIdProvider.TARGET_LAST_QUERY_DT);
    detailsTabLayout.addComponent(lastPollDtLabel);

    final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.ip"),
            address == null ? "" : address.toString());
    typeLabel.setId(UIComponentIdProvider.TARGET_IP_ADDRESS);
    detailsTabLayout.addComponent(typeLabel);

    final HorizontalLayout securityTokenLayout = getSecurityTokenLayout(securityToken);
    controllerLabel.setId(UIComponentIdProvider.TARGET_SECURITY_TOKEN);
    detailsTabLayout.addComponent(securityTokenLayout);
}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetDetails.java

License:Open Source License

private void populateDistributionDtls(final VerticalLayout layout, final DistributionSet distributionSet) {
    layout.removeAllComponents();
    layout.addComponent(/*from   w w  w.  jav a2s.  c om*/
            SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.name"),
                    distributionSet == null ? "" : distributionSet.getName()));

    layout.addComponent(
            SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.version"),
                    distributionSet == null ? "" : distributionSet.getVersion()));

    if (distributionSet == null) {
        return;
    }
    distributionSet.getModules()
            .forEach(module -> layout.addComponent(getSWModlabel(module.getType().getName(), module)));
}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetDetails.java

License:Open Source License

private void updateAttributesLayout(final String controllerId) {
    final VerticalLayout attributesLayout = getAttributesLayout();
    attributesLayout.removeAllComponents();

    if (controllerId == null) {
        return;// w ww . j  a  v a  2 s . c om
    }

    final Map<String, String> attributes = targetManagement.getControllerAttributes(controllerId);
    updateAttributesLabelsList(attributesLayout, attributes);
    updateAttributesUpdateComponents(attributesLayout, controllerId);
}

From source file:org.hbrs.nosql.mongoweb.gui.views.UseCase1.java

@Override
protected void setUp() {
    //MongoDB Connector
    MongoDBConnector mongo = new MongoDBConnector();

    VerticalLayout uc1 = new VerticalLayout();

    TextField uc1input = new TextField();

    uc1input.setCaption("Geben Sie ein Thema ein, welches Sie interessiert!");

    Button button = new Button("Suche");

    button.addClickListener(e -> {//from   w  ww  .  ja v a2 s.com
        uc1.removeAllComponents();

        LocalTime t1 = LocalTime.now();

        // load list with values
        List uc1answer = mongo.getQuery1(uc1input.getValue());

        LocalTime t2 = LocalTime.now();
        Duration elapsed = Duration.between(t1, t2);

        // query over list
        for (int i = 0; i < uc1answer.size(); i++) {
            //create and post labels for list elements
            uc1.addComponent(new Label((String) uc1answer.get(i)));
        }

        uc1.addComponent(new Label("Time: " + elapsed));

        addComponent(uc1);
        /*
        layout.addComponent(new Label("I got " + mongo.getDocsinCollection()
            + " Docs in Store. here They are:"));
        */
    });

    addComponents(uc1input, button);
    setMargin(true);
    setSpacing(true);
}

From source file:org.hbrs.nosql.mongoweb.gui.views.UseCase2.java

@Override
protected void setUp() {
    //MongoDB Connector
    MongoDBConnector mongo = new MongoDBConnector();

    VerticalLayout uc2 = new VerticalLayout();

    Button button = new Button("Professoren suchen");

    button.addClickListener(e -> {/*from w ww  . j a  v a  2 s.  co m*/
        uc2.removeAllComponents();

        LocalTime t1 = LocalTime.now();

        // load list with values
        List uc2answer = mongo.getQuery2();

        LocalTime t2 = LocalTime.now();
        Duration elapsed = Duration.between(t1, t2);

        // query over list
        for (int i = 0; i < uc2answer.size(); i++) {
            //create and post labels for list elements
            uc2.addComponent(new Label((String) uc2answer.get(i)));
        }

        uc2.addComponent(new Label("Time: " + elapsed));

        addComponent(uc2);
    });

    addComponents(button);
    setMargin(true);
    setSpacing(true);
}

From source file:org.hbrs.nosql.mongoweb.gui.views.UseCase3.java

@Override
protected void setUp() {
    //Add your Vaadin Coding here ;)
    //MongoDB Connector
    MongoDBConnector mongo = new MongoDBConnector();

    VerticalLayout uc3 = new VerticalLayout();

    TextField uc3input = new TextField();

    uc3input.setCaption("Geben Sie einen Professor ein und sehen Sie welche Themen dieser untersttzt hat!");

    Button button = new Button("Suche");

    button.addClickListener(e -> {// w  w  w. ja  v  a2 s. c  o m
        uc3.removeAllComponents();

        LocalTime t1 = LocalTime.now();

        // load list with values
        List uc3answer = mongo.getQuery3(uc3input.getValue());

        LocalTime t2 = LocalTime.now();
        Duration elapsed = Duration.between(t1, t2);

        // query over list
        for (int i = 0; i < uc3answer.size(); i++) {
            //create and post labels for list elements
            uc3.addComponent(new Label((String) uc3answer.get(i)));
        }

        uc3.addComponent(new Label("Time: " + elapsed));

        addComponent(uc3);
    });
    addComponents(uc3input, button);
    setMargin(true);
    setSpacing(true);
}