Example usage for com.vaadin.ui Panel setSizeFull

List of usage examples for com.vaadin.ui Panel setSizeFull

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:com.piccritic.website.post.CreatePost.java

/**
 * This window is responsible for creating a post form with an @see Upload
 * component a post will only be uploaded if a picture, a title and a
 * description./*from  w  w  w  .  ja  v  a  2s  . co  m*/
 * 
 * @param handle user that is creating the post
 */
public CreatePost(String handle) {
    this.handle = handle;
    setSizeFull();
    setModal(true);
    Panel layout = new Panel();
    layout.setSizeFull();
    setContent(layout);
    layout.setContent(form);
    if (handle == null) {
        close();
    }

    image.setVisible(false);
    image.setSizeFull();
    image.setHeightUndefined();

    form.setMargin(true);
    form.addComponent(title);
    form.addComponent(image);
    form.addComponent(description);
    form.addComponent(tags);
    form.addComponent(license);
    form.getComponent(0);
    title.setSizeFull();
    description.setSizeFull();

    confirm.setEnabled(false);
    description.setRequired(true);

    title.setRequired(true);
    setupImagereceiver();
}

From source file:com.save.global.ErrorLoggedNotification.java

public static void showWarningLoggedOnWindow(String warning, String className) {
    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();/*from w w w.  j a  va  2  s . c o  m*/
    v.setMargin(true);

    Window sub = new Window("WARNING MESSAGE!");
    sub.setWidth("500px");
    if (sub.getParent() == null) {
        UI.getCurrent().addWindow(sub);
    }
    sub.setModal(true);

    Panel panel = new Panel();
    panel.setSizeFull();
    panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
    panel.setContent(new Label(warning + " on \n" + className, ContentMode.HTML));
    panel.getContent().setHeightUndefined();
    v.addComponent(panel);

    sub.setContent(v);
    sub.getContent().setHeightUndefined();
}

From source file:com.selzlein.lojavirtual.vaadin.page.SettingsView.java

License:Open Source License

private VerticalLayout createSubstitutionSection() {
    VerticalLayout substitution = new VerticalLayout();
    substitution.addStyleName("l-substitutes");
    substitution.setSpacing(true);//ww w  .  j a v a  2s .c  o  m
    substitution.setSizeFull();

    Label substitutionHeader = new Label("<h2>" + ui.getMessage("settings.substitutionSection") + "</h2>",
            ContentMode.HTML);
    substitution.addComponent(substitutionHeader);

    Label substitutionHelp = new Label(ui.getMessage("settings.substitutionHelp"));
    substitutionHelp.setStyleName("form-help");
    substitution.addComponent(substitutionHelp);

    this.substitutionActive = new CheckBox(ui.getMessage("settings.substitutionActive"));
    substitutionActive.addStyleName("ui-spacing");
    substitutionActive.setValue(user.isSubstitutionActive());
    substitution.addComponent(substitutionActive);

    //substitutes
    selectedPersons = user.getDirectSubstitutes();
    this.substitutes = new OptionGroup(ui.getMessage("settings.substitutes"));
    refreshSubstitutes("");

    TextField substituteFilter = new TextField(ui.getMessage("action.filter"));
    substituteFilter.addValueChangeListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            substitutes.removeAllItems();
            refreshSubstitutes(event.getProperty().getValue().toString());
        }
    });
    substitution.addComponent(substituteFilter);
    Panel substitutesPanel = new Panel();
    substitutesPanel.addStyleName("l-border-none");
    substitutesPanel.setSizeFull();
    substitutesPanel.setContent(substitutes);
    substitution.addComponent(substitutesPanel);
    substitution.setExpandRatio(substitutesPanel, 2);

    return substitution;
}

From source file:cz.opendata.linked.lodcloud.loader.LoaderDialog.java

