Example usage for com.vaadin.ui VerticalLayout setCaption

List of usage examples for com.vaadin.ui VerticalLayout setCaption

Introduction

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

Prototype

@Override
    public void setCaption(String caption) 

Source Link

Usage

From source file:org.vaadin.numberfield.NumberFieldUI.java

License:Apache License

private void addFieldGroup() {
    VerticalLayout layout = createLayout();
    layout.setCaption("FieldGroup");
    BeanItem<Bean> beanItem = new BeanItem<Bean>(new Bean());
    BeanFieldGroup<Bean> fieldGroup = new BeanFieldGroup<NumberFieldUI.Bean>(Bean.class);
    fieldGroup.setItemDataSource(beanItem);
    for (Object propertyId : fieldGroup.getUnboundPropertyIds()) {
        Field<?> field;/*from   w ww  .  j  a va2  s  .  c  om*/
        if ("number".equals(propertyId)) {
            NumberField numberField = new NumberField();
            numberField.setLocale(Locale.FRANCE);
            numberField.setCaption("Modified settings:");
            numberField.setDecimalPrecision(2);
            numberField.setDecimalSeparator(',');
            numberField.setGroupingSeparator('.');
            numberField.setDecimalSeparatorAlwaysShown(true);
            numberField.setMinimumFractionDigits(2);
            numberField.setMinValue(5);
            field = numberField;
            fieldGroup.bind(field, propertyId);
        } else {
            field = fieldGroup.buildAndBind(propertyId);
        }
        layout.addComponent(field);
        mainLayout.addComponent(layout);
    }
}

From source file:qdbtools.main.QuserdbtoolsUI.java

License:Open Source License

private void initTabs() {
    boolean admin = isAdmin();
    options.removeAllComponents();/*  w w  w .  j  a  v a  2s  .  c  om*/
    if (!admin && !isDevelopment() && !canUsePortlet()) {
        VerticalLayout rightsMissingTab = new VerticalLayout();
        rightsMissingTab.setCaption("User Database Input");
        Label info = new Label(
                "Your account does not have the necessary rights to add new people to our database.\n"
                        + "If you think you should be able to do so, please contact us.",
                ContentMode.PREFORMATTED);
        rightsMissingTab.addComponent(info);
        options.addTab(rightsMissingTab, "Information");
        options.setSelectedTab(rightsMissingTab);
        options.setEnabled(false);

    } else {

        affiMap = dbControl.getAffiliationMap();
        personMap = dbControl.getPersonMap();
        Set<String> instituteNames = dbControl.getInstituteNames();
        List<String> facultyEnums = dbControl.getPossibleEnumsForColumnsInTable("organizations", "faculty");
        List<String> affiliationRoles = dbControl.getPossibleEnumsForColumnsInTable("persons_organizations",
                "occupation");

        PersonInput addUserTab = new PersonInput(
                dbControl.getPossibleEnumsForColumnsInTable("persons", "title"), affiMap, affiliationRoles,
                new AffiliationInput(instituteNames, facultyEnums, personMap));
        options.addTab(addUserTab, "New Person");

        AffiliationInput addAffilTab = new AffiliationInput(instituteNames, facultyEnums, personMap);
        options.addTab(addAffilTab, "New Affiliation");

        SearchView searchView = new SearchView();
        options.addTab(searchView, "Search Entries");

        List<Affiliation> affiTable = dbControl.getAffiliationTable();
        Map<Integer, Tuple> affiPeople = new HashMap<Integer, Tuple>();
        for (Affiliation a : affiTable) {
            int id = a.getID();
            affiPeople.put(id, new Tuple(a.getContactPerson(), a.getHeadName()));
        }

        AffiliationVIPTab vipTab = new AffiliationVIPTab(personMap, affiMap, affiPeople);
        options.addTab(vipTab, "Edit Affiliation VIPs");

        MultiAffiliationTab multiAffilTab = new MultiAffiliationTab(personMap, affiMap, affiliationRoles);
        options.addTab(multiAffilTab, "Additional Person-Affiliations");
        if (!admin) {
            options.getTab(3).setEnabled(false);
            options.getTab(4).setEnabled(false);
        }

        String userID = "";
        if (LiferayAndVaadinUtils.isLiferayPortlet()) {
            logger.info("DB Tools running on Liferay, fetching user ID.");
            userID = LiferayAndVaadinUtils.getUser().getScreenName();
        } else {
            if (isDevelopment()) {
                logger.warn("Checks for local dev version successful. User is granted admin status.");
                userID = "admin";
            }
        }
        Map<String, ProjectInfo> userProjects = new HashMap<String, ProjectInfo>();

        List<Project> openbisProjects = new ArrayList<Project>();
        if (testMode) {
            openbisProjects = openbis.listProjects();
        } else {
            openbisProjects = openbis.getOpenbisInfoService()
                    .listProjectsOnBehalfOfUser(openbis.getSessionToken(), userID);
        }
        Map<String, ProjectInfo> allProjects = dbControl.getProjectMap();
        for (Project p : openbisProjects) {
            String projectID = p.getIdentifier();
            String code = p.getCode();
            if (allProjects.get(projectID) == null)
                userProjects.put(projectID, new ProjectInfo(p.getSpaceCode(), code, "", -1));
            else
                userProjects.put(projectID, allProjects.get(projectID));
        }

        ProjectView projectView = new ProjectView(userProjects.values(), openbis, personMap);
        options.addTab(projectView, "Projects");
        options.getTab(5).setEnabled(!userProjects.isEmpty());

        initPortletToDBFunctionality(addAffilTab, addUserTab, multiAffilTab, vipTab, searchView, projectView);
    }
}

