Example usage for com.vaadin.ui CssLayout CssLayout

List of usage examples for com.vaadin.ui CssLayout CssLayout

Introduction

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

Prototype

public CssLayout() 

Source Link

Document

Constructs an empty CssLayout.

Usage

From source file:org.activiti.kickstart.ui.MainLayout.java

License:Apache License

protected void initHeader() {
    header = new CssLayout();
    header.addStyleName(STYLE_HEADER);
    header.setWidth(100, UNITS_PERCENTAGE);
    addComponent(header);
}

From source file:org.activiti.kickstart.ui.MainLayout.java

License:Apache License

protected void initMain() {
    main = new CssLayout();
    main.setSizeFull();
    main.addStyleName(STYLE_MAIN_CONTENT);
    addComponent(main);
    setExpandRatio(main, 1.0f);
}

From source file:org.bubblecloud.ilves.component.flow.AbstractFlowViewlet.java

License:Apache License

@Override
public final void attach() {
    super.attach();

    setStyleName("ui-content");

    final CssLayout layout = new CssLayout();
    layout.setSizeFull();//from www .j  a  v a 2  s. c o  m
    this.setCompositionRoot(layout);

    topLayout = new CssLayout();
    topLayout.setStyleName("flow-top");

    topBackButton = new Button(getSite().localize("button-back"));
    topBackButton.addClickListener(this);
    topLayout.addComponent(topBackButton);

    topPathLabel = new Label("", ContentMode.HTML);
    topPathLabel.setSizeUndefined();

    topLayout.addComponent(topPathLabel);

    topRightLayout = new CssLayout();
    topLayout.addComponent(topRightLayout);
    topLayout.setWidth(100, Unit.PERCENTAGE);

    bottomLayout = new CssLayout();
    bottomLayout.setStyleName("flow-bottom");

    bottomBackButton = new Button(getSite().localize("button-back"));
    bottomBackButton.addClickListener(this);
    bottomLayout.addComponent(bottomBackButton);

    bottomPathLabel = new Label("", ContentMode.HTML);
    bottomPathLabel.setSizeUndefined();

    bottomLayout.addComponent(bottomPathLabel);

    bottomRightLayout = new CssLayout();
    bottomLayout.addComponent(bottomRightLayout);
    bottomLayout.setWidth(100, Unit.PERCENTAGE);

    tabSheet = new TabSheet();
    tabSheet.setStyleName("flow-sheet");
    tabSheet.hideTabs(true);
    tabSheet.setSizeFull();

    layout.addComponent(topLayout);
    layout.addComponent(tabSheet);
    layout.addComponent(bottomLayout);

    addFlowlets();

    tabSheet.setSelectedTab((Component) getRootFlowlet());
}

From source file:org.bubblecloud.ilves.module.content.RenderFlowlet.java

License:Apache License

@Override
public void enter() {
    final EntityManager entityManager = Site.getCurrent().getSiteContext().getObject(EntityManager.class);
    final String html;
    try {//from   w  w w  .ja  v a  2 s.  c  o m
        html = new Markdown4jProcessor().process(escapeHtml(content.getMarkup()));
    } catch (IOException e) {
        throw new SiteException("Error processing markdown.", e);
    }

    ((AbstractFlowViewlet) getFlow()).getTopRightLayout().removeComponent(topEditButton);
    ((AbstractFlowViewlet) getFlow()).getTopRightLayout().addComponent(topEditButton);
    ((AbstractFlowViewlet) getFlow()).refreshPathLabels();

    final CssLayout layout = new CssLayout();
    //layout.addComponent(topEditButton);
    layout.setStyleName("wiki-content");
    layout.addComponent(new Label(html, ContentMode.HTML));

    setCompositionRoot(layout);
}

From source file:org.bubblecloud.ilves.ui.user.privilege.PrivilegesFlowlet.java

License:Apache License

