Example usage for com.vaadin.ui Label setSizeFull

List of usage examples for com.vaadin.ui Label setSizeFull

Introduction

In this page you can find the example usage for com.vaadin.ui Label setSizeFull.

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:org.activiti.explorer.ui.management.job.JobDetailPanel.java

License:Apache License

protected void addJobState() {
    Label processDefinitionHeader = new Label(i18nManager.getMessage(Messages.JOB_HEADER_EXECUTION));
    processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_H3);
    processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    processDefinitionHeader.setWidth(100, UNITS_PERCENTAGE);
    addComponent(processDefinitionHeader);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);// w  w  w  .  j a  v a2  s.c o m
    layout.setSizeFull();
    layout.setMargin(true, false, true, false);

    addDetailComponent(layout);
    setDetailExpandRatio(layout, 1.0f);

    // Exceptions
    if (job.getExceptionMessage() != null) {
        // Number of retries
        Label retrieslabel = new Label(getRetriesLabel(job));
        layout.addComponent(retrieslabel);

        // Exception
        Label exceptionMessageLabel = new Label(
                i18nManager.getMessage(Messages.JOB_ERROR) + ": " + job.getExceptionMessage());
        exceptionMessageLabel.addStyleName(ExplorerLayout.STYLE_JOB_EXCEPTION_MESSAGE);
        layout.addComponent(exceptionMessageLabel);

        // Add Exception stacktrace
        String stack = managementService.getJobExceptionStacktrace(job.getId());

        Label stackTraceLabel = new Label(stack);
        stackTraceLabel.setContentMode(Label.CONTENT_PREFORMATTED);
        stackTraceLabel.addStyleName(ExplorerLayout.STYLE_JOB_EXCEPTION_TRACE);
        stackTraceLabel.setSizeFull();

        Panel stackPanel = new Panel();
        stackPanel.setWidth(100, UNITS_PERCENTAGE);
        stackPanel.setSizeFull();
        stackPanel.setScrollable(true);
        stackPanel.addComponent(stackTraceLabel);

        layout.addComponent(stackPanel);
        layout.setExpandRatio(stackPanel, 1.0f);
    } else {

        if (job.getProcessDefinitionId() != null) {

            // This is a hack .. need to cleanify this in the engine
            JobEntity jobEntity = (JobEntity) job;
            if (jobEntity.getJobHandlerType().equals(TimerSuspendProcessDefinitionHandler.TYPE)) {
                addLinkToProcessDefinition(layout,
                        i18nManager.getMessage(Messages.JOB_SUSPEND_PROCESSDEFINITION), false);
            } else if (jobEntity.getJobHandlerType().equals(TimerActivateProcessDefinitionHandler.TYPE)) {
                addLinkToProcessDefinition(layout,
                        i18nManager.getMessage(Messages.JOB_ACTIVATE_PROCESSDEFINITION), true);
            } else {
                addNotYetExecutedLabel(layout);
            }

        } else {

            addNotYetExecutedLabel(layout);

        }
    }
}

From source file:org.activiti.explorer.ui.task.HistoricTaskDetailPanel.java

License:Apache License

protected void initRelatedContentTitle() {
    Label title = new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.TASK_RELATED_CONTENT));
    title.addStyleName(ExplorerLayout.STYLE_H3);
    title.setSizeFull();
    relatedContentLayout.addComponent(title);
}

From source file:org.activiti.explorer.ui.task.TaskRelatedContentComponent.java

License:Apache License