From source file:roart.client.MyVaadinUI.java

private VerticalLayout getSearchTab() {
    VerticalLayout tab = new VerticalLayout();
    //tab.addComponent(tf);
    tab.setCaption("Search");
    String myindex = roart.util.Prop.getProp().getProperty(ConfigConstants.INDEX);
    if (myindex.equals(ConfigConstants.LUCENE)) {
        tab.addComponent(getSearch("Search standard", 0));
        tab.addComponent(getSearch("Search analyzing", 1));
        tab.addComponent(getSearch("Search complexphrase", 2));
        tab.addComponent(getSearch("Search extendable", 3));
        tab.addComponent(getSearch("Search multi", 4));
        tab.addComponent(getSearch("Search surround", 5));
        tab.addComponent(getSearch("Search classic", 6));
        tab.addComponent(getSearch("Search simple", 7));
    } else {/*from   w w  w. ja v a2s . c o m*/
        tab.addComponent(getSearch("Search default", 0));
        tab.addComponent(getSearch("Search lucene", 1));
        tab.addComponent(getSearch("Search complexphrase", 2));
        tab.addComponent(getSearch("Search surround", 3));
        tab.addComponent(getSearch("Search simple", 4));
    }
    return tab;
}

From source file:roart.client.MyVaadinUI.java