@Override
protected void buildDialogLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);//  w  w  w  . j  a  v  a  2  s .  c  o  m
    mainLayout.setSizeUndefined();
    mainLayout.setWidth("100%");
    //mainLayout.setHeight("-1px");
    mainLayout.setMargin(false);
    //mainLayout.setSpacing(true);

    // top-level component properties
    setWidth("100%");
    setHeight("100%");

    tfRestApiUrl = new TextField();
    tfRestApiUrl.setWidth("100%");
    tfRestApiUrl.setCaption("CKAN Rest API URL");
    tfRestApiUrl.setInputPrompt("http://datahub.io/api/rest/dataset");
    mainLayout.addComponent(tfRestApiUrl);

    tfApiKey = new PasswordField();
    tfApiKey.setWidth("100%");
    tfApiKey.setCaption("CKAN API Key");
    tfApiKey.setDescription("CKAN API Key");
    tfApiKey.setInputPrompt("00000000-0000-0000-0000-000000000000");
    mainLayout.addComponent(tfApiKey);

    tfDatasetID = new TextField();
    tfDatasetID.setImmediate(true);
    tfDatasetID.setWidth("100%");
    tfDatasetID.setTextChangeEventMode(TextChangeEventMode.EAGER);
    tfDatasetID.setCaption("Dataset ID");
    tfDatasetID.setDescription("CKAN Dataset Name used in CKAN Dataset URL");
    tfDatasetID.setInputPrompt("cz-test");
    tfDatasetID.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -8684376114117545707L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            String url = "http://datahub.io/api/rest/dataset/" + tfDatasetID.getValue();
            lblRestApiUrl.setValue("<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>");
        }
    });
    mainLayout.addComponent(tfDatasetID);

    lblRestApiUrl = new Label();
    lblRestApiUrl.setContentMode(ContentMode.HTML);
    mainLayout.addComponent(lblRestApiUrl);

    tfOwnerOrg = new TextField();
    tfOwnerOrg.setWidth("100%");
    tfOwnerOrg.setCaption("Owner CKAN organization ID");
    tfOwnerOrg.setInputPrompt("00000000-0000-0000-0000-000000000000");
    mainLayout.addComponent(tfOwnerOrg);

    tfShortName = new TextField();
    tfShortName.setWidth("100%");
    tfShortName.setCaption("Dataset short name - for LOD cloud circle label");
    tfShortName.setInputPrompt("CZ IC");
    mainLayout.addComponent(tfShortName);

    cbTopic = new ComboBox();
    cbTopic.setWidth("100%");
    cbTopic.setCaption("Topic");
    cbTopic.setDescription("Topic is used for coloring of the LOD cloud");
    for (LoaderConfig.Topics topic : LoaderConfig.Topics.values()) {
        cbTopic.addItem(topic);
    }
    cbTopic.setInvalidAllowed(false);
    cbTopic.setNullSelectionAllowed(false);
    cbTopic.setTextInputAllowed(false);
    mainLayout.addComponent(cbTopic);

    tfMaintainerName = new TextField();
    tfMaintainerName.setWidth("100%");
    tfMaintainerName.setCaption("Maintainer name");
    tfMaintainerName.setInputPrompt("Jakub Klmek");
    mainLayout.addComponent(tfMaintainerName);

    tfMaintainerEmail = new TextField();
    tfMaintainerEmail.setWidth("100%");
    tfMaintainerEmail.setCaption("Maintainer email");
    tfMaintainerEmail.setInputPrompt("klimek@opendata.cz");
    mainLayout.addComponent(tfMaintainerEmail);

    tfAuthorName = new TextField();
    tfAuthorName.setWidth("100%");
    tfAuthorName.setCaption("Author name");
    tfAuthorName.setInputPrompt("Jakub Klmek");
    mainLayout.addComponent(tfAuthorName);

    tfAuthorEmail = new TextField();
    tfAuthorEmail.setWidth("100%");
    tfAuthorEmail.setCaption("Author email");
    tfAuthorEmail.setInputPrompt("klimek@opendata.cz");
    mainLayout.addComponent(tfAuthorEmail);

    tfVersion = new TextField();
    tfVersion.setWidth("100%");
    tfVersion.setCaption("Version");
    tfVersion.setInputPrompt("2014-03-01");
    mainLayout.addComponent(tfVersion);

    chkGenerateVersion = new CheckBox();
    chkGenerateVersion.setCaption("Generate Version as current date");
    chkGenerateVersion.setImmediate(true);
    chkGenerateVersion.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 7348068985822592639L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfVersion.setEnabled(!chkGenerateVersion.getValue());
        }
    });
    mainLayout.addComponent(chkGenerateVersion);

    cbLicense = new ComboBox();
    cbLicense.setWidth("100%");
    cbLicense.setCaption("License");
    cbLicense.setDescription("License displayed in CKAN");
    for (LoaderConfig.Licenses license : LoaderConfig.Licenses.values()) {
        cbLicense.addItem(license);
    }
    cbLicense.setImmediate(true);
    cbLicense.setInvalidAllowed(false);
    cbLicense.setTextInputAllowed(false);
    cbLicense.setNullSelectionAllowed(false);
    cbLicense.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -5553056221069512526L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            LoaderConfig.Licenses l = (Licenses) cbLicense.getValue();
            boolean enabled = false;
            enabled = enabled || l == LoaderConfig.Licenses.otherat;
            enabled = enabled || l == LoaderConfig.Licenses.otherclosed;
            enabled = enabled || l == LoaderConfig.Licenses.othernc;
            enabled = enabled || l == LoaderConfig.Licenses.otheropen;
            enabled = enabled || l == LoaderConfig.Licenses.otherpd;
        }
    });

    mainLayout.addComponent(cbLicense);

    tfSPARQLName = new TextField();
    tfSPARQLName.setWidth("100%");
    tfSPARQLName.setCaption("SPARQL Endpoint name");
    tfSPARQLName.setInputPrompt("Opendata.cz SPARQL Endpoint");
    mainLayout.addComponent(tfSPARQLName);

    tfSPARQLDescription = new TextField();
    tfSPARQLDescription.setWidth("100%");
    tfSPARQLDescription.setCaption("SPARQL Endpoint description");
    tfSPARQLDescription.setInputPrompt("Running Virtuoso 7");
    mainLayout.addComponent(tfSPARQLDescription);

    tfNamespace = new TextField();
    tfNamespace.setWidth("100%");
    tfNamespace.setCaption("RDF namespace");
    tfNamespace.setInputPrompt("http://linked.opendata.cz/resource/");
    mainLayout.addComponent(tfNamespace);

    lsLicenseMetadataTag = new ListSelect();
    lsLicenseMetadataTag.setWidth("100%");
    lsLicenseMetadataTag.setCaption("License metadata");
    lsLicenseMetadataTag.setDescription("Switches between license-metadata and no-license-metadata tags");
    for (LoaderConfig.LicenseMetadataTags lmdTag : LoaderConfig.LicenseMetadataTags.values()) {
        lsLicenseMetadataTag.addItem(lmdTag);
    }
    lsLicenseMetadataTag.setNewItemsAllowed(false);
    lsLicenseMetadataTag.setMultiSelect(false);
    lsLicenseMetadataTag.setNullSelectionAllowed(false);
    lsLicenseMetadataTag.setRows(LoaderConfig.LicenseMetadataTags.values().length);
    mainLayout.addComponent(lsLicenseMetadataTag);

    lsProvenanceMetadataTag = new ListSelect();
    lsProvenanceMetadataTag.setWidth("100%");
    lsProvenanceMetadataTag.setCaption("Provenance metadata");
    lsProvenanceMetadataTag
            .setDescription("Switches between provenance-metadata and no-provenance-metadata tags");
    for (LoaderConfig.ProvenanceMetadataTags pmdTag : LoaderConfig.ProvenanceMetadataTags.values()) {
        lsProvenanceMetadataTag.addItem(pmdTag);
    }
    lsProvenanceMetadataTag.setNewItemsAllowed(false);
    lsProvenanceMetadataTag.setMultiSelect(false);
    lsProvenanceMetadataTag.setNullSelectionAllowed(false);
    lsProvenanceMetadataTag.setRows(LoaderConfig.ProvenanceMetadataTags.values().length);
    mainLayout.addComponent(lsProvenanceMetadataTag);

    lsPublishedTag = new ListSelect();
    lsPublishedTag.setWidth("100%");
    lsPublishedTag.setCaption("Publised by");
    lsPublishedTag.setDescription("Switches between published-by-producer and published-by-third-party tags");
    for (LoaderConfig.PublishedTags pTag : LoaderConfig.PublishedTags.values()) {
        lsPublishedTag.addItem(pTag);
    }
    lsPublishedTag.setNewItemsAllowed(false);
    lsPublishedTag.setMultiSelect(false);
    lsPublishedTag.setNullSelectionAllowed(false);
    lsPublishedTag.setRows(LoaderConfig.PublishedTags.values().length);
    mainLayout.addComponent(lsPublishedTag);

    lsVocabTag = new ListSelect();
    lsVocabTag.setWidth("100%");
    lsVocabTag.setCaption("Proprietary vocabulary");
    lsVocabTag.setDescription("Switches among no-proprietary-vocab deref-vocab and no-deref-vocab tags");
    for (LoaderConfig.VocabTags vTag : LoaderConfig.VocabTags.values()) {
        lsVocabTag.addItem(vTag);
    }
    lsVocabTag.setNewItemsAllowed(false);
    lsVocabTag.setImmediate(true);
    lsVocabTag.setMultiSelect(false);
    lsVocabTag.setNullSelectionAllowed(false);
    lsVocabTag.setRows(LoaderConfig.VocabTags.values().length);

    mainLayout.addComponent(lsVocabTag);

    lsVocabMappingsTag = new ListSelect();
    lsVocabMappingsTag.setWidth("100%");
    lsVocabMappingsTag.setCaption("Vocabulary mapping");
    lsVocabMappingsTag.setDescription(
            "Only valid when using proprietary vocabulary. Switches between vocab-mappings and no-vocab-mappings tags");
    for (LoaderConfig.VocabMappingsTags vmTag : LoaderConfig.VocabMappingsTags.values()) {
        lsVocabMappingsTag.addItem(vmTag);
    }
    lsVocabMappingsTag.setNewItemsAllowed(false);
    lsVocabMappingsTag.setMultiSelect(false);
    lsVocabMappingsTag.setNullSelectionAllowed(false);
    lsVocabMappingsTag.setRows(LoaderConfig.VocabMappingsTags.values().length);
    mainLayout.addComponent(lsVocabMappingsTag);

    lsAdditionalTags = new ListSelect();
    lsAdditionalTags.setRows(4);
    lsAdditionalTags.setWidth("100%");
    lsAdditionalTags.setCaption("Additional CKAN tags");
    lsAdditionalTags.setDescription("Custom CKAN tags in addition to the ones required for the LODCloud");
    lsAdditionalTags.setNewItemsAllowed(true);
    lsAdditionalTags.setNullSelectionAllowed(false);
    lsAdditionalTags.setMultiSelect(true);
    mainLayout.addComponent(lsAdditionalTags);

    chkLodcloudNolinks = new CheckBox();
    chkLodcloudNolinks.setCaption("Data set has no external RDF links to other datasets.");
    mainLayout.addComponent(chkLodcloudNolinks);

    chkLodcloudUnconnected = new CheckBox();
    chkLodcloudUnconnected.setCaption("Data set has no external RDF links to or from other datasets.");
    mainLayout.addComponent(chkLodcloudUnconnected);

    chkLodcloudNeedsFixing = new CheckBox();
    chkLodcloudNeedsFixing.setCaption("The dataset is currently broken.");
    mainLayout.addComponent(chkLodcloudNeedsFixing);

    chkLodcloudNeedsInfo = new CheckBox();
    chkLodcloudNeedsInfo
            .setCaption("The data provider or data set homepage do not provide mininum information.");
    mainLayout.addComponent(chkLodcloudNeedsInfo);

    chkLimitedSparql = new CheckBox();
    chkLimitedSparql.setCaption("Indicates whether the SPARQL endpoint is not serving the whole data set.");
    mainLayout.addComponent(chkLimitedSparql);

    lsVocabularies = new ListSelect();
    lsVocabularies.setRows(4);
    lsVocabularies.setWidth("100%");
    lsVocabularies.setCaption("Standard prefixes of vocabularies used");
    lsVocabularies.setDescription("Tags the dataset with used vocabulary prefixes. Lookup: http://prefix.cc");
    lsVocabularies.setNewItemsAllowed(true);
    lsVocabularies.setNullSelectionAllowed(false);
    lsVocabularies.setMultiSelect(true);
    mainLayout.addComponent(lsVocabularies);

    gtLinkCounts = new ComponentTable<LoaderConfig.LinkCount>(LoaderConfig.LinkCount.class,
            new ComponentTable.ColumnInfo("targetDataset", "Target CKAN dataset name", null, 0.4f),
            new ComponentTable.ColumnInfo("linkCount", "Link count", null, 0.1f));

    gtLinkCounts.setPolicy(new ComponentTable.Policy<LoaderConfig.LinkCount>() {

        @Override
        public boolean isSet(LoaderConfig.LinkCount value) {
            return !value.getTargetDataset().isEmpty();
        }

    });
    mainLayout.addComponent(gtLinkCounts);

    gtMappingFiles = new ComponentTable<LoaderConfig.MappingFile>(LoaderConfig.MappingFile.class,
            new ComponentTable.ColumnInfo("mappingFormat", "Mapping format", null, 0.1f),
            new ComponentTable.ColumnInfo("mappingFile", "Link to mapping file", null, 0.4f));

    gtMappingFiles.setPolicy(new ComponentTable.Policy<LoaderConfig.MappingFile>() {

        @Override
        public boolean isSet(LoaderConfig.MappingFile value) {
            return !value.getMappingFile().isEmpty();
        }

    });
    mainLayout.addComponent(gtMappingFiles);

    Panel panel = new Panel();
    panel.setSizeFull();
    panel.setContent(mainLayout);
    setCompositionRoot(panel);
}

