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:annis.gui.EmbeddedVisUI.java

License:Apache License

private void displayMessage(String header, String content) {
    Label label = new Label("<h1>" + header + "</h1>" + "<div>" + content + "</div>", ContentMode.HTML);
    label.setSizeFull();
    setContent(label);/*  w  w  w.ja v  a  2s .  c  o  m*/
}

From source file:annis.visualizers.component.RawTextVisualizer.java

License:Apache License

@Override
public Panel createComponent(VisualizerInput visInput, VisualizationToggle visToggle) {

    // get config for alignment
    boolean vertical = Boolean.parseBoolean(visInput.getMappings().getProperty("vertical", "true"));

    // get the texts
    RawTextWrapper texts = visInput.getRawText();

    // create the main panel
    Panel p = new Panel();
    p.setSizeFull();/*from w ww . j ava2s  .  c o m*/

    // some layout configuration
    p.addStyleName(ChameleonTheme.PANEL_BORDERLESS);
    p.addStyleName(PANEL_CLASS);

    // enable webfonts
    p.addStyleName(Helper.CORPUS_FONT_FORCE);

    Layout l;

    // if no text available inform user and exit
    if (texts == null) {
        Label text = new Label(NO_TEXT);
        text.addStyleName(LABEL_CLASS);
        text.setSizeFull();
        p.setContent(text);
        return p;
    }

    if (texts.hasMultipleTexts()) {

        // set the aligmnent
        if (vertical) {
            l = new VerticalLayout();
        } else {
            l = new GridLayout(texts.getTexts().size(), 1);
        }

        // limit the size to the parent panel.
        l.setSizeFull();

        // add the texts to the layout
        for (int i = 0; i < texts.getTexts().size(); i++) {

            String s = texts.getTexts().get(i);
            Label lblText;

            // check if the text is empty
            if (s == null || hasOnlyWhiteSpace(s)) {
                lblText = new Label(NO_TEXT);
            } else {
                lblText = new Label(s, ContentMode.TEXT);
            }

            lblText.setCaption("text " + (i + 1));
            lblText.addStyleName(LABEL_CLASS);
            lblText.setWidth(98, Sizeable.Unit.PERCENTAGE);

            l.addComponent(lblText);
        }

        // apply the panel
        p.setContent(l);
        return p;
    }

    Label lblText;
    if (texts.hasTexts() && !hasOnlyWhiteSpace(texts.getFirstText())) {
        lblText = new Label(texts.getFirstText(), ContentMode.TEXT);
    } else {
        lblText = new Label(NO_TEXT);
    }

    lblText.setSizeFull();
    lblText.addStyleName(LABEL_CLASS);
    p.setContent(lblText);

    return p;
}

From source file:com.foo01.components.ReservationComponent.java

public static Component build(final Reservation r) {
    final HorizontalLayout reservationComponentLayout = new HorizontalLayout();

    final VerticalLayout datesLayout = new VerticalLayout();
    Label beginningDate = new Label(
            (new SimpleDateFormat("E dd.MM.", Locale.getDefault())).format(r.getBeginning().getTime()));
    Label endingDate = new Label(
            (new SimpleDateFormat("E dd.MM.", Locale.getDefault())).format(r.getEnding().getTime()));
    beginningDate.addStyleName("datelabel");
    endingDate.addStyleName("datelabel");
    datesLayout.addComponent(beginningDate);
    datesLayout.addComponent(endingDate);
    datesLayout.setSpacing(true);//from   ww  w.j  a  v  a  2  s .c o  m
    reservationComponentLayout.addComponent(datesLayout);

    Label reservationInfoLabel = new Label(r.getUser() + "</br></br>" + r.getDescription(), ContentMode.HTML);
    reservationInfoLabel.addStyleName("informationlabel");
    reservationComponentLayout.addComponent(reservationInfoLabel);

    Label rightArrowIconLabel = new Label("</br>" + FontAwesome.CHEVRON_RIGHT.getHtml(), ContentMode.HTML);
    rightArrowIconLabel.addStyleName("rightArrowIconLabel");
    reservationComponentLayout.addComponent(rightArrowIconLabel);

    reservationComponentLayout.setSpacing(true);
    reservationComponentLayout.setWidth("100%");
    datesLayout.setWidth("85px");
    reservationInfoLabel.setSizeFull();
    rightArrowIconLabel.setHeight("100%");
    rightArrowIconLabel.setWidth("20px");
    reservationComponentLayout.setExpandRatio(reservationInfoLabel, 1.0f);

    reservationComponentLayout.addLayoutClickListener(new LayoutClickListener() {
        @Override
        public void layoutClick(LayoutClickEvent event) {
            //System.out.println(event.getClickedComponent().getParent().getId());
            ((foo01TouchKitUI) UI.getCurrent()).NAVIGATIONMANAGER.navigateTo(new ReservationView(r));
        }
    });

    return reservationComponentLayout;
}