@Override
protected void initialize() {
    final HorizontalLayout titleLayout = new HorizontalLayout();
    titleLayout.setMargin(new MarginInfo(true, false, true, false));
    titleLayout.setSpacing(true);/*from w  w w. ja  v  a 2  s. c om*/
    final Embedded titleIcon = new Embedded(null, getSite().getIcon("view-icon-privileges"));
    titleIcon.setWidth(32, Unit.PIXELS);
    titleIcon.setHeight(32, Unit.PIXELS);
    titleLayout.addComponent(titleIcon);
    titleLabel = new Label("<h1>" + getSite().localize("view-privileges") + "</h1>", ContentMode.HTML);
    titleLayout.addComponent(titleLabel);

    matrixLayout = new VerticalLayout();
    matrixLayout.setSpacing(true);
    matrixLayout.setMargin(false);

    final HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    saveButton = getSite().getButton("save");
    buttonLayout.addComponent(saveButton);
    saveButton.addClickListener(new Button.ClickListener() {
        /** Serial version UID. */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final Button.ClickEvent event) {
            saveGroupMatrix();
            saveUserMatrix();
            PrivilegeCache.flush((Company) Site.getCurrent().getSiteContext().getObject(Company.class));
        }
    });
    discardButton = getSite().getButton("discard");
    buttonLayout.addComponent(discardButton);
    discardButton.addClickListener(new Button.ClickListener() {
        /** Serial version UID. */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final Button.ClickEvent event) {
            refreshGroupMatrix();
            refreshUserMatrix();
        }
    });

    final CssLayout panel = new CssLayout();
    panel.addComponent(titleLayout);
    panel.addComponent(matrixLayout);
    panel.addComponent(buttonLayout);

    setCompositionRoot(panel);
}

From source file:org.eclipse.hawkbit.ui.AbstractHawkbitUI.java

License:Open Source License

private Component buildHeader() {
    final CssLayout cssLayout = new CssLayout();
    cssLayout.setStyleName("view-header");
    return cssLayout;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private static Component buildHeader() {
    final CssLayout cssLayout = new CssLayout();
    cssLayout.setStyleName("view-header");
    return cssLayout;
}

From source file:org.eclipse.skalli.view.component.InformationBox.java

License:Open Source License

private InformationBox(String caption) {
    super(caption);
    setWidth("100%"); //$NON-NLS-1$

    Layout layout = new CssLayout();
    layout.setSizeFull();/*from www  . j  a  va  2 s .c o m*/
    setContent(layout);

    addStyleName(STYLE);
}

From source file:org.eclipse.skalli.view.component.MultiTextField.java

License:Open Source License

public MultiTextField(String caption, Collection<String> values) {
    if (values == null) {
        throw new IllegalArgumentException("argument 'value' must not be null");
    }/*w  ww  .j  ava  2  s  . c  om*/
    setCaption(caption);
    this.values = values;
    this.maxSize = Integer.MAX_VALUE;
    initTextFieldEntries(values);
    layout = new CssLayout();
    layout.setStyleName(STYLE_LAYOUT);
    renderTextFields();
    setCompositionRoot(layout);
}

From source file:org.eclipse.skalli.view.component.MultiTextField.java

License:Open Source License

private void renderTextFields() {
    int size = textFieldEntries.size();
    int last = size - 1;
    for (int i = 0; i <= last; ++i) {
        TextFieldEntry textFieldEntry = textFieldEntries.get(i);
        CssLayout css = new CssLayout();
        css.setStyleName(STYLE_LINE_LAYOUT);
        textFieldEntry.textField.setReadOnly(readOnly);
        css.addComponent(textFieldEntry.textField);
        if (!readOnly) {
            if (size > 1) {
                Button b = createRemoveButton();
                textFieldEntry.removeButton = b;
                css.addComponent(b);//from w ww.  j a  va2  s . c om
            }
            if (size < maxSize && i == last) {
                css.addComponent(createAddButton());
            }
        }
        layout.addComponent(css);
    }
}