Java 类com.vaadin.ui.Select 实例源码

项目:openeos    文件:DefaultVaadinFieldFactory.java   
private Field createFieldByPropertyType(Class<?> type) {
    final IClassDefinition classDefinition = dictionaryService.getClassDefinition(type.getName());
    if (classDefinition != null) {
        LOG.debug("Found field with dictionary in dictionary service for class {}, create new Select", type.getName());
        Select select = new EntitySelect(new EntitySelectIdProvider() {

            @Override
            public Object getId(Object entityObject) {
                return classDefinition.getId(entityObject);
            }
        });
        select.setItemCaptionMode(Select.ITEM_CAPTION_MODE_ITEM);
        select.setContainerDataSource(containerFactory.createContainer(classDefinition.getClassDefined().getName()));
        return select;
    }
    return DefaultFieldFactory.createFieldByPropertyType(type);
}
项目:rolp    文件:LebSettingsAnlegenFormFields.java   
@Override
public Field createField(Item item, Object propertyId, Component uiContext) {
    Field field = super.createField(item, propertyId, uiContext);
    if (propertyId.equals(LebSettingsPojo.HALBJAHR_COLUMN)) {
        Select select = new Select("Halbjahr: ");
        HalbjahrPojoContainer halbjahr = HalbjahrPojoContainer.getInstance();
        select.setContainerDataSource(halbjahr);
        select.setNullSelectionAllowed(false);
        select.setRequired(true);
        HalbjahrPojo currentHalbjahr = (HalbjahrPojo) item.getItemProperty(LebSettingsPojo.HALBJAHR_COLUMN).getValue();
        select.setPropertyDataSource(item.getItemProperty(propertyId));
        for (HalbjahrPojo halbjahrPojo : halbjahr.getItemIds()) {
            select.setItemCaption(halbjahrPojo, halbjahrPojo.getHalbjahr());
            if (currentHalbjahr != null && halbjahrPojo.getId().equals(currentHalbjahr.getId())) {
                select.select(halbjahrPojo);
            }
        }
        return select;
    }
    return field;
}
项目:enterprise-app    文件:HqlQueryBrowser.java   
protected void addParamField() {
    TextField textField = new TextField();
    textField.setWidth("100%");

    Select select = new Select();
    select.addItem(BigDecimal.class);
    select.addItem(Boolean.class);
    select.addItem(Double.class);
    select.addItem(Float.class);
    select.addItem(Integer.class);
    select.addItem(Long.class);
    select.addItem(String.class);

    HorizontalLayout fieldRowLayout = new HorizontalLayout();
    fieldRowLayout.setWidth("100%");
    fieldRowLayout.setSpacing(true);
    fieldRowLayout.addComponent(textField);
    fieldRowLayout.addComponent(select);
    fieldRowLayout.setExpandRatio(textField, 1);

    paramsFieldsLayout.addComponent(fieldRowLayout);
    paramsValues.add(textField);
    paramsTypes.add(select);
}
项目:konekti    文件:OrganizationView.java   
private Tree createOrganizationTree(Organization organization) {                
    Tree organizationTree = new Tree(); 
    organizationTree.setImmediate(false);
    organizationTree.setWidth("100.0%");
    organizationTree.setHeight("100.0%");
    organizationTree.setContainerDataSource(createDataSource(organization));
    organizationTree.setItemIconPropertyId("icon");
    organizationTree.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    organizationTree.setItemCaptionPropertyId("description");

    // Expand all items that can be
       for (Object itemId: organizationTree.getItemIds())
        organizationTree.expandItem(itemId);

       organizationTree.setData(organization);
       organizationTree.addActionHandler(this);

    return organizationTree;
}
项目:konekti    文件:AreaViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public AreaViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data 
    areaTypeField.setNullSelectionAllowed(false);
    areaTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    areaTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:konekti    文件:LocationViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public LocationViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Location Type data
    locationTypeField.setNullSelectionAllowed(false);
    locationTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    locationTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:konekti    文件:ProductViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public ProductViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    productSupplierField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    productSupplierField.setItemCaptionPropertyId("description");

    productTypeField.setNullSelectionAllowed(false);
    productTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    productTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:konekti    文件:OfferLineViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public OfferLineViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    offerField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    offerField.setItemCaptionPropertyId("code");

    offerLineStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    offerLineStatusField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();     
}
项目:konekti    文件:InvoiceLineViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public InvoiceLineViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here      
    initComponents();

    // configure Organization Type data
    invoiceLineStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    invoiceLineStatusField.setItemCaptionPropertyId("description");

    invoiceField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    invoiceField.setItemCaptionPropertyId("code");

    taxField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    taxField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();     
}
项目:konekti    文件:OrganizationViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */ 
public OrganizationViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here      
    initComponents();

    // configure Organization Type data     
    organizationTypeField.setNullSelectionAllowed(false);
    organizationTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    organizationTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:konekti    文件:PermissionViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public PermissionViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    menuCommandResourceField.setNullSelectionAllowed(false);
    menuCommandResourceField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    menuCommandResourceField.setItemCaptionPropertyId("caption");

    // get form services from OSGi Service Registry
    getServices();

    loadData();
}
项目:konekti    文件:CalendarViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public CalendarViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    calendarTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    calendarTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:rolp    文件:KlasseAnlegenFormFields.java   
@Override
public Field createField(Item item, Object propertyId, Component uiContext) {
    Field field = super.createField(item, propertyId, uiContext);
    if (propertyId.equals(KlassePojo.KLASSENNAME_COLUMN)) {
        field.setCaption("Klassenbezeichnung: ");
        field.setRequired(true);
    } 
    else if (propertyId.equals(KlassePojo.KLASSENTYP_COLUMN)) {
        Select select = new Select("Klassentyp: ");
        KlassentypPojoContainer klassentypen = KlassentypPojoContainer.getInstance();   
        select.setContainerDataSource(klassentypen);
        KlassentypPojo currentKlassentyp = (KlassentypPojo) item.getItemProperty(KlassePojo.KLASSENTYP_COLUMN).getValue();
        select.setPropertyDataSource(item.getItemProperty(propertyId));
        for (KlassentypPojo klassentyp : klassentypen.getItemIds()) {
            select.setItemCaption(klassentyp, klassentyp.getKlassentyp());
            if (currentKlassentyp != null && klassentyp.getId().equals(currentKlassentyp.getId())) {
                select.select(klassentyp);
            } else if (currentKlassentyp == null && klassentyp.isKlassenstufenorientiert()) {
                select.select(klassentyp);
            }
        }

        select.setNullSelectionAllowed(false);
        select.setRequired(true);
        return select;
    } 
    return field;   
}
项目:konekti    文件:MapView.java   
private void initView() {
    // Set the position of the splitter as percentage
    mapSplitPanel.setSplitPosition(75, Sizeable.UNITS_PERCENTAGE);

    // configure open layers
    locationsLayersMap.setImmediate(true);              
    locationsLayersMap.getControls().clear();
    locationsLayersMap.addControl(Control.ZoomPanel);
    locationsLayersMap.addControl(Control.TouchNavigation);
    locationsLayersMap.addControl(Control.LayerSwitcher);
    locationsLayersMap.addControl(Control.ScaleLine);

    openStreetMapLayer = new OpenStreetMapLayer();
    googleStreetMapLayer = new GoogleStreetMapLayer();
       googleSatelliteMapLayer = new GoogleSatelliteMapLayer();

       locationsLayersMap.addLayer(googleStreetMapLayer);
       locationsLayersMap.addLayer(openStreetMapLayer);
       locationsLayersMap.addLayer(googleSatelliteMapLayer);

       markerMapLayer = new MarkerLayer();

       // get active user organization
       organization = context.getUser().getActiveOrganization();        

       // configure location combolist
       cmbLocationField.setNullSelectionAllowed(false);
       cmbLocationField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
       cmbLocationField.setItemCaptionPropertyId("name");

}
项目:konekti    文件:ClientViewForm.java   
/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public ClientViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    this.userField.setTabSheet(tabSheetClient);
    this.userRoleCollectionField.setContext(context);

    clientTypeField.setNullSelectionAllowed(false);
    clientTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    clientTypeField.setItemCaptionPropertyId("description");

    clientGroupField.setNullSelectionAllowed(false);
    clientGroupField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    clientGroupField.setItemCaptionPropertyId("description");

    addressField.addListenerAddressChange(new AddressChangeListener() {         
        @Override
        public void addressChange(AddressChangeEvent event) {
            if (client != null)
                client.setAddress(event.getAddress());

        }
    });

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();     
}
项目:konekti    文件:SupplierViewForm.java   
/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public SupplierViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    this.userField.setTabSheet(tabSheetSupplier);
    this.userRoleCollectionField.setContext(context);

    supplierTypeField.setNullSelectionAllowed(false);
    supplierTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    supplierTypeField.setItemCaptionPropertyId("description");

    supplierGroupField.setNullSelectionAllowed(false);
    supplierGroupField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    supplierGroupField.setItemCaptionPropertyId("description");

    addressField.addListenerAddressChange(new AddressChangeListener() {         
        @Override
        public void addressChange(AddressChangeEvent event) {
            if (supplier != null)
                supplier.setAddress(event.getAddress());

        }
    });

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();         
}
项目:konekti    文件:EmployeeAgentViewForm.java   
/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public EmployeeAgentViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here      
    initComponents();

    this.userRoleCollectionField.setContext(context);
    this.userField.setTabSheet(tabSheetEmployeeAgent);

    employeeAgentTypeField.setNullSelectionAllowed(false);
    employeeAgentTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    employeeAgentTypeField.setItemCaptionPropertyId("description");

    employeeAgentStatusField.setNullSelectionAllowed(false);
    employeeAgentStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    employeeAgentStatusField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();     

}
项目:konekti    文件:OfferViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public OfferViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    offerTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    offerTypeField.setItemCaptionPropertyId("description");

    offerStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    offerStatusField.setItemCaptionPropertyId("description");       

    organizationField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    organizationField.setItemCaptionPropertyId("description");  

    offerClientField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    offerClientField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:ods-lodms-plugins    文件:VirtuosoLoaderConfigDialog.java   