From source file:com.invient.vaadin.InvientChartsDemoWin.java

License:Apache License

public InvientChartsDemoWin() {
    VerticalLayout mainLayout = new VerticalLayout();
    setContent(mainLayout);//from   w w  w . ja  v  a  2s  . c o  m
    setSizeFull();
    mainLayout.setSizeFull();
    setCaption("Invient Charts");

    HorizontalLayout infoBar = new HorizontalLayout();
    mainLayout.addComponent(infoBar);
    infoBar.setHeight("50px");
    infoBar.setWidth("100%");
    Label lblAppTitle = new Label("Demo Gallery for Invient Charts");
    lblAppTitle.setSizeFull();
    lblAppTitle.setStyleName("v-label-app-title");
    infoBar.addComponent(lblAppTitle);

    mainSplit = new HorizontalSplitPanel();
    mainSplit.setSizeFull();
    mainLayout.addComponent(mainSplit);
    mainLayout.setExpandRatio(mainSplit, 1);

    leftLayout = new VerticalLayout();
    leftLayout.setSpacing(true);
    mainSplit.setFirstComponent(leftLayout);

    rightLayout = new VerticalLayout();
    rightLayout.setSpacing(true);
    rightLayout.setMargin(true);
    mainSplit.setSecondComponent(rightLayout);

    mainSplit.setSplitPosition(200, Sizeable.UNITS_PIXELS);

    navTree = createChartsTree();
    leftLayout.addComponent(navTree);

    eventLog.setReadOnly(true);
    eventLog.setStyleName("v-textarea-chart-events-log");
    eventLog.setSizeFull();
    eventLog.setHeight("200px");
    setTheme("chartdemo");

}

From source file:com.klwork.explorer.ui.business.flow.act.MyTaskRelatedContentComponent.java

License:Apache License

protected void initActions() {
    // WW_TODO ?//w  w w.j a v  a 2 s . c o  m
    HorizontalLayout actionsContainer = new HorizontalLayout();
    actionsContainer.setSizeFull();

    Label processTitle = new Label(relatedContentTitle);
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processTitle.setSizeFull();
    actionsContainer.addComponent(processTitle);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT);
    actionsContainer.setExpandRatio(processTitle, 1.0f);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT);
    //?
    if (!readOnly) {
        Button addRelatedContentButton = getAddButton();
        actionsContainer.addComponent(addRelatedContentButton);
    }

    addComponent(actionsContainer);
}

From source file:com.klwork.explorer.ui.task.HistoricTaskDetailPanel.java

License:Apache License

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

From source file:com.klwork.explorer.ui.task.TaskRelatedContentComponent.java

License:Apache License

protected void initActions() {
    // WW_TODO ?/* w w w  .j a  va  2s.com*/
    HorizontalLayout actionsContainer = new HorizontalLayout();
    actionsContainer.setSizeFull();

    // 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.addClickListener(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.
                }
            });

            ViewToolManager.showPopupWindow(popup);
        }
    });

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

    addComponent(actionsContainer);
}