private VerticalLayout getControlPanelTab() {
    VerticalLayout tab = new VerticalLayout();
    tab.setCaption("Control Panel");
    HorizontalLayout horNewInd = new HorizontalLayout();
    horNewInd.setHeight("20%");
    horNewInd.setWidth("90%");
    Button fsIndexNew = getFsIndexNew();
    horNewInd.addComponent(fsIndexNew);// ww  w .  j a  v a2  s .  com
    horNewInd.setComponentAlignment(fsIndexNew, Alignment.BOTTOM_LEFT);
    horNewInd.addComponent(getFsIndexNewPath());
    horNewInd.addComponent(getFsIndexNewMd5());
    HorizontalLayout horNew = new HorizontalLayout();
    horNew.setHeight("20%");
    horNew.setWidth("60%");
    Button fsAddNew = getFsAddNew();
    horNew.addComponent(fsAddNew);
    horNew.setComponentAlignment(fsAddNew, Alignment.BOTTOM_LEFT);
    horNew.addComponent(getFsAddNewPath());
    HorizontalLayout horInd = new HorizontalLayout();
    horInd.setHeight("20%");
    horInd.setWidth("90%");
    Button indexNew = getIndexNew();
    horInd.addComponent(indexNew);
    horInd.setComponentAlignment(indexNew, Alignment.BOTTOM_LEFT);
    horInd.addComponent(getIndexNewPath());
    HorizontalLayout horIndSuf = new HorizontalLayout();
    horIndSuf.setHeight("20%");
    horIndSuf.setWidth("90%");
    horIndSuf.addComponent(getIndexSuffix());
    horIndSuf.addComponent(getReindexSuffix());
    HorizontalLayout horReindex = new HorizontalLayout();
    horReindex.setHeight("20%");
    horReindex.setWidth("90%");
    horReindex.addComponent(getReindex());
    horReindex.addComponent(getReindexDateLower());
    horReindex.addComponent(getReindexDateHigher());
    HorizontalLayout horReindex2 = new HorizontalLayout();
    horReindex2.setHeight("20%");
    horReindex2.setWidth("90%");
    horReindex2.addComponent(getReindexLanguage());
    horReindex2.addComponent(getReindexConfiguredLanguage());
    HorizontalLayout horClean = new HorizontalLayout();
    horClean.setHeight("20%");
    horClean.setWidth("60%");
    horClean.addComponent(getConsistent());
    horClean.addComponent(getConsistentCleanup());
    HorizontalLayout horStat = new HorizontalLayout();
    horStat.setHeight("20%");
    horStat.setWidth("90%");
    horStat.addComponent(getNotIndexed());
    horStat.addComponent(getMemoryUsage());
    horStat.addComponent(getOverlapping());
    HorizontalLayout horDb = new HorizontalLayout();
    horDb.setHeight("20%");
    horDb.setWidth("60%");
    horDb.addComponent(getDbItem());
    horDb.addComponent(getDbSearch());

    HorizontalLayout horConfig = new HorizontalLayout();
    horConfig.setHeight("20%");
    horConfig.setWidth("60%");
    horConfig.addComponent(getConfigValue(ControlService.Config.FAILEDLIMIT));
    horConfig.addComponent(getConfigValue(ControlService.Config.INDEXLIMIT));
    horConfig.addComponent(getConfigValue(ControlService.Config.REINDEXLIMIT));
    horConfig.addComponent(getConfigValue(ControlService.Config.TIKATIMEOUT));
    horConfig.addComponent(getConfigValue(ControlService.Config.OTHERTIMEOUT));

    /*
    tab.addComponent(getCleanup());
    tab.addComponent(getCleanup2());
    tab.addComponent(getCleanupfs());
    */

    tab.addComponent(horNewInd);
    tab.addComponent(horNew);
    tab.addComponent(horInd);
    tab.addComponent(horIndSuf);
    tab.addComponent(horReindex);
    tab.addComponent(horReindex2);
    tab.addComponent(horClean);
    tab.addComponent(horStat);
    tab.addComponent(horDb);
    tab.addComponent(horConfig);
    return tab;
}

From source file:roart.client.MyVaadinUI.java

@SuppressWarnings("rawtypes")
public void displayResultLists(List<List> lists) {
    VerticalLayout tab = new VerticalLayout();
    tab.setCaption("Search results");

    VerticalLayout result = getResultTemplate();
    if (lists != null) {
        for (List<ResultItem> list : lists) {
            addListTable(result, list);/*ww  w  .  jav a 2s .c  o m*/
        }
    }
    tab.addComponent(result);

    tabsheet.addComponent(tab);
    tabsheet.getTab(tab).setClosable(true);

    //System.out.println("setcont" +this);
    //getSession().getLockInstance().lock();
    //setContent(result);
    //getSession().getLockInstance().unlock();
}

From source file:roart.client.MyVaadinUI.java

