com.vaadin.ui.Label.setContentMode() - java examples

Here are the examples of the java api com.vaadin.ui.Label.setContentMode() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

29 Examples 7

19 View Complete Implementation : AddUpdateRolloutWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private Label getMandatoryLabel(final String key) {
    final Label mandatoryLabel = getLabel(i18n.getMessage(key));
    mandatoryLabel.setContentMode(ContentMode.HTML);
    mandatoryLabel.setValue(mandatoryLabel.getValue().concat(" <span style='color:#ed473b'>*</span>"));
    return mandatoryLabel;
}

18 View Complete Implementation : VaadinConfirmDialog.java
Copyright Apache License 2.0
Author : BrunoEberhard
public final void setContentMode(final ContentMode contentMode) {
    msgContentMode = contentMode;
    com.vaadin.shared.ui.ContentMode labelContentMode = com.vaadin.shared.ui.ContentMode.TEXT;
    switch(contentMode) {
        case TEXT_WITH_NEWLINES:
        case TEXT:
            labelContentMode = com.vaadin.shared.ui.ContentMode.TEXT;
            break;
        case PREFORMATTED:
            labelContentMode = com.vaadin.shared.ui.ContentMode.PREFORMATTED;
            break;
        case HTML:
            labelContentMode = com.vaadin.shared.ui.ContentMode.HTML;
            break;
    }
    messageLabel.setContentMode(labelContentMode);
    messageLabel.setValue(contentMode == ContentMode.TEXT_WITH_NEWLINES ? formatDialogMessage(originalMessageText) : originalMessageText);
}

18 View Complete Implementation : DefaultGridHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Builds the replacedle label.
 *
 * @return replacedle-label
 */
protected Label buildreplacedleLabel() {
    // create default replacedle - even shown when no data is available
    replacedle = new LabelBuilder().name(replacedleText).buildCaptionLabel();
    replacedle.setImmediate(true);
    replacedle.setContentMode(ContentMode.HTML);
    return replacedle;
}

18 View Complete Implementation : TargetTable.java
Copyright Eclipse Public License 1.0
Author : eclipse
private Label getTargetPollTime(final Object itemId) {
    final Label statusLabel = new Label();
    statusLabel.addStyleName(ValoTheme.LABEL_SMALL);
    statusLabel.setHeightUndefined();
    statusLabel.setContentMode(ContentMode.HTML);
    final String pollStatusToolTip = (String) getContainerDataSource().gereplacedem(itemId).gereplacedemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue();
    if (StringUtils.hasText(pollStatusToolTip)) {
        statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
        statusLabel.setDescription(pollStatusToolTip);
    } else {
        statusLabel.setValue(FontAwesome.CLOCK_O.getHtml());
        statusLabel.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_IN_TIME));
    }
    return statusLabel;
}

18 View Complete Implementation : ClickableLabel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
public void setContentMode(ContentMode contentMode) {
    label.setContentMode(contentMode);
}

17 View Complete Implementation : A_CmsSetupStep.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates a new HTML-formatted label with the given content.
 *
 * @param html the label content
 */
public Label htmlLabel(String html) {
    Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue(html);
    return label;
}

17 View Complete Implementation : A_CmsUpdateDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates a new HTML-formatted label with the given content.
 *
 * @param html the label content
 * @return Label
 */
public Label htmlLabel(String html) {
    Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue(html);
    return label;
}

16 View Complete Implementation : ListRadioQuestion.java
Copyright GNU General Public License v3.0
Author : antoniomaria
@Override
protected void init() {
    questionreplacedle.setValue(String.format("<b>%d</b>. %s", questionDTO.getNumber(), questionDTO.getLanguageSettings().getreplacedle()));
    questionreplacedle.setContentMode(ContentMode.HTML);
    content.addComponent(questionreplacedle);
    options.setCaption("Choose one of the following answers");
    options.addItem("NULL");
    options.sereplacedemCaption("NULL", "Not selected");
    for (QuestionOptionDTO questionOptionDTO : questionDTO.getQuestionOptions()) {
        String optionCode = questionOptionDTO.getCode();
        String optionreplacedle = questionOptionDTO.getLanguageSettings().getreplacedle();
        options.addItem(optionCode);
        options.sereplacedemCaption(optionCode, optionreplacedle);
        if (questionDTO.getAnswer() instanceof TextAnswer) {
            if (((TextAnswer) questionDTO.getAnswer()).getValue().equals(optionCode)) {
                options.setValue(optionCode);
            }
        }
    }
    if (questionDTO.getAnswer() instanceof NoAnswer) {
        options.setValue("NULL");
    }
    options.addValueChangeListener(this);
    content.addComponent(options);
}

16 View Complete Implementation : ArtifactDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Set replacedle of artifact details header layout.
 */
private void setreplacedleOfLayoutHeader() {
    replacedleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId("", i18n));
    replacedleOfArtifactDetails.setContentMode(ContentMode.HTML);
}