From source file:com.lst.deploymentautomation.vaadin.core.LoginUI.java

License:Open Source License

@Override
public void init(VaadinRequest request) {
    //The application itself is not covered by container security - that would break bookmarkability
    //(the view info is kept in the URL fragment, which is not sent to server, thus it's lost
    //when the container redirects the browser to the login page).

    //Therefore only one JSP page is currently covered by container security (ui.jsp). If no user
    //is logged in, we show ui.jsp in a full-sized iframe; since no user is logged in, login page
    //is shown instead - once user logs in, content of ui.jsp is returned, which refreshes the top
    //window - and thus the correct view is shown, since the URL fragment was kept.

    //using a label for this is not very nice, but it's simplest
    String src = request.getContextPath() + "/ui.jsp";
    Label iframe = new Label("<iframe src='" + src + "' style='width: 100%; height: 100%; border: 0' />",
            ContentMode.HTML);//from  w w  w .ja v  a2  s  .  c om
    iframe.setSizeFull();
    setContent(iframe);

    //set page title
    getPage().setTitle(Utils.getLocalizedString(getLocale(), "application.title"));
}

From source file:com.skysql.manager.ui.GeneralSettings.java

License:Open Source License

/**
 * Commands layout.//  ww w.ja v a 2 s  . c o  m
 *
 * @return the vertical layout
 */
private VerticalLayout commandsLayout() {

    VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setSpacing(true);
    layout.setMargin(new MarginInfo(false, true, true, true));

    final Label title = new Label("<h3>Commands Execution</h3>", ContentMode.HTML);
    title.setSizeUndefined();
    layout.addComponent(title);

    final Label explanation = new Label(
            "Determines if the command you selected will be executed only if the original steps displayed at the time of selection are still applicable, or if a suitable variation (depending on node state) can be substituted when you press \"Run\".");
    explanation.setSizeFull();
    layout.addComponent(explanation);

    OptionGroup option = new OptionGroup("Select an option");
    option.addItem(false);
    option.setItemCaption(false, "Strict - only original steps");
    option.addItem(true);
    option.setItemCaption(true, "Loose - any variation");

    String propertyCommandExecution = userObject.getProperty(UserObject.PROPERTY_COMMAND_EXECUTION);
    option.select(propertyCommandExecution == null ? DEFAULT_COMMAND_EXECUTION
            : Boolean.valueOf(propertyCommandExecution));
    option.setNullSelectionAllowed(false);
    option.setHtmlContentAllowed(true);
    option.setImmediate(true);
    layout.addComponent(option);

    option.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(final ValueChangeEvent event) {
            Object value = event.getProperty().getValue();
            userObject.setProperty(UserObject.PROPERTY_COMMAND_EXECUTION, String.valueOf(value));
        }
    });

    return layout;
}

From source file:de.kaiserpfalzEdv.vaadin.ui.defaultviews.editor.impl.BaseEditorViewImpl.java

License:Apache License

private void initializeLayout() {
    layout = new HorizontalLayout();
    layout.setWidth(100f, PERCENTAGE);/*from  ww  w . j av  a  2s .  c o m*/
    layout.setHeight(97f, PERCENTAGE);
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setResponsive(true);

    editorLayout = new VerticalLayout();
    editorLayout.setResponsive(true);
    layout.addComponent(editorLayout);

    Component data = getEditor(presenter.getData());
    data.setWidth(87f, PERCENTAGE);
    data.setHeight(100f, PERCENTAGE);

    Label fillSpace = new Label();
    fillSpace.setSizeFull();

    editorLayout.addComponent(data);
    editorLayout.addComponent(fillSpace);

    editorLayout.setExpandRatio(data, 10f);
    editorLayout.setExpandRatio(fillSpace, 90f);

    layout.setExpandRatio(editorLayout, 90f);
    setCompositionRoot(layout);
}