Example usage for com.vaadin.ui TabSheet TabSheet

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

Introduction

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

Prototype

public TabSheet() 

Source Link

Document

Constructs a new TabSheet.

Usage

From source file:v7cr.TopPageWindow.java

License:Open Source License

private void initUI(V7CR app) {
    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();//  w  w w  .ja va2s  .c o  m
    vl.addComponent(createToolbar(app));
    TabSheet main = new TabSheet();
    vl.addComponent(main);
    vl.setExpandRatio(main, 1);

    Map<String, Role> roles = app.getRoles();
    if (roles.containsKey("admin")) {
        main.addTab(new RoleEditor(app));
        main.addTab(new UserEditor(app));
        main.addTab(new ProjectEditor(app));
    }
    for (String r : roles.keySet()) {
        if (r.startsWith("project:")) {
            String p = r.substring(8);
            main.addTab(new ReviewList(p));
        }
    }
    addComponent(vl);
}

From source file:VaadinIRC.GUI.VaadinIrcGUI.java

License:Open Source License

/**
 * Initializes the application with given window (primary just sets up the GUI, tabs and such)
 * @param window Reference to window./*from   w  w w  .java2s.  c om*/
 */
public void init(Window window) {
    this.window = window;
    channelTabs = new TabSheet();
    channelTabs.setImmediate(true);
    createIrcView();
}

From source file:views.AdminView.java

License:Open Source License

public AdminView(IOpenBisClient openbis, DBVocabularies vocabularies,
        OpenbisCreationController creationController, String user) {
    this.user = user;
    this.registrator = creationController;
    this.openbis = openbis;
    tabs = new TabSheet();
    tabs.setStyleName(ValoTheme.TABSHEET_FRAMED);

    VerticalLayout spaceView = new VerticalLayout();
    spaceView.setSpacing(true);/*  w ww.j  a  v  a2  s .c o m*/
    spaceView.setMargin(true);
    space = new TextField("Space");
    space.setWidth("300px");
    space.setStyleName(Styles.fieldTheme);
    users = new TextArea("Users");
    users.setStyleName(Styles.areaTheme);
    users.setWidth("100px");
    users.setHeight("100px");
    createSpace = new Button("Create Space");
    spaceView.addComponent(space);
    spaceView.addComponent(Styles.questionize(users,
            "Users must exist in openBIS, otherwise the space cannot be created!", "Add Users to Space"));
    spaceView.addComponent(createSpace);
    tabs.addTab(spaceView, "Create Space");

    // METADATA
    //    metadataUpload = new MetadataUploadView(openbis, vocabularies);
    //    tabs.addTab(metadataUpload, "Update Metadata");

    // MULTISCALE
    addMultiScale = new MCCView(openbis, creationController, user);
    addMultiScale.setSpacing(true);
    addMultiScale.setMargin(true);

    tabs.addTab(addMultiScale, "Add Multiscale Samples");

    addComponent(tabs);

    initButtons();
}

From source file:views.MetadataUploadView.java

License:Open Source License