15 View Complete Implementation : ArtifactDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void createComponents(final String labelSoftwareModule) {
    replacedleOfArtifactDetails = new LabelBuilder().id(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID).name(HawkbitCommonUtil.getArtifactoryDetailsLabelId(labelSoftwareModule, i18n)).buildCaptionLabel();
    replacedleOfArtifactDetails.setContentMode(ContentMode.HTML);
    replacedleOfArtifactDetails.setSizeFull();
    replacedleOfArtifactDetails.setImmediate(true);
    maxMinButton = createMaxMinButton();
    artifactDetailsTable = createArtifactDetailsTable();
    artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer());
    addGeneratedColumn(artifactDetailsTable);
    if (!readOnly) {
        addGeneratedColumnButton(artifactDetailsTable);
    }
    setTableColumnDetails(artifactDetailsTable);
}

15 View Complete Implementation : WindowUtil.java
Copyright Apache License 2.0
Author : opensecuritycontroller
/**
 * Returns a Delete window using provided Content and Caption.It will have a Force Delete check box along with
 * Cancel and Ok Buttons.
 * The cancel button defaults to closing the window. You can customize behavior of OK,Cancel and Force Delete
 * components by calling @link {@link VmidcWindow#getComponentModel()} and setting a different
 * listener to that component
 *
 * @param caption
 *            Window's Caption
 * @param content
 *            Window's Content
 * @return
 *         Window Object
 */
public static VmidcWindow<OkCancelValidateButtonModel> createValidateWindow(String caption, String content) {
    final VmidcWindow<OkCancelValidateButtonModel> validateWindow = new VmidcWindow<OkCancelValidateButtonModel>(new OkCancelValidateButtonModel());
    validateWindow.setCaption(caption);
    validateWindow.getComponentModel().setCancelClickedListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = -1166844267835596823L;

        @Override
        public void buttonClick(ClickEvent event) {
            validateWindow.close();
        }
    });
    Label contentLabel = new Label(content);
    contentLabel.setContentMode(ContentMode.HTML);
    FormLayout form = new FormLayout();
    form.setMargin(true);
    form.setSizeUndefined();
    form.addComponent(contentLabel);
    validateWindow.setContent(form);
    return validateWindow;
}

15 View Complete Implementation : WindowUtil.java
Copyright Apache License 2.0
Author : opensecuritycontroller
/**
 * Returns a simple window with the specified caption and content(which can be HTML) with an OK and Cancel Buttons.
 * The cancel button defaults to closing the window.
 * This behaviour can be modified by calling @link {@link VmidcWindow#getComponentModel()} and setting a different
 * listener to the cancel button
 *
 * @param caption
 *            the caption
 * @param content
 *            the content
 * @return the handle to window object
 */
public static VmidcWindow<OkCancelButtonModel> createAlertWindow(String caption, String content) {
    final VmidcWindow<OkCancelButtonModel> alertWindow = new VmidcWindow<OkCancelButtonModel>(new OkCancelButtonModel());
    alertWindow.setCaption(caption);
    alertWindow.getComponentModel().setCancelClickedListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = 98853982893459323L;

        @Override
        public void buttonClick(ClickEvent event) {
            alertWindow.close();
        }
    });
    Label contentLabel = new Label(content);
    contentLabel.setContentMode(ContentMode.HTML);
    FormLayout form = new FormLayout();
    form.setMargin(true);
    form.setSizeUndefined();
    form.addComponent(contentLabel);
    alertWindow.setContent(form);
    return alertWindow;
}

15 View Complete Implementation : JasperReportLayout.java
Copyright GNU General Public License v3.0
Author : rlsutton1
private void showCsvSplash() {
    VerticalLayout csvSplash = new VerticalLayout();
    csvSplash.setMargin(true);
    Label replacedleLabel = new Label("<h1>" + reportProperties.getReportreplacedle() + "</h1>");
    replacedleLabel.setContentMode(ContentMode.HTML);
    csvSplash.addComponent(replacedleLabel);
    Label label = new Label("<font size='4' >Excel (CSV) download initiated.</font>");
    label.setContentMode(ContentMode.HTML);
    csvSplash.addComponent(label);
    splitPanel.setSecondComponent(csvSplash);
}

13 View Complete Implementation : MainView.java
Copyright GNU General Public License v3.0
Author : AskNowQA
private Component createFeedbackComponent() {
    feedbackPanel = new HorizontalLayout();
    feedbackPanel.setSpacing(true);
    feedbackPanel.setSizeFull();
    feedbackPanel.addStyleName("white-border");
    feedbackPanel.addStyleName("shadow-label");
    feedbackPanel.setWidth("95%");
    feedbackPanel.setHeight("80%");
    feedbackPanel.setVisible(false);
    feedbackLabel = new Label(" ", Label.CONTENT_XHTML);
    feedbackLabel.setContentMode(Label.CONTENT_XHTML);
    feedbackLabel.addStyleName("status-label");
    feedbackLabel.setSizeFull();
    feedbackPanel.addComponent(feedbackLabel);
    feedbackPanel.setExpandRatio(feedbackLabel, 1f);
    feedbackPanel.setComponentAlignment(feedbackLabel, Alignment.MIDDLE_CENTER);
    wrongSolutionButton = new NativeButton("Wrong!");
    wrongSolutionButton.setWidth("60px");
    wrongSolutionButton.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            Window otherSolutionsWindow = createOtherSolutionsWindow();
            getApplication().getMainWindow().addWindow(otherSolutionsWindow);
        }
    });
    wrongSolutionButton.addStyleName("shift-left");
    // wrongSolutionButton.setVisible(false);
    // feedbackPanel.addComponent(wrongSolutionButton);
    // feedbackPanel.setComponentAlignment(wrongSolutionButton, Alignment.MIDDLE_CENTER);
    return feedbackPanel;
}