protected void initActions() {
    HorizontalLayout actionsContainer = new HorizontalLayout();
    actionsContainer.setSizeFull();//from   w w  w  .j  a  va 2s . co  m

    // Title
    Label processTitle = new Label(i18nManager.getMessage(Messages.TASK_RELATED_CONTENT));
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processTitle.setSizeFull();
    actionsContainer.addComponent(processTitle);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT);
    actionsContainer.setExpandRatio(processTitle, 1.0f);

    // Add content button
    Button addRelatedContentButton = new Button();
    addRelatedContentButton.addStyleName(ExplorerLayout.STYLE_ADD);
    addRelatedContentButton.addListener(new com.vaadin.ui.Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
            CreateAttachmentPopupWindow popup = new CreateAttachmentPopupWindow();

            if (task.getProcessInstanceId() != null) {
                popup.setProcessInstanceId(task.getProcessInstanceId());
            } else {
                popup.setTaskId(task.getId());
            }

            // Add listener to update attachments when added
            popup.addListener(new SubmitEventListener() {

                private static final long serialVersionUID = 1L;

                @Override
                protected void submitted(SubmitEvent event) {
                    taskDetailPanel.notifyRelatedContentChanged();
                }

                @Override
                protected void cancelled(SubmitEvent event) {
                    // No attachment was added so updating UI isn't needed.
                }
            });

            ExplorerApp.get().getViewManager().showPopupWindow(popup);
        }
    });

    actionsContainer.addComponent(addRelatedContentButton);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT);

    addComponent(actionsContainer);
}

From source file:org.eclipse.hawkbit.ui.components.SPUIComponentProvider.java

License:Open Source License

/**
 * Method to CreateName value labels./*from   w  w w  .ja  va 2s .  c  o  m*/
 *
 * @param label
 *            as string
 * @param values
 *            as string
 * @return Label
 */
public static Label createNameValueLabel(final String label, final String... values) {
    final String valueStr = StringUtils.arrayToDelimitedString(values, " ");
    final Label nameValueLabel = new Label(getBoldHTMLText(label) + valueStr, ContentMode.HTML);
    nameValueLabel.setSizeFull();
    nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
    nameValueLabel.addStyleName("label-style");
    return nameValueLabel;
}

From source file:org.eclipse.hawkbit.ui.components.SPUIComponentProvider.java

License:Open Source License

private static Label createUsernameLabel(final String label, final String username) {
    String loadAndFormatUsername = "";
    if (!StringUtils.isEmpty(username)) {
        loadAndFormatUsername = UserDetailsFormatter.loadAndFormatUsername(username);
    }/*from ww w. ja  v  a  2  s.c  om*/

    final Label nameValueLabel = new Label(getBoldHTMLText(label) + loadAndFormatUsername, ContentMode.HTML);
    nameValueLabel.setSizeFull();
    nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
    nameValueLabel.addStyleName("label-style");
    nameValueLabel.setDescription(loadAndFormatUsername);
    return nameValueLabel;
}

From source file:org.eclipse.hawkbit.ui.filtermanagement.AutoCompleteTextFieldComponent.java

License:Open Source License

private static Label createStatusIcon() {
    final Label statusIcon = new Label();
    statusIcon.setImmediate(true);/*from w w  w .  ja v  a  2  s.c om*/
    statusIcon.setContentMode(ContentMode.HTML);
    statusIcon.setSizeFull();
    setInitialStatusIconStyle(statusIcon);
    statusIcon.setId(UIComponentIdProvider.VALIDATION_STATUS_ICON_ID);
    return statusIcon;
}

From source file:org.eclipse.hawkbit.ui.management.footer.ActionTypeOptionGroupLayout.java

License:Open Source License