From source file:cz.opendata.linked.metadata.form.ExtractorDialog.java

public ExtractorDialog() {
    super(ExtractorConfig.class);
    try {/*from w w w . ja va 2s .  c om*/
        periodicities
                .add(new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-A"), "Annual"));
        periodicities.add(new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-B"),
                "Daily - business week"));
        periodicities
                .add(new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-D"), "Daily"));
        periodicities.add(
                new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-M"), "Monthly"));
        periodicities.add(
                new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-N"), "Minutely"));
        periodicities.add(
                new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-Q"), "Quarterly"));
        periodicities.add(new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-S"),
                "Half Yearly, semester"));
        periodicities
                .add(new URLandCaption(new URL("http://purl.org/linked-data/sdmx/2009/code#freq-W"), "Weekly"));
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    buildMainLayout();

    Panel p = new Panel();

    p.setSizeFull();
    p.setContent(mainLayout);

    setCompositionRoot(p);
}

From source file:cz.opendata.unifiedviews.dpus.datasetMetadata.DatasetMetadataVaadinDialog.java

License:Creative Commons License

@Override
protected void buildDialogLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(true);/*from   w  ww.  j  ava 2s. c  o  m*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight(null);
    mainLayout.setMargin(false);
    //mainLayout.setSpacing(true);

    // top-level component properties
    setWidth("100%");
    setHeight("100%");

    tfDatasetUri = new TextField();
    tfDatasetUri.setCaption("Dataset URI:");
    tfDatasetUri.setInputPrompt("http://data.mydomain.com/resource/dataset/mydataset");
    tfDatasetUri.setWidth("100%");
    mainLayout.addComponent(tfDatasetUri);

    tfLanguage = new TextField();
    tfLanguage.setCaption("Original language (RDF language tag, e.g. cs):");
    tfLanguage.setInputPrompt("cs|en|sk|it");
    tfLanguage.setWidth("100%");
    mainLayout.addComponent(tfLanguage);

    tfTitle = new TextField();
    tfTitle.setCaption("Dataset title original language:");
    tfTitle.setInputPrompt("My dataset");
    tfTitle.setWidth("100%");
    mainLayout.addComponent(tfTitle);

    tfTitleEn = new TextField();
    tfTitleEn.setCaption("Dataset title in English:");
    tfTitleEn.setInputPrompt("My dataset");
    tfTitleEn.setWidth("100%");
    mainLayout.addComponent(tfTitleEn);

    tfDesc = new TextField();
    tfDesc.setCaption("Description in original language:");
    tfDesc.setInputPrompt("Longer description in original language");
    tfDesc.setWidth("100%");
    mainLayout.addComponent(tfDesc);

    tfDescEn = new TextField();
    tfDescEn.setCaption("Description in English:");
    tfDescEn.setInputPrompt("Longer description in English");
    tfDescEn.setWidth("100%");
    mainLayout.addComponent(tfDescEn);

    dfIssued = new DateField();
    dfIssued.setCaption("Issued:");
    dfIssued.setWidth("100%");
    dfIssued.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfIssued);

    dfModified = new DateField();
    dfModified.setCaption("Modified:");
    dfModified.setWidth("100%");
    dfModified.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfModified);

    chkNow = new CheckBox();
    chkNow.setCaption("Use current date as modified");
    chkNow.setWidth("100%");
    chkNow.setImmediate(true);
    chkNow.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            dfModified.setEnabled(!chkNow.getValue());
        }
    });
    mainLayout.addComponent(chkNow);

    tfIdentifier = new TextField();
    tfIdentifier.setCaption("Identifier:");
    tfIdentifier.setInputPrompt("CTIA_1");
    tfIdentifier.setWidth("100%");
    mainLayout.addComponent(tfIdentifier);

    lsKeywords_orig = new ListSelect();
    lsKeywords_orig.setWidth("100%");
    lsKeywords_orig.setNewItemsAllowed(true);
    lsKeywords_orig.setCaption("Keywords in original language");
    lsKeywords_orig.setMultiSelect(true);
    lsKeywords_orig.setRows(3);
    mainLayout.addComponent(lsKeywords_orig);

    lsKeywords_en = new ListSelect();
    lsKeywords_en.setWidth("100%");
    lsKeywords_en.setNewItemsAllowed(true);
    lsKeywords_en.setCaption("Keywords in English");
    lsKeywords_en.setMultiSelect(true);
    lsKeywords_en.setRows(3);
    mainLayout.addComponent(lsKeywords_en);

    lsLanguages = new ListSelect();
    lsLanguages.setWidth("100%");
    lsLanguages.setNewItemsAllowed(true);
    lsLanguages.setCaption("Languages");
    lsLanguages.setMultiSelect(true);
    lsLanguages.addItems(languages);
    lsLanguages.setRows(3);
    mainLayout.addComponent(lsLanguages);

    tfContactPoint = new TextField();
    tfContactPoint.setCaption("Contact point email:");
    tfContactPoint.setInputPrompt("contact@myorganization.com");
    tfContactPoint.setWidth("100%");
    mainLayout.addComponent(tfContactPoint);

    dfTemporalStart = new DateField();
    dfTemporalStart.setCaption("Temporal coverage start:");
    dfTemporalStart.setWidth("100%");
    dfTemporalStart.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfTemporalStart);

    dfTemporalEnd = new DateField();
    dfTemporalEnd.setCaption("Temporal coverage end:");
    dfTemporalEnd.setWidth("100%");
    dfTemporalEnd.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfTemporalEnd);

    tfSpatial = new TextField();
    tfSpatial.setCaption("Spatial coverage URI:");
    tfSpatial.setInputPrompt("http://ruian.linked.opendata.cz/resource/adresni-mista/25958810");
    tfSpatial.setWidth("100%");
    mainLayout.addComponent(tfSpatial);

    tfPeriodicity = new TextField();
    tfPeriodicity.setCaption("Periodicity:");
    tfPeriodicity.setInputPrompt("R-P1Y");
    tfPeriodicity.setWidth("100%");
    mainLayout.addComponent(tfPeriodicity);

    tfSchema = new TextField();
    tfSchema.setCaption("Schema URL:");
    tfSchema.setInputPrompt("http://data.example.org/dataset/myschema");
    tfSchema.setWidth("100%");
    mainLayout.addComponent(tfSchema);

    tfLandingPage = new TextField();
    tfLandingPage.setCaption("Landing page URL:");
    tfLandingPage.setInputPrompt("http://data.example.org/dataset/mydataset");
    tfLandingPage.setWidth("100%");
    mainLayout.addComponent(tfLandingPage);

    lsLicenses = new ListSelect();
    lsLicenses.setWidth("100%");
    lsLicenses.setNewItemsAllowed(true);
    lsLicenses.setCaption("Licenses");
    lsLicenses.setMultiSelect(false);
    lsLicenses.setNullSelectionAllowed(false);
    lsLicenses.setRows(3);
    lsLicenses.addItems(licenses);
    mainLayout.addComponent(lsLicenses);

    lsSources = new ListSelect();
    lsSources.setWidth("100%");
    lsSources.setNewItemsAllowed(true);
    lsSources.setCaption("Sources");
    lsSources.setMultiSelect(true);
    lsSources.setRows(2);
    mainLayout.addComponent(lsSources);

    lsThemes = new ListSelect();
    lsThemes.setWidth("100%");
    lsThemes.setNewItemsAllowed(true);
    lsThemes.setCaption("Themes");
    lsThemes.setMultiSelect(true);
    lsThemes.setRows(3);
    mainLayout.addComponent(lsThemes);

    lsAuthors = new ListSelect();
    lsAuthors.setWidth("100%");
    lsAuthors.setNewItemsAllowed(true);
    lsAuthors.setCaption("Selected authors");
    lsAuthors.setMultiSelect(true);
    lsAuthors.setRows(2);
    mainLayout.addComponent(lsAuthors);

    lsPublishers = new ListSelect();
    lsPublishers.setWidth("100%");
    lsPublishers.setNewItemsAllowed(true);
    lsPublishers.setCaption("Publishers");
    lsPublishers.setMultiSelect(true);
    lsPublishers.addItems(publishers);
    lsPublishers.setRows(2);
    mainLayout.addComponent(lsPublishers);

    Panel p = new Panel();
    p.setSizeFull();
    p.setContent(mainLayout);

    setCompositionRoot(p);
}

From source file:cz.opendata.unifiedviews.dpus.distributionMetadata.DistributionMetadataVaadinDialog.java

License:Creative Commons License

@Override
protected void buildDialogLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(true);/* www.  ja  v  a2s .  com*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight(null);
    mainLayout.setMargin(false);
    //mainLayout.setSpacing(true);

    // top-level component properties
    setWidth("100%");
    setHeight("100%");

    tfDownloadURL = new TextField();
    tfDownloadURL.setCaption("Download URL:");
    tfDownloadURL.setInputPrompt("http://data.mydomain.com/dumps/dataset.ttl");
    tfDownloadURL.setWidth("100%");
    mainLayout.addComponent(tfDownloadURL);

    tfMediaType = new TextField();
    tfMediaType.setCaption("Media (MIME) type:");
    tfMediaType.setInputPrompt("text/turtle|text/csv");
    tfMediaType.setWidth("100%");
    mainLayout.addComponent(tfMediaType);

    tfAccessURL = new TextField();
    tfAccessURL.setCaption("Access URL:");
    tfAccessURL.setInputPrompt("http://data.mydomain.com/dataset/dataset");
    tfAccessURL.setWidth("100%");
    mainLayout.addComponent(tfAccessURL);

    lsExampleResources = new ListSelect();
    lsExampleResources.setWidth("100%");
    lsExampleResources.setNewItemsAllowed(true);
    lsExampleResources.setCaption("Example resources");
    lsExampleResources.setMultiSelect(true);
    lsExampleResources.setRows(3);
    mainLayout.addComponent(lsExampleResources);

    tfSPARQLEndpointURL = new TextField();
    tfSPARQLEndpointURL.setCaption("SPARQL Endpoint URL:");
    tfSPARQLEndpointURL.setInputPrompt("http://linked.opendata.cz/sparql");
    tfSPARQLEndpointURL.setWidth("100%");
    mainLayout.addComponent(tfSPARQLEndpointURL);

    tfSchemaType = new TextField();
    tfSchemaType.setCaption("Schema MIME type:");
    tfSchemaType.setInputPrompt("text/csv");
    tfSchemaType.setWidth("100%");
    mainLayout.addComponent(tfSchemaType);

    chkSchemaFromInput = new CheckBox();
    chkSchemaFromInput.setCaption("Use schema from dataset");
    chkSchemaFromInput.setWidth("100%");
    chkSchemaFromInput.setImmediate(true);
    chkSchemaFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfSchema.setEnabled(!chkSchemaFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkSchemaFromInput);

    tfSchema = new TextField();
    tfSchema.setCaption("Schema URL:");
    tfSchema.setInputPrompt("http://data.example.org/dataset/myschema");
    tfSchema.setWidth("100%");
    mainLayout.addComponent(tfSchema);

    chkDatasetURIFromInput = new CheckBox();
    chkDatasetURIFromInput.setCaption("Get dataset URI from dataset");
    chkDatasetURIFromInput.setWidth("100%");
    chkDatasetURIFromInput.setImmediate(true);
    chkDatasetURIFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfDatasetURI.setEnabled(!chkDatasetURIFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkDatasetURIFromInput);

    tfDatasetURI = new TextField();
    tfDatasetURI.setCaption("Dataset URI:");
    tfDatasetURI.setInputPrompt("http://data.mydomain.com/resource/dataset/mydataset");
    tfDatasetURI.setWidth("100%");
    mainLayout.addComponent(tfDatasetURI);

    chkGenerateDistroURIFromDataset = new CheckBox();
    chkGenerateDistroURIFromDataset.setCaption("Generate distribution URI from dataset (+\"/distribution\")");
    chkGenerateDistroURIFromDataset.setWidth("100%");
    chkGenerateDistroURIFromDataset.setImmediate(true);
    chkGenerateDistroURIFromDataset.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfDistributionURI.setEnabled(!chkGenerateDistroURIFromDataset.getValue());
        }
    });
    mainLayout.addComponent(chkGenerateDistroURIFromDataset);

    tfDistributionURI = new TextField();
    tfDistributionURI.setCaption("Distribution URI:");
    tfDistributionURI.setInputPrompt("http://data.mydomain.com/resource/dataset/mydataset/distribution/rdf");
    tfDistributionURI.setWidth("100%");
    mainLayout.addComponent(tfDistributionURI);

    chkLanguageFromInput = new CheckBox();
    chkLanguageFromInput.setCaption("Get original language from dataset");
    chkLanguageFromInput.setWidth("100%");
    chkLanguageFromInput.setImmediate(true);
    chkLanguageFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfLanguage.setEnabled(!chkLanguageFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkLanguageFromInput);

    tfLanguage = new TextField();
    tfLanguage.setCaption("Original language (RDF language tag, e.g. cs):");
    tfLanguage.setInputPrompt("cs|en|sk|it");
    tfLanguage.setWidth("100%");
    mainLayout.addComponent(tfLanguage);

    chkTitleFromInput = new CheckBox();
    chkTitleFromInput.setCaption("Get title from dataset");
    chkTitleFromInput.setWidth("100%");
    chkTitleFromInput.setImmediate(true);
    chkTitleFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfTitle.setEnabled(!chkTitleFromInput.getValue());
            tfTitleEn.setEnabled(!chkTitleFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkTitleFromInput);

    tfTitle = new TextField();
    tfTitle.setCaption("Dataset title in original language:");
    tfTitle.setInputPrompt("My dataset");
    tfTitle.setWidth("100%");
    mainLayout.addComponent(tfTitle);

    tfTitleEn = new TextField();
    tfTitleEn.setCaption("Dataset title in English:");
    tfTitleEn.setInputPrompt("My dataset");
    tfTitleEn.setWidth("100%");
    mainLayout.addComponent(tfTitleEn);

    chkDescriptionFromInput = new CheckBox();
    chkDescriptionFromInput.setCaption("Get description from dataset");
    chkDescriptionFromInput.setWidth("100%");
    chkDescriptionFromInput.setImmediate(true);
    chkDescriptionFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfDesc.setEnabled(!chkDescriptionFromInput.getValue());
            tfDescEn.setEnabled(!chkDescriptionFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkDescriptionFromInput);

    tfDesc = new TextField();
    tfDesc.setCaption("Description in original language:");
    tfDesc.setInputPrompt("Longer description in original language");
    tfDesc.setWidth("100%");
    mainLayout.addComponent(tfDesc);

    tfDescEn = new TextField();
    tfDescEn.setCaption("Description in English:");
    tfDescEn.setInputPrompt("Longer description in English");
    tfDescEn.setWidth("100%");
    mainLayout.addComponent(tfDescEn);

    chkIssuedFromInput = new CheckBox();
    chkIssuedFromInput.setCaption("Use issued date from dataset");
    chkIssuedFromInput.setWidth("100%");
    chkIssuedFromInput.setImmediate(true);
    chkIssuedFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            dfIssued.setEnabled(!chkIssuedFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkIssuedFromInput);

    dfIssued = new DateField();
    dfIssued.setCaption("Issued:");
    dfIssued.setWidth("100%");
    dfIssued.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfIssued);

    chkNow = new CheckBox();
    chkNow.setCaption("Use current date as modified");
    chkNow.setWidth("100%");
    chkNow.setImmediate(true);
    chkNow.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            dfModified.setEnabled(!chkNow.getValue());
        }
    });
    mainLayout.addComponent(chkNow);

    dfModified = new DateField();
    dfModified.setCaption("Modified:");
    dfModified.setWidth("100%");
    dfModified.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfModified);

    chkTemporalFromInput = new CheckBox();
    chkTemporalFromInput.setCaption("Use temporal coverage from dataset");
    chkTemporalFromInput.setWidth("100%");
    chkTemporalFromInput.setImmediate(true);
    chkTemporalFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            dfTemporalStart.setEnabled(!chkTemporalFromInput.getValue());
            dfTemporalEnd.setEnabled(!chkTemporalFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkTemporalFromInput);

    dfTemporalStart = new DateField();
    dfTemporalStart.setCaption("Temporal coverage start:");
    dfTemporalStart.setWidth("100%");
    dfTemporalStart.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfTemporalStart);

    dfTemporalEnd = new DateField();
    dfTemporalEnd.setCaption("Temporal coverage end:");
    dfTemporalEnd.setWidth("100%");
    dfTemporalEnd.setResolution(Resolution.DAY);
    mainLayout.addComponent(dfTemporalEnd);

    chkSpatialFromInput = new CheckBox();
    chkSpatialFromInput.setCaption("Use spatial coverage from dataset");
    chkSpatialFromInput.setWidth("100%");
    chkSpatialFromInput.setImmediate(true);
    chkSpatialFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            tfSpatial.setEnabled(!chkSpatialFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkSpatialFromInput);

    tfSpatial = new TextField();
    tfSpatial.setCaption("Spatial coverage URI:");
    tfSpatial.setInputPrompt("http://ruian.linked.opendata.cz/resource/adresni-mista/25958810");
    tfSpatial.setWidth("100%");
    mainLayout.addComponent(tfSpatial);

    chkLicensesFromInput = new CheckBox();
    chkLicensesFromInput.setCaption("Use license from dataset");
    chkLicensesFromInput.setWidth("100%");
    chkLicensesFromInput.setImmediate(true);
    chkLicensesFromInput.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = -6135328311357043784L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            lsLicenses.setEnabled(!chkLicensesFromInput.getValue());
        }
    });
    mainLayout.addComponent(chkLicensesFromInput);

    lsLicenses = new ListSelect();
    lsLicenses.setWidth("100%");
    lsLicenses.setNewItemsAllowed(true);
    lsLicenses.setCaption("License");
    lsLicenses.setMultiSelect(false);
    lsLicenses.setNullSelectionAllowed(false);
    lsLicenses.setRows(3);
    lsLicenses.addItems(licenses);
    mainLayout.addComponent(lsLicenses);

    Panel p = new Panel();
    p.setSizeFull();
    p.setContent(mainLayout);

    setCompositionRoot(p);
}

From source file:cz.zcu.pia.social.network.frontend.components.posts.ComponentPost.java

/**
 * Adds click listeners to the buttons//w  w  w  .  ja  va 2s  . c o  m
 */
private void addClickListeners() {
    this.likes.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Post post = componentPostService.updateLikeRating(postId);
            numberOfLikes = post.getLikeCount();
            numberOfDisagrees = post.getHateCount();
            updateHateLike();

        }
    });
    this.disagrees.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Post post = componentPostService.updateDisagreeRating(postId);

            numberOfLikes = post.getLikeCount();
            numberOfDisagrees = post.getHateCount();
            updateHateLike();
        }
    });
    this.tags.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Window subWindow = new Window(msgs.getMessage("post.tags"));

            subWindow.setModal(true);
            subWindow.center();
            subWindow.setWidth(400, Unit.PIXELS);
            subWindow.setHeight(110, Unit.PIXELS);
            subWindow.setResizable(false);
            Panel panel = new Panel();

            panel.setSizeFull();
            HorizontalLayout tagsWrapper = new HorizontalLayout();
            tagsWrapper.setStyleName("margin-left-big");
            panel.setContent(tagsWrapper);
            tagsWrapper.setSpacing(true);
            tagsWrapper.setMargin(true);
            tagsWrapper.setSizeUndefined();

            for (Tag t : postService.getPostTags(postId)) {
                CustomLayout tag = new CustomLayout("tag");
                Button tagLabel = new Button(t.getTagName());
                tag.addComponent(tagLabel, "button");

                tagsWrapper.addComponent(tag);
            }

            subWindow.setContent(panel);
            UI.getCurrent().addWindow(subWindow);
        }
    });
    this.comments.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Window subWindow = new Window(msgs.getMessage("post.comments"));

            subWindow.setModal(true);
            subWindow.center();
            subWindow.setWidth(400, Unit.PIXELS);
            subWindow.setHeight(600, Unit.PIXELS);
            subWindow.setResizable(true);

            ComponentPostComments componentPostComments = applicationContext
                    .getBean(ComponentPostComments.class, postId);
            subWindow.setContent(componentPostComments);
            UI.getCurrent().addWindow(subWindow);
        }
    });
    this.name.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Window subWindow = new Window(msgs.getMessage("header.profile") + "- " + name.getCaption());

            subWindow.setModal(true);
            subWindow.center();
            subWindow.setWidth(400, Unit.PIXELS);
            subWindow.setHeight(350, Unit.PIXELS);
            subWindow.setResizable(true);

            Users user = postService.getPostById(postId).getUser();
            ComponentProfilePost profilePost = applicationContext.getBean(ComponentProfilePost.class, user);

            subWindow.setContent(profilePost);
            UI.getCurrent().addWindow(subWindow);
        }
    });
}