13 View Complete Implementation : AutoCompleteTextFieldComponent.java
Copyright Eclipse Public License 1.0
Author : eclipse
private static Label createStatusIcon() {
    final Label statusIcon = new Label();
    statusIcon.setImmediate(true);
    statusIcon.setContentMode(ContentMode.HTML);
    statusIcon.setSizeFull();
    setInitialStatusIconStyle(statusIcon);
    statusIcon.setId(UIComponentIdProvider.VALIDATION_STATUS_ICON_ID);
    return statusIcon;
}

12 View Complete Implementation : WindowUtil.java
Copyright Apache License 2.0
Author : opensecuritycontroller
/**
 * Returns a Delete window using provided Content and Caption.It will have a Force Delete check box along with
 * Cancel and Ok Buttons.
 * The cancel button defaults to closing the window. You can customize behavior of OK,Cancel and Force Delete
 * components by calling @link {@link VmidcWindow#getComponentModel()} and setting a different
 * listener to that component
 *
 * @param caption
 *            Window's Caption
 * @param content
 *            Window's Content
 * @return
 *         Window Object
 */
public static VmidcWindow<OkCancelForceDeleteModel> createForceDeleteWindow(String caption, String content) {
    final VmidcWindow<OkCancelForceDeleteModel> deleteWindow = new VmidcWindow<OkCancelForceDeleteModel>(new OkCancelForceDeleteModel());
    // Creating the Force Delete Warning Window
    ValueChangeListener forceDeleteValueChangeListener = new ValueChangeListener() {

        /**
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            OkCancelForceDeleteModel forceDeleteModel = deleteWindow.getComponentModel();
            if (forceDeleteModel.getForceDeleteCheckBoxValue()) {
                final VmidcWindow<OkCancelButtonModel> alertWindow = WindowUtil.createAlertWindow("Force Delete", VmidcMessages.getString(VmidcMessages_.FORCE_DELETE_WARNING));
                ViewUtil.addWindow(alertWindow);
                alertWindow.getComponentModel().setOkClickedListener(new ClickListener() {

                    /**
                     */
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        alertWindow.close();
                    }
                });
                alertWindow.getComponentModel().setCancelClickedListener(new ClickListener() {

                    /**
                     */
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        OkCancelForceDeleteModel forceDeleteModel = deleteWindow.getComponentModel();
                        forceDeleteModel.setForceDeleteValue(false);
                        alertWindow.close();
                    }
                });
            }
        }
    };
    if (deleteWindow.getComponentModel() instanceof OkCancelForceDeleteModel) {
        OkCancelForceDeleteModel forceDeleteModel = deleteWindow.getComponentModel();
        forceDeleteModel.setForceDeleteValueChangeListener(forceDeleteValueChangeListener);
    }
    // Creating the Force Delete Window
    deleteWindow.setCaption(caption);
    deleteWindow.getComponentModel().setCancelClickedListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = -651121508110914210L;

        @Override
        public void buttonClick(ClickEvent event) {
            deleteWindow.close();
        }
    });
    Label contentLabel = new Label(content);
    contentLabel.setContentMode(ContentMode.HTML);
    FormLayout form = new FormLayout();
    form.setMargin(true);
    form.setSizeUndefined();
    form.addComponent(contentLabel);
    deleteWindow.setContent(form);
    return deleteWindow;
}

12 View Complete Implementation : StorageAdminPanel.java
Copyright Mozilla Public License 2.0
Author : sensiasoft
protected void buildDataPanel(GridLayout form, IRecordStorageModule<?> storage) {
    // measurement outputs
    int i = 1;
    if (storage.isEnabled()) {
        for (IRecordStoreInfo dsInfo : storage.getRecordStores().values()) {
            Panel panel = newPanel("Stream #" + i++);
            GridLayout panelLayout = ((GridLayout) panel.getContent());
            panelLayout.setSpacing(true);
            // stored time period
            double[] timeRange = storage.getRecordsTimeRange(dsInfo.getName());
            Label l = new Label("<b>Time Range:</b> " + new DateTimeFormat().formatIso(timeRange[0], 0) + " / " + new DateTimeFormat().formatIso(timeRange[1], 0));
            l.setContentMode(ContentMode.HTML);
            panelLayout.addComponent(l, 0, 0, 1, 0);
            // time line
            panelLayout.addComponent(buildGantt(storage, dsInfo), 0, 1, 1, 1);
            // data structure
            DataComponent dataStruct = dsInfo.getRecordDescription();
            Component sweForm = new SWECommonForm(dataStruct);
            panelLayout.addComponent(sweForm);
            // data table
            panelLayout.addComponent(buildTable(storage, dsInfo));
            if (oldPanel != null)
                form.replaceComponent(oldPanel, panel);
            else
                form.addComponent(panel);
            oldPanel = panel;
        }
    }
}

11 View Complete Implementation : CmsUpdateStep06FinishDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @see org.opencms.setup.updater.dialogs.A_CmsUpdateDialog#init(org.opencms.setup.CmsUpdateUI)
 */