public VirtuosoLoaderConfigDialog(VirtuosoLoaderConfig configuration) {
    config = configuration;
    form.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            if ("graph".equals(propertyId)) {
                Field f = super.createField(item, propertyId, uiContext);
                f.setVisible(config.getGraphSource().equals(VirtuosoLoaderConfig.GRAPHSOURCE_CUSTOM));

            } else if ("graphSource".equals(propertyId)) {
                Select selector = new Select("Graph");
                selector.addItem(VirtuosoLoaderConfig.GRAPHSOURCE_CKANURI);
                selector.addItem(VirtuosoLoaderConfig.GRAPHSOURCE_ODSURI);
                selector.addItem(VirtuosoLoaderConfig.GRAPHSOURCE_CUSTOM);
                selector.addListener(new Property.ValueChangeListener() {
                    @Override
                    public void valueChange(Property.ValueChangeEvent event) {
                        Field graph = form.getField("graph");
                        if (event.getProperty().getValue() == null || graph == null)
                            return;
                        else {
                            boolean isCustom = event.getProperty().getValue().equals(VirtuosoLoaderConfig.GRAPHSOURCE_CUSTOM);
                            graph.setVisible(isCustom);
                            graph.setRequired(isCustom);
                        }
                    }
                });
                selector.setImmediate(true);
                return selector;
            }
            return super.createField(item, propertyId, uiContext);
        }
    });
    form.setItemDataSource(new BeanItem<VirtuosoLoaderConfig>(this.config));
    form.setVisibleItemProperties(new String[]{"host", "port", "userName", "password", "versioned", "graphSource", "graph"});
    addComponent(form);
}
项目:enterprise-app    文件:EntityField.java   
@Override
protected void initSelectComponent() {
    select = new Select();
}
项目:konekti    文件:ProtocolToolbar.java   
@AutoGenerated
private HorizontalLayout buildToolbarLayout() {     
    toolbarLayout = new HorizontalLayout();
    toolbarLayout.setImmediate(false);
    toolbarLayout.setSpacing(true);

    ButtonGroup editionButtonGroup = new ButtonGroup();
    toolbarLayout.addComponent(editionButtonGroup);

    // btnOpenProtocol
    btnOpenProtocol = new Button();
    btnOpenProtocol.setCaption("Iniciar Job");
    btnOpenProtocol.setImmediate(true);
    btnOpenProtocol.setWidth("-1px");
    btnOpenProtocol.setHeight("-1px");
    btnOpenProtocol.setIcon(new ThemeResource("../konekti/images/icons/job-toolbar/bell--arrow.png"));

    editionButtonGroup.addButton(btnOpenProtocol);

    // btnRecoverProtocol
    btnRecoverProtocol = new Button();
    btnRecoverProtocol.setCaption("Iniciar Job");
    btnRecoverProtocol.setImmediate(true);
    btnRecoverProtocol.setWidth("-1px");
    btnRecoverProtocol.setHeight("-1px");
    btnRecoverProtocol.setIcon(new ThemeResource("../konekti/images/icons/job-toolbar/bell--arrow.png"));

    editionButtonGroup.addButton(btnRecoverProtocol);

    lblBoxProtocol = new Label("Buzón Protocolo:");
    lblBoxProtocol.setVisible(false);
    lblBoxProtocol.setWidth("-1px");
    lblBoxProtocol.setHeight("-1px");

    toolbarLayout.addComponent(lblBoxProtocol);

    cmbBoxProtocol = new ComboBox();
    cmbBoxProtocol.setVisible(false);
    cmbBoxProtocol.setImmediate(true);
    cmbBoxProtocol.setWidth("-1px");
    cmbBoxProtocol.setHeight("-1px");
    cmbBoxProtocol.setNullSelectionAllowed(false);
    cmbBoxProtocol.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    cmbBoxProtocol.setItemCaptionPropertyId("box");

    toolbarLayout.addComponent(cmbBoxProtocol);

    lblTypeProtocol = new Label("Tipo Protocolo:");
    lblTypeProtocol.setWidth("-1px");
    lblTypeProtocol.setHeight("-1px");

    toolbarLayout.addComponent(lblTypeProtocol);

    cmbTypeProtocol = new ComboBox();
    cmbTypeProtocol.setImmediate(true);
    cmbTypeProtocol.setWidth("-1px");
    cmbTypeProtocol.setHeight("-1px");
    cmbTypeProtocol.setNullSelectionAllowed(true);
    cmbTypeProtocol.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    cmbTypeProtocol.setItemCaptionPropertyId("direction");

    toolbarLayout.addComponent(cmbTypeProtocol);

    return toolbarLayout;
}
项目:konekti    文件:InvoiceViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public InvoiceViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    organizationField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    organizationField.setItemCaptionPropertyId("name");

    offersField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    offersField.setItemCaptionPropertyId("code");

    invoiceTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    invoiceTypeField.setItemCaptionPropertyId("description");

    invoiceStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    invoiceStatusField.setItemCaptionPropertyId("description");

    invoiceClientField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    invoiceClientField.setItemCaptionPropertyId("description");

    // configure Table Child Organization data      
    tbsInvoice.setCaption("Líneas Factura/Comentarios");

    invoiceLinesField = new InvoiceLineCollectionField();       
    invoiceLinesField.setSizeFull();
    tbsInvoice.addTab(invoiceLinesField, "Líneas Factura");

    feedbacksField = new FeedBackCollectionField();
    feedbacksField.setSizeFull();
    tbsInvoice.addTab(feedbacksField, "Comentarios");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();
}
项目:konekti    文件:LocaleField.java   
public LocaleField() {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // get all available locales
    locales = SimpleDateFormat.getAvailableLocales();

    // construct custom datasource for combobox
    // id: language + LOCALE_SEPARATOR + country: es_ES
    // display: fraindly locale string
    /*for (int i = 0; i< locales.length; i++) {
        if (locales[i].getCountry() != "" && locales[i].getLanguage() != "") {
            String localeCode =  locales[i].getLanguage() + LOCALE_SEPARATOR + locales[i].getCountry();

            // Use the item ID also as the caption of this item
            defaultLocaleField.addItem(localeCode);
            defaultLocaleField.setItemCaption(localeCode, locales[i].getDisplayName());
        }
    }*/

        // construct custom datasource for combobox
    defaultLocaleField.addItem("es-ES");
    defaultLocaleField.setItemCaption("es-ES", "Español");
    defaultLocaleField.addItem("en-US");
    defaultLocaleField.setItemCaption("en-US", "English");
    defaultLocaleField.addItem("fr-FR");
    defaultLocaleField.setItemCaption("fr-FR", "Français");
    //defaultLocaleField.addItem("zh-CN");
    //defaultLocaleField.setItemCaption("zh-CN", "简体中文");

    defaultLocaleField.addListener(new Property.ValueChangeListener() {
        public void valueChange(Property.ValueChangeEvent event) {
            // Get the selected item
            Object itemId = event.getProperty().getValue();

            if (itemId != null)
                localeCode = itemId.toString();

        }
    });
    defaultLocaleField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID);
    defaultLocaleField.setImmediate(true);
    defaultLocaleField.setNullSelectionAllowed(false);

}
项目:konekti    文件:UserRoleCollectionField.java   
private void initialize() {
    try {
        cmbRoles.setImmediate(true);            
        cmbRoles.setContainerDataSource(dsUserRole);
        cmbRoles.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
        cmbRoles.setItemCaptionPropertyId("description");

        cmbArea.setImmediate(true);         
        cmbArea.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
        cmbArea.setItemCaptionPropertyId("description");
        cmbArea.setNullSelectionAllowed(false);

        // not deselected a selected register
        tbActivePermission.setNullSelectionAllowed(false);      
        tbActivePermission.setColumnCollapsingAllowed(true);
        tbActivePermission.setSelectable(true);
        //tbActivePermission.setMultiSelect(true);
        tbActivePermission.setImmediate(true);      
        dsActivePermission.addNestedContainerProperty("menuCommandResource.caption");
        tbActivePermission.setContainerDataSource(dsActivePermission);
        tbActivePermission.setVisibleColumns(new String[] { "code", "description", "comment", "menuCommandResource.caption" } );       
        tbActivePermission.setColumnHeaders(new String[] { "Codigo", "Descripcion", "Comentarios", "Modulo" } );
        tbActivePermission.setColumnCollapsed("code", true);
        tbActivePermission.setColumnCollapsed("comment", true);
        tbActivePermission.setColumnCollapsed("menuCommandResource.caption", true);

        tbAvailablePermission.setNullSelectionAllowed(false);       
        tbAvailablePermission.setColumnCollapsingAllowed(true);
        tbAvailablePermission.setSelectable(true);
        //tbAvailablePermission.setMultiSelect(true);
        tbAvailablePermission.setImmediate(true);   
        dsAvailablePermission.addNestedContainerProperty("menuCommandResource.caption");
        tbAvailablePermission.setContainerDataSource(dsAvailablePermission);
        tbAvailablePermission.setVisibleColumns(new String[] { "code", "description", "comment", "menuCommandResource.caption" } );       
        tbAvailablePermission.setColumnHeaders(new String[] { "Codigo", "Descripcion", "Comentarios", "Modulo" } );
        tbAvailablePermission.setColumnCollapsed("code", true);
        tbAvailablePermission.setColumnCollapsed("comment", true);
        tbAvailablePermission.setColumnCollapsed("menuCommandResource.caption", true);

        tbActiveAction.setNullSelectionAllowed(false);      
        tbActiveAction.setColumnCollapsingAllowed(true);
        tbActiveAction.setSelectable(true);
        //tbActiveAction.setMultiSelect(true);
        tbActiveAction.setImmediate(true);
        tbActiveAction.setContainerDataSource(dsActiveAction);
        tbActiveAction.setVisibleColumns(new String[] { "code", "description", "comment" } );       
        tbActiveAction.setColumnHeaders(new String[] { "Codigo", "Descripcion", "Comentarios" } );
        tbActiveAction.setColumnCollapsed("code", true);
        tbActiveAction.setColumnCollapsed("comment", true);

        tbAvailableAction.setNullSelectionAllowed(false);       
        tbAvailableAction.setColumnCollapsingAllowed(true);
        tbAvailableAction.setSelectable(true);
        //tbAvailableAction.setMultiSelect(true);
        tbAvailableAction.setImmediate(true);
        tbAvailableAction.setContainerDataSource(dsAvailableAction);
        tbAvailableAction.setVisibleColumns(new String[] { "code", "description", "comment" } );       
        tbAvailableAction.setColumnHeaders(new String[] { "Codigo", "Descripcion", "Comentarios" } );
        tbAvailableAction.setColumnCollapsed("code", true);
        tbAvailableAction.setColumnCollapsed("comment", true);
    }
    catch(Exception e) {
        throw new RuntimeException("¡Error al crear los Compinentes de Roles!", e);
    }

}
项目:konekti    文件:StockViewForm.java   
/**
 * The constructor should first build the main layout, set the composition
 * root and then do any custom initialization.
 * 
 * The constructor will not be automatically regenerated by the visual
 * editor.
 * @throws Exception 
 * @throws IllegalArgumentException 
 */