From source file:de.catma.ui.analyzer.querybuilder.TagPanel.java

License:Open Source License

private Component createTagLibraryTreePanel() {

    Panel tagLibraryPanel = new Panel();
    tagLibraryPanel.getContent().setSizeUndefined();
    tagLibraryPanel.setSizeFull();

    tagLibrariesTree = new Tree();
    tagLibrariesTree.setCaption("Tag Libraries");
    tagLibrariesTree.addStyleName("bold-label-caption");
    tagLibrariesTree.setImmediate(true);
    tagLibrariesTree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_ID);

    for (TagLibraryReference tlr : queryOptions.getRepository().getTagLibraryReferences()) {
        addTagLibraryReferenceToTree(tlr);
    }//from   w  ww.j  a  va  2s  . c  om

    tagLibraryPanel.addComponent(tagLibrariesTree);

    return tagLibraryPanel;
}

From source file:de.catma.ui.repository.CorpusContentSelectionDialog.java

License:Open Source License

private void initComponents() {
    setSizeFull();// ww  w.  j  a  v  a2  s .  c  o  m
    Panel documentsPanel = new Panel();
    documentsPanel.getContent().setSizeUndefined();
    documentsPanel.getContent().setWidth("100%");
    documentsPanel.setSizeFull();

    documentsContainer = new HierarchicalContainer();
    documentsTree = new TreeTable("Documents for the analysis", documentsContainer);
    documentsTree.setWidth("100%");

    documentsTree.addContainerProperty(DocumentTreeProperty.caption, String.class, null);
    documentsTree.addContainerProperty(DocumentTreeProperty.include, AbstractComponent.class, null);
    documentsTree.setColumnHeader(DocumentTreeProperty.caption, "document/collection");
    documentsTree.setColumnHeader(DocumentTreeProperty.include, "include");

    documentsTree.addItem(new Object[] { sourceDocument.toString(), createCheckBox(false) }, sourceDocument);

    documentsTree.setCollapsed(sourceDocument, false);

    MarkupCollectionItem userMarkupItem = new MarkupCollectionItem(sourceDocument, userMarkupItemDisplayString,
            true);
    documentsTree.addItem(new Object[] { userMarkupItemDisplayString, new Label() }, userMarkupItem);
    documentsTree.setParent(userMarkupItem, sourceDocument);

    for (UserMarkupCollectionReference umcRef : sourceDocument.getUserMarkupCollectionRefs()) {
        documentsTree.addItem(new Object[] { umcRef.getName(), createCheckBox(true) }, umcRef);
        documentsTree.setParent(umcRef, userMarkupItem);
        documentsTree.setChildrenAllowed(umcRef, false);
    }
    documentsTree.setCollapsed(userMarkupItem, false);
    int pageLength = sourceDocument.getUserMarkupCollectionRefs().size() + 1;
    if (pageLength < 5) {
        pageLength = 5;
    }
    if (pageLength > 15) {
        pageLength = 15;
    }
    documentsTree.setPageLength(pageLength);
    documentsPanel.addComponent(documentsTree);

    addComponent(documentsPanel);
    setExpandRatio(documentsPanel, 1.0f);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);
    buttonPanel.setWidth("100%");
    btOk = new Button("Ok");
    btOk.setClickShortcut(KeyCode.ENTER);
    btOk.focus();

    buttonPanel.addComponent(btOk);
    buttonPanel.setComponentAlignment(btOk, Alignment.MIDDLE_RIGHT);
    buttonPanel.setExpandRatio(btOk, 1.0f);
    btCancel = new Button("Cancel");
    buttonPanel.addComponent(btCancel);
    buttonPanel.setComponentAlignment(btCancel, Alignment.MIDDLE_RIGHT);
    addComponent(buttonPanel);

    dialogWindow = new Window("Selection of relevant documents");
    dialogWindow.setContent(this);
}