@Override
public boolean init(CmsUpdateUI ui) {
    CmsVaadinUtils.readAndLocalizeDesign(this, null, null);
    super.init(ui, false, false);
    // Lock the wizard
    ui.getUpdateBean().prepareUpdateStep6();
    setCaption("Finished");
    m_icon.setContentMode(ContentMode.HTML);
    m_icon.setValue(FontAwesome.CHECK_CIRCLE_O.getHtml());
    String name = "browser_config.html";
    Label label = htmlLabel(readSnippet(name));
    label.setWidth("100%");
    m_notesContainer.addComponent(label);
    return true;
}

11 View Complete Implementation : ArtifactDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void populateArtifactDetails(final Long baseSwModuleId, final String swModuleName) {
    if (!readOnly) {
        if (StringUtils.isEmpty(swModuleName)) {
            setreplacedleOfLayoutHeader();
        } else {
            replacedleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId(swModuleName, i18n));
            replacedleOfArtifactDetails.setContentMode(ContentMode.HTML);
        }
    }
    final Map<String, Object> queryConfiguration;
    if (baseSwModuleId != null) {
        queryConfiguration = Maps.newHashMapWithExpectedSize(1);
        queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
    } else {
        queryConfiguration = Collections.emptyMap();
    }
    final LazyQueryContainer artifactContainer = getArtifactLazyQueryContainer(queryConfiguration);
    artifactDetailsTable.setContainerDataSource(artifactContainer);
    if (fullWindowMode && maxArtifactDetailsTable != null) {
        maxArtifactDetailsTable.setContainerDataSource(artifactContainer);
    }
    setTableColumnDetails(artifactDetailsTable);
}

11 View Complete Implementation : JasperReportLayout.java
Copyright GNU General Public License v3.0
Author : rlsutton1
protected void initScreen(SplitPanel panel) {
    this.setSizeFull();
    splitPanel = panel;
    this.addComponent(splitPanel.getComponent());
    splitPanel.setFirstComponent((AbstractComponent) getOptionsPanel());
    splash = new VerticalLayout();
    splash.setMargin(true);
    Label replacedleLabel = new Label("<h1>" + reportProperties.getReportreplacedle() + "</h1>");
    replacedleLabel.setContentMode(ContentMode.HTML);
    splash.addComponent(replacedleLabel);
    Label splashLabel = new Label("<font size='4' >Set the desired filters and click a print button to generate a report</font>");
    splashLabel.setContentMode(ContentMode.HTML);
    splitPanel.setSecondComponent(splash);
    // generate the report immediately if there are no visible filters
    if (!builder.hasFilters()) {
        splashLabel = new Label("<font size='4' >Please wait whilst we generate your report</font>");
        splashLabel.setContentMode(ContentMode.HTML);
        // disable the buttons and any filters
        printButton.setEnabled(false);
        exportButton.setEnabled(false);
        showButton.setEnabled(false);
        for (ExpanderComponent componet : components) {
            componet.getComponent().setEnabled(false);
        }
        // what follows is a horrible hack...
        // if we create the progress dialog at the same time as the popup
        // report window the progress dialog will be behind the popup report
        // window.
        // so I've created a refresher, and 1 seconds after the popup report
        // window opens we kick of the report generation which creates the
        // progress dialog then, which allows it to be in front.
        UI.getCurrent().setPollInterval(500);
        UI.getCurrent().addPollListener(new PollListener() {

            private static final long serialVersionUID = 1L;

            @Override
            public void poll(PollEvent event) {
                try {
                    UI.getCurrent().setPollInterval(-1);
                    UI.getCurrent().removePollListener(this);
                    generateReport(reportProperties.getDefaultFormat(), JasperReportLayout.this.builder.getReportParameters());
                } catch (Exception e) {
                    logger.catching(e);
                    Notification.show("Error", e.getMessage(), Type.ERROR_MESSAGE);
                }
            }
        });
    }
    splash.addComponent(splashLabel);
    JavaScript.getCurrent().addFunction("au.com.noojee.reportDrillDown", new JavaScriptFunction() {

        // expected syntax of a call to this javascript hook method
        // 
        // window.parent.au.com.noojee.reportDrillDown(
        // {
        // 'reportFileName':
        // 'CallDetailsPerTeamAgentPerHour_CallDetails.jasper',
        // 'reportreplacedle': 'Call Details Per Team Agent Per Hour'
        // },
        // {
        // 'ReportParameterStartDate'='$P{StartDate}',
        // 'ReportParameterEndDate'='$P{EndDate}',
        // 'ReportParameterExtension'='$F{loginid}',
        // 'ReportParameterTeamId'='$P{TeamId}',
        // 'ReportParameterHour'='$F{Day}.toString()'
        // }
        // 
        // );
        private static final long serialVersionUID = 1L;

        @Override
        public void call(JsonArray arguments) {
            try {
                JsonObject args = arguments.getObject(0);
                String subReportFileName = args.getString("ReportFileName");
                String subreplacedle = args.getString("Reportreplacedle");
                JsonObject params = arguments.getObject(1);
                List<ReportParameter<?>> subFilters = new LinkedList<>();
                boolean insitue = false;
                String[] itr = params.keys();
                for (String key : itr) {
                    if (key.equalsIgnoreCase("ReportParameterInsitue")) {
                        insitue = true;
                    } else {
                        subFilters.add(new ReportParameterConstant<>(key, params.getString(key), key, params.getString(key)));
                    }
                }
                if (!insitue) {
                    new JasperReportPopUp(new ChildJasperReportProperties(reportProperties, subreplacedle, subReportFileName, subFilters));
                } else {
                    generateReport(OutputFormat.HTML, subFilters);
                }
            } catch (Exception e) {
                logger.error(arguments.toString());
                logger.error(e, e);
            }
        }
    });
}