private void createOptionGroup() {
    actionTypeOptionGroup = new FlexibleOptionGroup();
    actionTypeOptionGroup.addItem(ActionTypeOption.SOFT);
    actionTypeOptionGroup.addItem(ActionTypeOption.FORCED);
    actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED);
    selectDefaultOption();/*from w w w .j  a  v  a 2s  .c  o m*/

    final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.FORCED);
    forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    // set Id for Forced radio button.
    forceItem.setId("save.action.radio.forced");
    addComponent(forceItem);
    final Label forceLabel = new Label();
    forceLabel.setStyleName("statusIconPending");
    forceLabel.setIcon(FontAwesome.BOLT);
    forceLabel.setCaption("Forced");
    forceLabel.setDescription(i18n.getMessage("tooltip.forced.item"));
    forceLabel.setStyleName("padding-right-style");
    addComponent(forceLabel);

    final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.SOFT);
    softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID);
    softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(softItem);
    final Label softLabel = new Label();
    softLabel.setSizeFull();
    softLabel.setCaption("Soft");
    softLabel.setDescription(i18n.getMessage("tooltip.soft.item"));
    softLabel.setStyleName("padding-right-style");
    addComponent(softLabel);

    final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.AUTO_FORCED);
    autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    // setted Id for Time Forced radio button.
    autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED);
    addComponent(autoForceItem);
    final Label autoForceLabel = new Label();
    autoForceLabel.setStyleName("statusIconPending");
    autoForceLabel.setIcon(FontAwesome.HISTORY);
    autoForceLabel.setCaption("Time Forced");
    autoForceLabel.setDescription(i18n.getMessage("tooltip.timeforced.item"));
    autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(autoForceLabel);

    forcedTimeDateField = new DateField();
    forcedTimeDateField.setInvalidAllowed(false);
    forcedTimeDateField.setInvalidCommitted(false);
    forcedTimeDateField.setEnabled(false);
    forcedTimeDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    forcedTimeDateField.setValue(
            Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    forcedTimeDateField.setImmediate(true);
    forcedTimeDateField.setTimeZone(tz);
    forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale());
    forcedTimeDateField.setResolution(Resolution.MINUTE);
    forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(forcedTimeDateField);
}

From source file:org.eclipse.hawkbit.ui.management.miscs.AbstractActionTypeOptionGroupLayout.java

License:Open Source License

protected void addSoftItemWithLabel() {
    final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.SOFT);
    softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID);
    softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(softItem);//from   w w w  .  ja v a  2 s  .c o m
    final Label softLabel = new Label();
    softLabel.setSizeFull();
    softLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_SOFT));
    softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM));
    softLabel.setStyleName("padding-right-style");
    addComponent(softLabel);
}

From source file:org.eclipse.hawkbit.ui.management.miscs.ActionTypeOptionGroupLayout.java

License:Open Source License

private void createOptionGroup() {
    actionTypeOptionGroup = new FlexibleOptionGroup();
    actionTypeOptionGroup.addItem(ActionTypeOption.SOFT);
    actionTypeOptionGroup.addItem(ActionTypeOption.FORCED);
    actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED);
    selectDefaultOption();//from  w  ww .  j  a  v  a 2  s .  c  o  m

    final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.FORCED);
    forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    forceItem.setId(UIComponentIdProvider.SAVE_ACTION_RADIO_FORCED);
    addComponent(forceItem);
    final Label forceLabel = new Label();
    forceLabel.setStyleName("statusIconPending");
    forceLabel.setIcon(FontAwesome.BOLT);
    forceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_FORCED));
    forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM));
    forceLabel.setStyleName("padding-right-style");
    addComponent(forceLabel);

    final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.SOFT);
    softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID);
    softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(softItem);
    final Label softLabel = new Label();
    softLabel.setSizeFull();
    softLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_SOFT));
    softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM));
    softLabel.setStyleName("padding-right-style");
    addComponent(softLabel);

    final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.AUTO_FORCED);
    autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED);
    addComponent(autoForceItem);
    final Label autoForceLabel = new Label();
    autoForceLabel.setStyleName("statusIconPending");
    autoForceLabel.setIcon(FontAwesome.HISTORY);
    autoForceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_TIME_FORCED));
    autoForceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TIMEFORCED_ITEM));
    autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(autoForceLabel);

    forcedTimeDateField = new DateField();
    forcedTimeDateField.setInvalidAllowed(false);
    forcedTimeDateField.setInvalidCommitted(false);
    forcedTimeDateField.setEnabled(false);
    forcedTimeDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    forcedTimeDateField.setValue(
            Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    forcedTimeDateField.setImmediate(true);
    forcedTimeDateField.setTimeZone(tz);
    forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale());
    forcedTimeDateField.setResolution(Resolution.MINUTE);
    forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(forcedTimeDateField);
}

From source file:org.eclipse.hawkbit.ui.menu.DashboardMenu.java

License:Open Source License

private Component buildVersionInfo() {
    final Label label = new Label();
    label.setSizeFull();
    label.setStyleName("version-layout");
    label.setValue(serverProperties.getBuild().getVersion());
    return label;
}