public MetadataUploadView(IOpenBisClient openbis, DBVocabularies vocabularies, boolean overWriteAllowed) {
    allowedSpaces = new HashSet<String>(vocabularies.getSpaces());
    this.overWriteAllowed = overWriteAllowed;
    sheet = new TabSheet();
    sampleTables = new ArrayList<Table>();

    Map<String, String> taxMap = vocabularies.getTaxMap();
    Map<String, String> tissueMap = vocabularies.getTissueMap();

    propToVocabulary = new HashMap<String, Map<String, String>>();
    propToVocabulary.put("Q_NCBI_ORGANISM", taxMap);
    propToVocabulary.put("Q_PRIMARY_TISSUE", tissueMap);

    Map<String, String> reverseTaxMap = new HashMap<String, String>();
    for (Map.Entry<String, String> entry : taxMap.entrySet()) {
        reverseTaxMap.put(entry.getValue(), entry.getKey());
    }//from   w  w  w. ja v  a2s .co  m
    Map<String, String> reverseTissueMap = new HashMap<String, String>();
    for (Map.Entry<String, String> entry : tissueMap.entrySet()) {
        reverseTissueMap.put(entry.getValue(), entry.getKey());
    }
    propToReverseVocabulary = new HashMap<String, Map<String, String>>();
    propToReverseVocabulary.put("Q_NCBI_ORGANISM", reverseTaxMap);
    propToReverseVocabulary.put("Q_PRIMARY_TISSUE", reverseTissueMap);

    this.openbis = openbis;
    setSpacing(true);
    setMargin(true);
    addComponent(typeOfData);
    upload = new UploadComponent("Upload Metadata (tab-separated)", "Upload", ProjectwizardUI.tmpFolder,
            "meta_", 200000);
    upload.setVisible(false);
    addComponent(upload);
    reload = new Button("Reset columns");
    reload.setVisible(false);
    addComponent(reload);
    reload.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                parseTSV(upload.getFile());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    });

    send = new Button("Send to Database");
    send.setEnabled(false);
    initListeners();
}

From source file:views.TableOverview.java

License:Open Source License

public TableOverview(List<Person> personData, List<Affiliation> affiliationData) {
    tabs = new TabSheet();

    persons = new Table("People");
    persons.setStyleName(ValoTheme.TABLE_SMALL);
    //    persons.addContainerProperty("ID", Integer.class, null);
    //    persons.addContainerProperty("User", String.class, null);
    persons.addContainerProperty("Title", String.class, null);
    persons.addContainerProperty("First", String.class, null);
    persons.addContainerProperty("Last", String.class, null);
    persons.addContainerProperty("eMail", String.class, null);
    persons.addContainerProperty("Phone", String.class, null);
    persons.addContainerProperty("Affiliation", String.class, null);
    persons.addContainerProperty("Role", String.class, null);
    tabs.addTab(persons, "People");

    affiliations = new Table("Affiliations");
    affiliations.setStyleName(ValoTheme.TABLE_SMALL);
    //    affiliations.addContainerProperty("ID", Integer.class, null);
    affiliations.addContainerProperty("group", String.class, null);
    // affiliations.addContainerProperty("acronym", String.class, null);
    affiliations.addContainerProperty("organization", String.class, null);
    affiliations.addContainerProperty("institute", String.class, null);
    affiliations.addContainerProperty("faculty", String.class, null);
    // affiliations.addContainerProperty("contactPerson", String.class, null);
    affiliations.addContainerProperty("street", String.class, null);
    affiliations.addContainerProperty("zipCode", String.class, null);
    // affiliations.addContainerProperty("city", String.class, null);
    // affiliations.addContainerProperty("country", String.class, null);
    // affiliations.addContainerProperty("webpage", String.class, null);
    tabs.addTab(affiliations, "Organizations");
    addComponent(tabs);//from ww w.  j  a  v a2s  .  c om

    for (int i = 0; i < personData.size(); i++) {
        int itemId = i;
        List<Object> row = new ArrayList<Object>();
        Person p = personData.get(i);
        //      row.add(p.getID());
        //      row.add(p.getUsername());
        row.add(p.getTitle());
        row.add(p.getFirst());
        row.add(p.getLast());
        row.add(p.geteMail());
        row.add(p.getPhone());
        RoleAt a = p.getOneAffiliationWithRole();
        row.add(a.getAffiliation());
        row.add(a.getRole());
        // String affs = StringUtils.join(p.getAffiliationInfos().values(), ",");
        // row.add(affs);
        persons.addItem(row.toArray(new Object[row.size()]), itemId);
    }
    persons.setPageLength(persons.size());

    for (int i = 0; i < affiliationData.size(); i++) {
        int itemId = i;
        List<Object> row = new ArrayList<Object>();
        Affiliation a = affiliationData.get(i);
        //      row.add(a.getID());
        row.add(a.getGroupName());
        // row.add(a.getAcronym());
        row.add(a.getOrganization());
        row.add(a.getInstitute());
        row.add(a.getFaculty());
        // row.add(a.getContactPerson());
        row.add(a.getStreet());
        row.add(a.getZipCode());
        // row.add(a.getCity());
        // row.add(a.getCountry());
        // row.add(a.getWebpage());
        affiliations.addItem(row.toArray(new Object[row.size()]), itemId);
    }
    affiliations.setPageLength(affiliationData.size());
}