10 View Complete Implementation : AbstractTableDetailsLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
protected void createComponents() {
    caption = createHeaderCaption();
    caption.setImmediate(true);
    caption.setContentMode(ContentMode.HTML);
    caption.setId(getDetailsHeaderCaptionId());
    editButton = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE), null, false, FontAwesome.PENCIL_SQUARE_O, SPUIButtonStyleNoBorder.clreplaced);
    editButton.setId(getEditButtonId());
    editButton.addClickListener(this::onEdit);
    editButton.setEnabled(false);
    manageMetadataBtn = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON), null, false, FontAwesome.LIST_ALT, SPUIButtonStyleNoBorder.clreplaced);
    manageMetadataBtn.setId(getMetadataButtonId());
    manageMetadataBtn.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON));
    manageMetadataBtn.addClickListener(this::showMetadata);
    manageMetadataBtn.setEnabled(false);
    detailsTab = SPUIComponentProvider.getDetailsTabSheet();
    detailsTab.setImmediate(true);
    detailsTab.setWidth(98, Unit.PERCENTAGE);
    detailsTab.setHeight(90, Unit.PERCENTAGE);
    detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE);
    detailsTab.setId(getTabSheetId());
}

9 View Complete Implementation : SWECommonForm.java
Copyright Mozilla Public License 2.0
Author : sensiasoft
protected Component buildWidget(DataComponent dataComponent, boolean showValues) {
    if (dataComponent instanceof DataRecord || dataComponent instanceof Vector) {
        VerticalLayout layout = new VerticalLayout();
        Label l = new Label();
        l.setContentMode(ContentMode.HTML);
        l.setValue(getCaption(dataComponent, false));
        l.setDescription(getTooltip(dataComponent));
        layout.addComponent(l);
        VerticalLayout form = new VerticalLayout();
        form.setMargin(new MarginInfo(false, false, false, true));
        form.setSpacing(false);
        for (int i = 0; i < dataComponent.getComponentCount(); i++) {
            DataComponent c = dataComponent.getComponent(i);
            Component w = buildWidget(c, showValues);
            if (w != null)
                form.addComponent(w);
        }
        layout.addComponent(form);
        return layout;
    } else if (dataComponent instanceof DataArray) {
        DataArray dataArray = (DataArray) dataComponent;
        VerticalLayout layout = new VerticalLayout();
        Label l = new Label();
        l.setContentMode(ContentMode.HTML);
        l.setValue(getCaption(dataComponent, false));
        l.setDescription(getTooltip(dataComponent));
        layout.addComponent(l);
        VerticalLayout form = new VerticalLayout();
        form.setMargin(new MarginInfo(false, false, false, true));
        form.setSpacing(false);
        form.addComponent(buildWidget(dataArray.getElementType(), false));
        layout.addComponent(form);
        return layout;
    } else if (dataComponent instanceof DataChoice) {
        DataChoice dataChoice = (DataChoice) dataComponent;
        VerticalLayout layout = new VerticalLayout();
        Label l = new Label();
        l.setContentMode(ContentMode.HTML);
        l.setValue(getCaption(dataChoice, false));
        l.setDescription(getTooltip(dataChoice));
        layout.addComponent(l);
        return layout;
    } else if (dataComponent instanceof SimpleComponent) {
        Label l = new Label();
        l.setContentMode(ContentMode.HTML);
        l.setValue(getCaption(dataComponent, showValues));
        l.setDescription(getTooltip(dataComponent));
        return l;
    }
    return null;
}

8 View Complete Implementation : CheckboxListQuestion.java
Copyright GNU General Public License v3.0
Author : antoniomaria
@Override
protected void init() {
    questionreplacedle.setValue(String.format("<b>%d</b>. %s", questionDTO.getNumber(), questionDTO.getLanguageSettings().getreplacedle()));
    questionreplacedle.setContentMode(ContentMode.HTML);
    content.addComponent(questionreplacedle);
    options.setCaption("Choose one of the following answers");
    Answer multipleAnswer = questionDTO.getAnswer();
    List<Answer> answers = Collections.emptyList();
    if (multipleAnswer instanceof MultipleAnswer) {
        answers = ((MultipleAnswer) multipleAnswer).getAnswers();
    }
    selectedOptions = new HashSet<String>();
    for (QuestionOptionDTO questionOptionDTO : questionDTO.getQuestionOptions()) {
        String optionCode = questionOptionDTO.getCode();
        String optionreplacedle = questionOptionDTO.getLanguageSettings().getreplacedle();
        options.addItem(optionCode);
        options.sereplacedemCaption(optionCode, optionreplacedle);
        for (Answer answer : answers) {
            BooleanAnswer booleanAnswer = (BooleanAnswer) answer;
            if (booleanAnswer.getOption().equals(optionCode)) {
                if (booleanAnswer.getValue()) {
                    selectedOptions.add(optionCode);
                }
                break;
            }
        }
    }
    options.setValue(selectedOptions);
    options.addValueChangeListener(this);
    content.addComponent(options);
}

