Example usage for com.vaadin.ui ComponentContainer addComponent

List of usage examples for com.vaadin.ui ComponentContainer addComponent

Introduction

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

Prototype

public void addComponent(Component c);

Source Link

Document

Adds the component into this container.

Usage

From source file:org.escidoc.browser.ui.GroupRolesView.java

License:Open Source License

private void showExistingGrants(ComponentContainer grantListLayout) throws EscidocClientException {
    int rowNumber = 0;

    for (Grant grant : repositories.group().getGrantsForGroup(groupId)) {
        /**/*www  . j  av a 2  s . co  m*/
         * Some grants have been excluded from output because of performance issues. The list is found at:
         * ViewConstants.roleExcludeList
         */
        if (!ViewConstants.roleExcludeList.contains(grant.getXLinkTitle().toString()
                .substring(0, grant.getXLinkTitle().toString().lastIndexOf(" of")).trim())) {
            HorizontalLayout existingGrantRowLayout = buildEditGrantRowView(rowNumber, grant);
            existingGrantRowLayout.setData(Integer.valueOf(rowNumber));
            rowNumber++;
            bind(existingGrantRowLayout, grant);
            grantListLayout.addComponent(existingGrantRowLayout);
        }
    }

}

From source file:org.escidoc.browser.ui.useraccount.UserRolesView.java

License:Open Source License

private void listRolesForUser(ComponentContainer grantListLayout) throws EscidocClientException {
    grantListLayout.removeAllComponents();

    if (controller.getGrantsForUser(userProxy.getId()).size() == 0) {
        grantListLayout.addComponent(new Label("<h2>The user has no roles.</h2>", Label.CONTENT_XHTML));
    } else {/*ww  w  . j a v a 2 s.  co  m*/
        showExistingGrants(grantListLayout);
    }

    grantListLayout.addComponent(buildGrantRowAddView());
}

From source file:org.escidoc.browser.ui.useraccount.UserRolesView.java

License:Open Source License

private void showExistingGrants(ComponentContainer grantListLayout) throws EscidocClientException {
    int rowNumber = 0;
    for (Grant grant : controller.getGrantsForUser(userProxy.getId())) {
        HorizontalLayout existingGrantRowLayout = buildEditGrantRowView(rowNumber, grant);
        existingGrantRowLayout.setData(Integer.valueOf(rowNumber));
        rowNumber++;// w  w  w.  j av  a  2s  .c o  m
        bind(existingGrantRowLayout, grant);
        grantListLayout.addComponent(existingGrantRowLayout);
    }
}

From source file:org.lunifera.examples.vaaclipse.demo1.e4.toolitems.CodeLineToolItem.java

License:Open Source License

@Inject
public CodeLineToolItem(ComponentContainer parent, IEclipseContext context) {
    //the parent - is toolcontrol widget, we must add style for layouting in trimbar to parent widget, not to user control 
    parent.addStyleName("codeline");

    final Label label = new Label("170 : 20");
    parent.addComponent(label);
}

From source file:org.lunifera.examples.vaaclipse.demo1.e4.toolitems.EditModeToolItem.java

License:Open Source License

@Inject
public EditModeToolItem(ComponentContainer parent, IEclipseContext context) {
    //the parent - is toolcontrol widget, we must add style for layouting in trimbar to parent widget, not to user control
    parent.addStyleName("editmode");

    final Label label = new Label("Readonly");
    parent.addComponent(label);
}

From source file:org.lunifera.examples.vaaclipse.demo1.e4.toolitems.EditStatusToolItem.java

License:Open Source License

@Inject
public EditStatusToolItem(ComponentContainer parent, IEclipseContext context) {
    //the parent - is toolcontrol widget, we must add style for layouting in trimbar to parent widget, not to user control
    parent.addStyleName("editstatus");

    final Label label = new Label("Smart Insert");
    parent.addComponent(label);
}

From source file:org.lunifera.examples.vaaclipse.demo1.e4.toolitems.StatusBar.java

License:Open Source License

@Inject
public void EditModeToolItem(ComponentContainer parent, IEclipseContext context) {
    //the parent - is toolcontrol widget, we must add style for layouting in trimbar to parent widget, not to user control
    //parent.addStyleName("editmode");

    final Label label = new Label("Ready");
    parent.addComponent(label);
}

From source file:org.lunifera.runtime.web.ecview.presentation.vaadin.internal.ViewPresentation.java

License:Open Source License

/**
 * {@inheritDoc}//  w  w  w.ja  v  a2s .  co  m
 */
@Override
public Component createWidget(Object parent) {
    if (componentBase == null) {
        // create component base with grid layout to enable margins
        //
        componentBase = new CssLayout();
        componentBase.setSizeFull();
        componentBase.addStyleName(IConstants.CSS_CLASS_CONTROL_BASE);

        ComponentContainer parentContainer = (ComponentContainer) parent;
        parentContainer.addComponent(componentBase);

        // create the component
        component = new CssLayout();
        component.addStyleName(IConstants.CSS_CLASS_CONTROL);
        componentBase.addComponent(component);

        if (modelAccess.isCssIdValid()) {
            component.setId(modelAccess.getCssID());
        } else {
            component.setId(editpart.getId());
        }

        if (modelAccess.isCssClassValid()) {
            component.addStyleName(modelAccess.getCssClass());
        }

        if (modelAccess.isMargin()) {
            component.addStyleName(IConstants.CSS_CLASS_MARGIN);
        }

        // render the content
        //
        renderContent();

        // register as an locale change listener
        IViewContext context = ModelUtil.getViewContext(modelAccess.yView);
        ILocaleChangedService service = context.getService(ILocaleChangedService.ID);
        if (service != null) {
            service.addLocaleListener(this);
        }

    }
    return componentBase;
}

From source file:org.lunifera.web.ecp.uimodel.presentation.vaadin.internal.ViewPresentation.java

License:Open Source License

/**
 * {@inheritDoc}//from w  w w.  j a v  a 2 s  .co m
 */
@Override
public Component createWidget(Object parent) {
    if (componentBase == null) {
        // create component base with grid layout to enable margins
        //
        componentBase = new CssLayout();
        componentBase.setSizeFull();
        componentBase.addStyleName(IConstants.CSS_CLASS__CONTROL_BASE);

        ComponentContainer parentContainer = (ComponentContainer) parent;
        parentContainer.addComponent(componentBase);

        // create the component
        component = new CssLayout();
        component.setSizeFull();
        component.addStyleName(IConstants.CSS_CLASS__CONTROL);
        componentBase.addComponent(component);

        if (modelAccess.isCssIdValid()) {
            component.setId(modelAccess.getCssID());
        } else {
            component.setId(editpart.getId());
        }

        if (modelAccess.isCssClassValid()) {
            component.addStyleName(modelAccess.getCssClass());
        }

        if (modelAccess.isMargin()) {
            component.addStyleName(IConstants.CSS_CLASS__MARGIN);
        }

        // render the content
        //
        renderContent();
    }
    return componentBase;
}

From source file:org.metawidget.vaadin.ui.layout.FormLayout.java

License:LGPL

public void startContainerLayout(ComponentContainer container, VaadinMetawidget metawidget) {

    com.vaadin.ui.FormLayout layout = new com.vaadin.ui.FormLayout();
    container.addComponent(layout);
}