From source file:views.WizardBarcodeView.java

License:Open Source License

/**
 * Creates a new component view for barcode creation
 * //from  w  w  w  .ja  va  2  s. c  o  m
 * @param spaces List of available openBIS spaces
 * @param isAdmin
 * @param gen
 */
public WizardBarcodeView(List<String> spaces, boolean isAdmin, SampleFilterGenerator gen) {
    VerticalLayout left = new VerticalLayout();
    VerticalLayout right = new VerticalLayout();
    initSampleTable(gen);
    right.addComponent(sampleTable);

    left.setSpacing(true);
    left.setMargin(true);
    right.setSpacing(true);
    right.setMargin(true);

    SampleToBarcodeFieldTranslator translator = new SampleToBarcodeFieldTranslator();
    this.isAdmin = isAdmin;

    spaceBox = new ComboBox("Project", spaces);
    spaceBox.setStyleName(Styles.boxTheme);
    spaceBox.setFilteringMode(FilteringMode.CONTAINS);
    spaceBox.setNullSelectionAllowed(false);
    spaceBox.setImmediate(true);

    projectBox = new ComboBox("Sub-Project");
    projectBox.setStyleName(Styles.boxTheme);
    projectBox.setEnabled(false);
    projectBox.setImmediate(true);
    projectBox.setNullSelectionAllowed(false);

    left.addComponent(Styles.questionize(spaceBox, "Name of the project", "Project Name"));
    left.addComponent(Styles.questionize(projectBox, "QBiC project code and project name", "Sub-Project"));

    initExperimentTable();
    left.addComponent(Styles.questionize(experimentTable,
            "This table gives an overview of tissue samples and extracted materials"
                    + " for which barcodes can be printed. You can select one or multiple rows.",
            "Sample Overview"));

    sortby = new OptionGroup("Sort Barcode Sheet/Stickers By");
    sortby.addItems(SortBy.values());
    sortby.setValue(SortBy.BARCODE_ID);
    left.addComponent(sortby);

    sheetPreview = new SheetOptionComponent(translator);
    tubePreview = new BarcodePreviewComponent(translator);

    tabs = new TabSheet();
    tabs.setStyleName(ValoTheme.TABSHEET_FRAMED);
    tabs.addTab(sheetPreview, "Sample Sheet");
    tabs.addTab(tubePreview, "Barcode Stickers");
    tabsTab = new CustomVisibilityComponent(tabs);
    tabsTab.setVisible(false);
    left.addComponent(Styles.questionize(tabsTab, "Prepare an A4 sample sheet or barcodes for sample tubes.",
            "Barcode Preparation"));

    info = new Label();
    bar = new ProgressBar();
    bar.setVisible(false);
    left.addComponent(info);
    left.addComponent(bar);

    prepareBarcodes = new Button("Prepare Barcodes");
    prepareBarcodes.setEnabled(false);
    left.addComponent(prepareBarcodes);

    printerSelection = new ComboBox("Printer");
    printerSelection.setVisible(isAdmin);
    printerSelection.setWidth("300px");
    printerSelection.setStyleName(Styles.boxTheme);
    printerSelection.setVisible(false);
    printerSelection.setNullSelectionAllowed(false);
    left.addComponent(printerSelection);

    printTubeCodes = new Button("Print Barcodes");
    printTubeCodes.setVisible(isAdmin);
    printTubeCodes.setEnabled(false);
    left.addComponent(printTubeCodes);

    download = new Button("Download");
    download.setEnabled(false);
    left.addComponent(download);
    addComponent(left);
    addComponent(right);
    disablePreview();
}