4 View Complete Implementation : ErrorWindow.java
Copyright GNU General Public License v3.0
Author : rlsutton1
private void showWindow(String causeClreplaced, String id, final Date time, final String finalId, final String finalTrace, final String reference, final byte[] imageData) {
    final Window window = new Window();
    UI.getCurrent().addWindow(window);
    window.setModal(true);
    window.center();
    window.setResizable(false);
    window.setCaption("Error " + id);
    window.setClosable(false);
    // window.setHeight("50%");
    window.setWidth("50%");
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    final Label message = new Label("<b>An error has occurred (" + causeClreplaced + ").<br><br>Reference:</b> " + reference);
    message.setContentMode(ContentMode.HTML);
    Label describe = new Label("<b>Please describe what you were doing when this error occured (Optional)<b>");
    describe.setContentMode(ContentMode.HTML);
    final TextArea notes = new TextArea();
    notes.setWidth("100%");
    final String supportEmail = getTargetEmailAddress();
    close.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                generateEmail(time, finalId, finalTrace, reference, notes.getValue(), supportEmail, getViewName(), getUserName(), getUserEmail(), imageData);
            } catch (Exception e) {
                logger.error(e, e);
                Notification.show("Error sending error report", Type.ERROR_MESSAGE);
            } finally {
                window.close();
            }
        }
    });
    close.setStyleName(ValoTheme.BUTTON_DANGER);
    close.setId(ERROR_WINDOW_CLOSE_BUTTON);
    layout.addComponent(message);
    layout.addComponent(describe);
    layout.addComponent(notes);
    layout.addComponent(uploadStatus);
    layout.addComponent(close);
    layout.addComponent(new Label("Information about this error will be sent to " + getSupportCompanyName()));
    window.setContent(layout);
}

4 View Complete Implementation : DateTimePickerInline.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
protected void buildUI(String replacedle) {
    datePicker = new InlineDateField(replacedle + " Date");
    datePicker.setDateFormat("yyyy/MM/dd");
    datePicker.setValue(new Date());
    displayDate = createTextDateField();
    datePicker.addValueChangeListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            final Date date = (Date) event.getProperty().getValue();
            displayDate.setValue(dateFormatter.format(date));
        }
    });
    final Label midnightLabel = new Label();
    midnightLabel.setContentMode(ContentMode.HTML);
    field = new TextField();
    field.setWidth("125");
    field.setImmediate(true);
    displayTime = field;
    displayTime.addValidator(timeValidator);
    field.addValidator(timeValidator);
    field.addValueChangeListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
            DateTimePickerInline.this.valueChange(event);
            @SuppressWarnings("deprecation")
            int hour = getValue().getHours();
            if (hour == 0) {
                midnightLabel.setValue("<font color='red'><b>Midnight</b></font>");
            } else {
                midnightLabel.setValue("");
            }
            try {
                final Date parsedDate = parseDate((String) event.getProperty().getValue());
                if (parsedDate != null) {
                    Calendar parsed = Calendar.getInstance();
                    parsed.setTime(parsedDate);
                    dateTime.set(Calendar.HOUR_OF_DAY, parsed.get(Calendar.HOUR_OF_DAY));
                    dateTime.set(Calendar.MINUTE, parsed.get(Calendar.MINUTE));
                    isSet = true;
                    setNewValue();
                }
            } catch (InvalidValueException e) {
                logger.info(e);
            // the validator will handle this
            }
        }
    });
    field.setCaption(null);
    datePicker.setCaption(null);
    VerticalLayout vl = new VerticalLayout();
    HorizontalLayout dateLayout = new HorizontalLayout();
    dateLayout.setWidth("210");
    Button changeYearButton = new Button("Year");
    changeYearButton.setDescription("Change the year");
    changeYearButton.setStyleName(ValoTheme.BUTTON_TINY);
    changeYearButton.addClickListener(getChangeYearClickListener());
    dateLayout.addComponent(displayDate);
    dateLayout.addComponent(changeYearButton);
    dateLayout.setComponentAlignment(changeYearButton, Alignment.MIDDLE_RIGHT);
    vl.addComponent(datePicker);
    HorizontalLayout timeFieldLayout = new HorizontalLayout();
    timeFieldLayout.setSpacing(true);
    timeFieldLayout.addComponent(field);
    timeFieldLayout.addComponent(midnightLabel);
    timeFieldLayout.setComponentAlignment(midnightLabel, Alignment.MIDDLE_LEFT);
    vl.addComponent(buildInline());
    addComponent(vl);
    vl.addComponent(timeFieldLayout);
    vl.addComponent(dateLayout);
    vl.setSpacing(true);
}