public StockViewForm(IWorkbenchContext context) throws IllegalArgumentException, Exception {
    this.context = context;

    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    // configure Organization Type data
    stockStatusField.setNullSelectionAllowed(false);
    stockStatusField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    stockStatusField.setItemCaptionPropertyId("description");

    productUnitField.setNullSelectionAllowed(false);
    productUnitField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    productUnitField.setItemCaptionPropertyId("description");

    areaField.setNullSelectionAllowed(false);
    areaField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    areaField.setItemCaptionPropertyId("description");

    productField.setNullSelectionAllowed(false);
    productField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    productField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();

    // fill the units from product selected
    productField.addListener(new ValueChangeListener() {            
        @Override
        public void valueChange(ValueChangeEvent event) {
            try {
                Product producSelected = (Product)productField.getValue();

                if (producSelected != null) {
                    bcProductUnit.removeAllItems();
                    bcProductUnit.addAll(producSelected.getProductUnits());
                }
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        }
    });

}
项目:ods-lodms-plugins    文件:OdsValidatorDialog.java   
private void initEditor() {
    ruleEditor.addComponent(removeButton);
    ruleFields.setFormFieldFactory(new DefaultFieldFactory() {
        @Override
        public Field createField(Item item, Object propertyId, Component uiContext) {
            if ("sparqlQuery".equals(propertyId)) {
                TextArea sparqlQuery = new TextArea();
                sparqlQuery.setCaption(createCaptionByPropertyId(propertyId));
                sparqlQuery.setImmediate(true);
                sparqlQuery.setRows(10);
                sparqlQuery.setColumns(30);
                sparqlQuery.addValidator(new AbstractStringValidator("invalid sparql query") {
                    @Override
                    protected boolean isValidString(String value) {
                        SPARQLParser parser = new SPARQLParser();
                        try {
                            ParsedUpdate parsed = parser.parseUpdate(value, null);
                        } catch (Exception ex) {

                            return false;
                        }
                        return true;
                    }
                });
                return sparqlQuery;
            }
            if ("severity".equals(propertyId)) {
                Select s = new Select();
                s.setCaption(createCaptionByPropertyId(propertyId));
                s.addItem(ValidationRule.SEVERITY_ERROR);
                s.addItem(ValidationRule.SEVERITY_WARN);
                return s;
            }

            TextField f = new TextField();
            f.setCaption(createCaptionByPropertyId(propertyId));
            f.setWidth("300px");
            return f;

        }
    });
    ruleFields.setVisibleItemProperties(new String[]{"description", "sparqlQuery"});
    ruleEditor.addComponent(ruleFields);
}