@SuppressWarnings("rawtypes")
public void displayResultListsTab(List<List> lists) {
    VerticalLayout tab = new VerticalLayout();
    tab.setCaption("Results");

    VerticalLayout result = getResultTemplate();
    if (lists != null) {
        for (List<ResultItem> list : lists) {
            addListTable(result, list);//from w ww .  j a  v  a  2 s  .  c om
        }
    }
    tab.addComponent(result);

    tabsheet.addComponent(tab);
    tabsheet.getTab(tab).setClosable(true);
    Notification.show("New result available");
}

From source file:rs.superb.apps.inventory.components.UI.clients.mol.AccordionMenu.java

private void createTabs(String[] mainMenuItems) {
    for (String mainMenuItem : mainMenuItems) {
        VerticalLayout vl = new VerticalLayout();
        vl.setMargin(true);/*w  w  w.  jav  a 2 s .  c o  m*/
        vl.setSpacing(true);
        vl.setCaption(mainMenuItem);
        addComponent(vl);

        for (Button subMenuButton : mainMenu.get(mainMenuItem)) {
            subMenuButton.setStyleName(BUTTON_STYLE1);
            subMenuButton.setWidth("80%");
            subMenuButton.setHeight("90px");

            vl.addComponent(subMenuButton);
            vl.setComponentAlignment(subMenuButton, Alignment.MIDDLE_CENTER);
        }

        subMenuButtons0.get(0).addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(Button.ClickEvent event) {
                Window w = new Window("Click" + subMenuButtons0.get(0).getCaption());
                w.setWidth(66, Unit.PERCENTAGE);
                w.setHeight(66, Unit.PERCENTAGE);
                w.center();
                UI.getCurrent().addWindow(w);
            }
        });
        subMenuButtons0.get(1).addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(Button.ClickEvent event) {
                UI.getCurrent().getNavigator().navigateTo(GodPopis_View.VIEW_ID);
            }
        });
    }
}

From source file:ru.codeinside.gses.webui.components.ProcessDefinitionShowUi.java

License:Mozilla Public License

private Component createAccessList(Set<Expression> candidateUserIdExpressions,
        Set<Expression> candidateGroupIdExpressions) {
    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);//from   w ww . j a  va  2s  .c o  m

    if (!candidateUserIdExpressions.isEmpty()) {
        VerticalLayout usersList = new VerticalLayout();
        usersList.setCaption(":");
        for (Expression e : candidateUserIdExpressions) {
            String fio = getUserFio(e);
            String formatted = StringUtils.isEmpty(fio) ? "" : ("(" + fio + ")");
            usersList.addComponent(new Label(e.getExpressionText() + formatted + " "));
        }
        layout.addComponent(usersList);
    }
    if (!candidateGroupIdExpressions.isEmpty()) {
        VerticalLayout groupsList = new VerticalLayout();
        groupsList.setCaption(":");
        for (Expression e : candidateGroupIdExpressions) {
            groupsList.addComponent(new Label(e.getExpressionText()));
        }
        layout.addComponent(groupsList);
    }
    return layout;
}

From source file:steps.ConditionInstanceStep.java

License:Open Source License

/**
 * Create a new Condition Step for the wizard
 * /* www . j  av a 2 s .c o  m*/
 * @param options Set of different conditions available e.g. different species
 * @param optionName Title of the options selection e.g. Species
 * @param stepName Title of this step e.g. Extraction Conditions
 */