1 View Complete Implementation : CreateOrUpdateFilterTable.java
Copyright Eclipse Public License 1.0
Author : eclipse
private Component getStatusIcon(final Object itemId) {
    final Item row1 = gereplacedem(itemId);
    final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1.gereplacedemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
    final Label label = new LabelBuilder().name("").buildLabel();
    label.setContentMode(ContentMode.HTML);
    if (targetStatus == TargetUpdateStatus.PENDING) {
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW);
        label.setValue(FontAwesome.ADJUST.getHtml());
    } else if (targetStatus == TargetUpdateStatus.REGISTERED) {
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE);
        label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
    } else if (targetStatus == TargetUpdateStatus.ERROR) {
        label.setDescription(i18n.getMessage(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR)));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED);
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN);
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC));
        label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    } else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE);
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN));
        label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
    }
    return label;
}

0 View Complete Implementation : WindowBreadCrumbs.java
Copyright Apache License 2.0
Author : cuba-platform
public void update() {
    boolean isTestMode = ui.isTestMode();
    linksLayout.removeAllComponents();
    for (Iterator<Window> it = windows.iterator(); it.hasNext(); ) {
        Window window = it.next();
        Button button = new NavigationButton(window);
        button.setCaption(StringUtils.trimToEmpty(window.getCaption()));
        button.addClickListener(this::navigationButtonClicked);
        button.setSizeUndefined();
        button.setStyleName(ValoTheme.BUTTON_LINK);
        button.setTabIndex(-1);
        if (isTestMode) {
            button.setCubaId("breadCrubms_Button_" + window.getId());
        }
        if (ui.isPerformanceTestMode()) {
            button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId()));
        }
        if (it.hasNext()) {
            linksLayout.addComponent(button);
            Label separatorLab = new Label(" > ");
            separatorLab.setStyleName("c-breadcrumbs-separator");
            separatorLab.setSizeUndefined();
            separatorLab.setContentMode(ContentMode.HTML);
            linksLayout.addComponent(separatorLab);
        } else {
            Label captionLabel = new Label(window.getCaption());
            captionLabel.setStyleName("c-breadcrumbs-win-caption");
            captionLabel.setSizeUndefined();
            linksLayout.addComponent(captionLabel);
        }
    }
}

0 View Complete Implementation : FileDownloadWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void constructBody() {
    final MVerticalLayout layout = new MVerticalLayout().withFullWidth();
    CssLayout iconWrapper = new CssLayout();
    final ELabel iconEmbed = ELabel.fontIcon(FilereplacedetsUtil.getFileIconResource(content.getName()));
    iconEmbed.addStyleName("icon-48px");
    iconWrapper.addComponent(iconEmbed);
    layout.with(iconWrapper).withAlign(iconWrapper, Alignment.MIDDLE_CENTER);
    final GridFormLayoutHelper infoLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
    if (content.getDescription() != null) {
        final Label descLbl = new Label();
        if (!content.getDescription().equals("")) {
            descLbl.setData(content.getDescription());
        } else {
            descLbl.setValue(" ");
            descLbl.setContentMode(ContentMode.HTML);
        }
        infoLayout.addComponent(descLbl, UserUIContext.getMessage(GenericI18Enum.FORM_DESCRIPTION), 0, 0);
    }
    UserService userService = AppContextUtil.getSpringBean(UserService.clreplaced);
    SimpleUser user = userService.findUserByUserNameInAccount(content.getCreatedUser(), AppUI.getAccountId());
    if (user == null) {
        infoLayout.addComponent(new UserLink(UserUIContext.getUsername(), UserUIContext.getUserAvatarId(), UserUIContext.getUserDisplayName()), UserUIContext.getMessage(GenericI18Enum.OPT_CREATED_BY), 0, 1);
    } else {
        infoLayout.addComponent(new UserLink(user.getUsername(), user.getAvatarid(), user.getDisplayName()), UserUIContext.getMessage(GenericI18Enum.OPT_CREATED_BY), 0, 1);
    }
    final Label size = new Label(FileUtils.getVolumeDisplay(content.getSize()));
    infoLayout.addComponent(size, UserUIContext.getMessage(FileI18nEnum.OPT_SIZE), 0, 2);
    ELabel dateCreate = new ELabel().prettyDateTime(DateTimeUtils.toLocalDateTime(content.getCreated()));
    infoLayout.addComponent(dateCreate, UserUIContext.getMessage(GenericI18Enum.FORM_CREATED_TIME), 0, 3);
    layout.addComponent(infoLayout.getLayout());
    MButton downloadBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_DOWNLOAD)).withIcon(VaadinIcons.DOWNLOAD).withStyleName(WebThemes.BUTTON_ACTION);
    List<Resource> resources = new ArrayList<>();
    resources.add(content);
    StreamResource downloadResource = StreamDownloadResourceUtil.getStreamResourceSupportExtDrive(resources);
    FileDownloader fileDownloader = new FileDownloader(downloadResource);
    fileDownloader.extend(downloadBtn);
    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION);
    MHorizontalLayout buttonControls = new MHorizontalLayout(cancelBtn, downloadBtn);
    layout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT);
    this.setContent(layout);
}

0 View Complete Implementation : JasperReportLayout.java
Copyright GNU General Public License v3.0
Author : rlsutton1
private Component getOptionsPanel() {
    VerticalLayout layout = new VerticalLayout();
    layout.setId("OptionsPanel");
    // layout.setMargin(new MarginInfo(false, false, false, false));
    // layout.setSpacing(true);
    layout.setSizeFull();
    String buttonHeight = "" + BUTTON_WIDTH;
    HorizontalLayout buttonBar = new HorizontalLayout();
    buttonBar.setStyleName("njadmin-grey-colour");
    buttonBar.setSpacing(true);
    // buttonBar.setStyleName(Reindeer.LAYOUT_BLUE);
    buttonBar.setWidth("100%");
    buttonBar.setHeight("" + (BUTTON_WIDTH));
    buttonBar.setMargin(new MarginInfo(false, false, false, false));
    HorizontalLayout buttonContainer = new HorizontalLayout();
    buttonContainer.setSizeFull();
    buttonContainer.setWidth("280");
    showButton = new Button();
    Resource previewButtonIcon = reportProperties.getPreviewButtonIconResource();
    if (previewButtonIcon == null) {
        previewButtonIcon = new ExternalResource("images/seanau/Print preview.png");
    }
    showButton.setIcon(previewButtonIcon);
    showButton.setDescription("Preview");
    showButton.setWidth("" + BUTTON_WIDTH);
    showButton.setHeight(buttonHeight);
    showButton.setDisableOnClick(true);
    showButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    showButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    addButtonListener(showButton, OutputFormat.HTML);
    buttonContainer.addComponent(showButton);
    printButton = new Button();
    Resource pdfButtonIcon = reportProperties.getPdfButtonIconResource();
    if (pdfButtonIcon == null) {
        pdfButtonIcon = new ExternalResource("images/seanau/Print_32.png");
    }
    printButton.setIcon(pdfButtonIcon);
    printButton.setDescription("Print (PDF)");
    printButton.setWidth("" + BUTTON_WIDTH);
    printButton.setHeight(buttonHeight);
    printButton.setDisableOnClick(true);
    printButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    printButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    addButtonListener(printButton, OutputFormat.PDF);
    buttonContainer.addComponent(printButton);
    exportButton = new Button();
    Resource exportButtonIcon = reportProperties.getExportButtonIconResource();
    if (exportButtonIcon == null) {
        exportButtonIcon = new ExternalResource("images/exporttoexcel.png");
    }
    exportButton.setDescription("Export (Excel - CSV)");
    exportButton.setIcon(exportButtonIcon);
    exportButton.setWidth("" + BUTTON_WIDTH);
    exportButton.setDisableOnClick(true);
    exportButton.setHeight(buttonHeight);
    exportButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    exportButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    addButtonListener(exportButton, OutputFormat.CSV);
    buttonContainer.addComponent(exportButton);
    createFavouriteButton(buttonHeight, buttonContainer);
    createEmailButton(buttonHeight, buttonContainer);
    createScheduleButton(buttonHeight, buttonContainer);
    if (reportProperties instanceof JasperReportPopUp) {
        // This is disabled because there are serious problems with
        // transient (JasperReportProperties is not aware of them)
        // parameters in drill
        // downs, these can not currently be save or represented in the
        // ReportEmailSchedule
        emailButton.setEnabled(false);
        scheduleButton.setEnabled(false);
    }
    buttonBar.addComponent(buttonContainer);
    layout.addComponent(buttonBar);
    components = builder.buildLayout(false);
    if (components.size() > 0) {
        VerticalLayout filterPanel = new VerticalLayout();
        filterPanel.setMargin(new MarginInfo(false, false, true, false));
        filterPanel.setSpacing(true);
        filterPanel.setSizeFull();
        Label filterLabel = new Label("<b>Filters</b>");
        filterLabel.setStyleName(Reindeer.LABEL_H2);
        filterLabel.setContentMode(ContentMode.HTML);
        filterPanel.addComponent(filterLabel);
        for (ExpanderComponent componet : components) {
            filterPanel.addComponent(componet.getComponent());
            if (componet.shouldExpand()) {
                filterPanel.setExpandRatio(componet.getComponent(), 1);
            }
        }
        layout.addComponent(filterPanel);
        layout.setExpandRatio(filterPanel, 1.0f);
        try {
            ReportSave reportSave = UI.getCurrent().getSession().getAttribute(ReportSave.clreplaced);
            if (reportSave != null) {
                for (ReportParameter<?> rp : builder.getReportParameters()) {
                    for (String paramterName : rp.getParameterNames()) {
                        for (ReportSaveParameter saved : reportSave.getParameters()) {
                            if (saved.getParameterName().equals(rp.getLabel(paramterName))) {
                                try {
                                    if (StringUtils.isNotBlank(saved.getMetaData())) {
                                        rp.applySaveMetaData(saved.getMetaData());
                                    } else {
                                        rp.setValuereplacedtring(saved.getParameterValue(), paramterName);
                                    }
                                } catch (ReadOnlyException | ConversionException | ParseException e) {
                                    ErrorWindow.showErrorWindow(e);
                                }
                            }
                        }
                    }
                }
            }
        } catch (Exception e) {
            logger.error(e, e);
        }
    }
    // hidden frame for downloading csv
    csv = new BrowserFrame();
    csv.setVisible(true);
    csv.setHeight("1");
    csv.setWidth("1");
    csv.setImmediate(true);
    layout.addComponent(csv);
    return layout;
}