public ConditionInstanceStep(Set<String> options, String optionName, String stepName) {
    main = new VerticalLayout();
    main.setSpacing(true);
    main.setMargin(true);
    instances = new TabSheet();
    instances.setStyleName(ValoTheme.TABSHEET_FRAMED);
    main.addComponent(instances);
    preview = new Table();
    preview.addContainerProperty("Factors", String.class, null);
    preview.addContainerProperty("Samples", TextField.class, null);
    preview.setStyleName(Styles.tableTheme);
    VerticalLayout frame = new VerticalLayout();
    frame.setCaption("Preview of Combinations");
    frame.addComponent(preview);
    previewFrame = new CustomVisibilityComponent(frame);
    previewFrame.setVisible(false);

    main.addComponent(Styles.questionize(previewFrame,
            "This table shows a preview of the number and type of samples "
                    + "that will be created in the next step. You can change the number of samples for each "
                    + "group of samples. For example, if one variable combination is not in the experiment at all, set it to 0.",
            "Preview"));

    this.options = options;
    this.optionName = optionName;
    this.stepName = stepName;
    factorInstances = new ArrayList<ConditionPropertyPanel>();
    optionInstances = new ArrayList<FactorOptionBox>();
    permutations = new LinkedHashMap<Object, Integer>();
}

From source file:uicomponents.BarcodePreviewComponent.java

License:Open Source License

public BarcodePreviewComponent(SampleToBarcodeFieldTranslator translator) {
    this.translator = translator;
    setSpacing(true);/*w  ww. java2s.  co  m*/
    setMargin(true);

    Resource res = new ThemeResource("img/qrtest.png");
    Image qr = new Image(null, res);
    qr.setHeight("140px");
    qr.setWidth("140px");
    Image qr2 = new Image(null, res);
    qr2.setHeight("140px");
    qr2.setWidth("140px");

    code = new TextField();
    info1 = new TextField();
    info2 = new TextField();

    codedName = new OptionGroup("Put ID on sticker:");
    codedName.addItems(Arrays.asList("QBiC ID", "Lab ID", "Secondary Name"));
    codedName.setImmediate(true);
    codedName.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    codedName.select("QBiC ID");

    code.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    code.setWidth("200px");
    code.addStyleName("barcode-large");

    styleInfoField(info1);
    styleInfoField(info2);
    styleInfoField(qbicInfo);

    VerticalLayout box = new VerticalLayout();
    box.setHeight("110px");
    box.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    box.addComponent(code);
    box.addComponent(info1);
    box.addComponent(info2);
    box.addComponent(qbicInfo);
    box.setWidth("190px");

    HorizontalLayout test = new HorizontalLayout();
    test.setSizeFull();
    test.addComponent(qr);
    test.addComponent(box);
    test.addComponent(qr2);

    setFieldsReadOnly(true);
    List<String> options = new ArrayList<String>(Arrays.asList("Tissue/Extr. Material", "Secondary Name",
            "QBiC ID", "Lab ID", "MHC Type", "Used Antibody"));
    select1 = new ComboBox("First Info", options);
    select1.setStyleName(Styles.boxTheme);
    select1.setImmediate(true);
    select1.select("Tissue/Extr. Material");
    select2 = new ComboBox("Second Info", options);
    select2.select("Secondary Name");
    select2.setImmediate(true);
    select2.setStyleName(Styles.boxTheme);

    ValueChangeListener vc = new ValueChangeListener() {

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

        @Override
        public void valueChange(ValueChangeEvent event) {
            refresh();
        }
    };
    codedName.addValueChangeListener(vc);
    select1.addValueChangeListener(vc);
    select2.addValueChangeListener(vc);

    HorizontalLayout designBox = new HorizontalLayout();
    designBox.addComponent(select1);
    designBox.addComponent(select2);
    designBox.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    designBox.setSpacing(true);

    VerticalLayout previewBox = new VerticalLayout();
    previewBox.setStyleName(ValoTheme.LAYOUT_CARD);
    previewBox.setCaption("Barcode Example");
    previewBox.addComponent(test);

    addComponent(previewBox);
    addComponent(codedName);
    addComponent(designBox);

    //    overwrite = new CheckBox("Overwrite existing Tube Barcode Files");
    //    addComponent(ProjectwizardUI.questionize(overwrite,
    //        "Overwrites existing files of barcode stickers. This is useful when "
    //            + "the design was changed after creating them.", "Overwrite Sticker Files"));
}