当前位置: 首页>>代码示例>>Java>>正文


Java Property类代码示例

本文整理汇总了Java中com.vaadin.v7.data.Property的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Property类属于com.vaadin.v7.data包,在下文中一共展示了Property类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildCheckInPopupView

import com.vaadin.v7.data.Property; //导入依赖的package包/类
private PopupView buildCheckInPopupView() {
    attendeeInformationVerified = new CheckBox("Information Verified");
    parentalConsentFormReceived = new CheckBox("Parental Consent Form Received");
    btnInfoReceived = new Button("Save");
    btnInfoReceived.setEnabled(false);
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addComponent(attendeeInformationVerified);
    layout.addComponent(parentalConsentFormReceived);
    layout.addComponent(btnInfoReceived);

    attendeeInformationVerified.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent ->
            btnInfoReceived.setEnabled(validateCheckInFields()));
    parentalConsentFormReceived.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent ->
            btnInfoReceived.setEnabled(validateCheckInFields()));
    btnInfoReceived.addClickListener((Button.ClickListener) clickEvent -> attendeeInformationVerified());

    return new PopupView(null, layout);
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:21,代码来源:AttendeeDetailWindow.java

示例2: init

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@PostConstruct
public void init() {
    userList.setNullSelectionAllowed(false);
    userList.setCaption("");
    userList.setImmediate(true);
    userList.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
    userList.setItemCaptionPropertyId("username");

    addComponents(userList, btnAddNew);

    userList.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent -> {
                User u = (User)valueChangeEvent.getProperty().getValue();
                navigateTo(UserEditView.VIEW_NAME + "/" + u.getId());
            });

    btnAddNew.addClickListener((Button.ClickListener) clickEvent -> {
        navigateTo(UserEditView.VIEW_NAME);
    });

    handler.showUserList(this);
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:22,代码来源:UserListView.java

示例3: enter

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
    super.enter(viewChangeEvent);
    String parameters = viewChangeEvent.getParameters();
    if (parameters == null || parameters.equals("")) {
        txtSearch.clear();
        attendeeBeanList.removeAllItems();
    } else {
        String searchString = viewChangeEvent.getParameters();
        tblResult.clear();
        if (txtSearch.getValue() != null && !txtSearch.getValue().equals(searchString)) {
            txtSearch.setValue(searchString);
        }
        handler.searchFor(searchString);
    }
    txtSearch.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent -> search());
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:18,代码来源:AttendeeSearchView.java

示例4: createPremiumCheckbox

import com.vaadin.v7.data.Property; //导入依赖的package包/类
public static Component createPremiumCheckbox(ComponentGridDecorator componentGridDecorator, Customer
        customer) {

    CheckBox premium = new CheckBox();
    premium.setImmediate(true);
    premium.setWidth(19, Sizeable.Unit.PIXELS);
    premium.setHeight(19, Sizeable.Unit.PIXELS);
    premium.setDescription("Premium Customer?");

    Property property = new BeanItem<>(customer).getItemProperty(Customer.PREMIUM);
    premium.setPropertyDataSource(property);

    premium.addValueChangeListener(e -> {
        Notification.show(String.valueOf(customer.getPremium()));
        componentGridDecorator.refresh();

    });

    return premium;
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:21,代码来源:ViewComponents.java

示例5: initContent

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@Override
protected Component initContent() {
    final Button button = new Button("...");
    button.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            Property<?> p = grid.getContainerDataSource().getItem(grid.getEditedItemId()).getItemProperty(header);
            if (p != null) {
                String data = p.getValue() == null ? null : String.valueOf(p.getValue());
                boolean binary = resultTable != null ? resultTable.getColumnWithName(header).isOfBinaryType() : false;
                if (binary) {
                    ReadOnlyTextAreaDialog.show(header, data == null ? null : data.toUpperCase(), resultTable, getPrimaryKeys(),
                            db.getPlatform(), binary, true);
                } else {
                    ReadOnlyTextAreaDialog.show(header, data, resultTable, getPrimaryKeys(), db.getPlatform(), binary, true);
                }
            }
        }
    });
    return button;
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:24,代码来源:TabularResultLayout.java

示例6: getItemProperty

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@Override
public Property getItemProperty(Object id) {
    final String propertyName = id.toString();
    if (getDynaBean().getDynaClass().getDynaProperty(propertyName) == null) {
        DefaultResolver defaultResolver = new DefaultResolver();
        if (!(defaultResolver.hasNested(propertyName) || defaultResolver.
                isIndexed(propertyName))) {
            // Lazy query container detects some debug properties via 
            // Item!! 
            return null;
        }
    }
    DynaProperty prop = propertyIdToProperty.get(id);
    if (prop == null) {
        prop = new DynaProperty(propertyName);
        propertyIdToProperty.put(id, prop);
    }
    return prop;
}
 
开发者ID:viritin,项目名称:viritin,代码行数:20,代码来源:DynaBeanItem.java

示例7: loopAllEntitiesAndProperties

import com.vaadin.v7.data.Property; //导入依赖的package包/类
public void loopAllEntitiesAndProperties() throws IOException {
    NullOutputStream nullOutputStream = new NullOutputStream();
    List<Person> listOfPersons = Service.getListOfPersons(100 * 1000);
    long currentTimeMillis = System.currentTimeMillis();
    ListContainer<Person> listContainer = new ListContainer<>(
            listOfPersons);
    Collection<?> ids = listContainer.getContainerPropertyIds();
    for (int i = 0; i < listContainer.size(); i++) {
        Item item = listContainer.getItem(listOfPersons.get(i));
        for (Object propertyId : ids) {
            Property itemProperty = item.getItemProperty(propertyId);
            final Object value = itemProperty.getValue();
            nullOutputStream.write(value.toString().getBytes());
            LOG.log(Level.FINEST, "Property: %s", value);
        }
    }
    LOG.
            log(Level.INFO,
                    "Looping all properties in 100 000 Items took {0}ms",
                    (System.currentTimeMillis() - currentTimeMillis));
}
 
开发者ID:viritin,项目名称:viritin,代码行数:22,代码来源:ListContainerLoopPerformanceTest.java

示例8: loopAllEntitiesAndPropertiesWithBeanItemContainer

import com.vaadin.v7.data.Property; //导入依赖的package包/类
public void loopAllEntitiesAndPropertiesWithBeanItemContainer() throws IOException {
    NullOutputStream nullOutputStream = new NullOutputStream();

    List<Person> listOfPersons = Service.getListOfPersons(100 * 1000);
    long currentTimeMillis = System.currentTimeMillis();
    BeanItemContainer<Person> c = new BeanItemContainer<>(
            Person.class, listOfPersons);
    Collection<?> ids = c.getContainerPropertyIds();
    for (int i = 0; i < c.size(); i++) {
        Item item = c.getItem(listOfPersons.get(i));
        for (Object propertyId : ids) {
            Property itemProperty = item.getItemProperty(propertyId);
            final Object value = itemProperty.getValue();
            nullOutputStream.write(value.toString().getBytes());
            LOG.log(Level.FINEST, "Property: %s", value);
        }
    }
    // ~ 350ms in 1.34, MacBook Pro (Retina, Mid 2012) 2.3Gz i7
    // ~ + 3-10ms in 1.35, when changing ListContainer to use PropertyUtils instead of WrapDynaBean
    LOG.
            log(Level.INFO,
                    "BIC from core: Looping all properties in 100 000 Items took {0}ms",
                    (System.currentTimeMillis() - currentTimeMillis));
}
 
开发者ID:viritin,项目名称:viritin,代码行数:25,代码来源:ListContainerLoopPerformanceTest.java

示例9: testDynaBeanItem

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@Test
public void testDynaBeanItem() {

    DynaBeanItem<Entity> dynaBeanItem = new DynaBeanItem<>(
            new Entity());

    Property itemProperty = dynaBeanItem.getItemProperty("property");

    Assert.assertNotNull(itemProperty);
    Assert.assertEquals("foo", itemProperty.getValue());

    Property nestedProperty = dynaBeanItem.
            getItemProperty("detail.property");
    Assert.assertNotNull(nestedProperty);
    Assert.assertEquals("bar", nestedProperty.getValue());
    Assert.assertEquals(String.class, nestedProperty.getType());

}
 
开发者ID:viritin,项目名称:viritin,代码行数:19,代码来源:NestedPropertyTest.java

示例10: createNameField

import com.vaadin.v7.data.Property; //导入依赖的package包/类
/**
 * Returns a field that will automatically capitalize names on blur (tab-out). Shows empty for null values.
 * See {@link FieldCleaner#cleanName FieldCleaner} for capitalization rules
 * @param name Field Name
 * @return TextField
 */
public static TextField createNameField(String name) {
    TextField textField = createTextField(name);
    textField.addValueChangeListener((Property.ValueChangeListener) event -> {
        if (event != null && event.getProperty() != null && event.getProperty().getValue() != null) {
            String input = event.getProperty().getValue().toString();event.getProperty().setValue(FieldCleaner.cleanName(input));
        }
    });
    return textField;
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:16,代码来源:FieldFactory.java

示例11: createPhoneNumberField

import com.vaadin.v7.data.Property; //导入依赖的package包/类
/**
 * Returns a TextField with validation rules to only allow phone numbers. Shows empty for null values.
 * Must contain 10-25 characters; Only allows digits, -, space, (, ), + or x; on blur, attempts to reformat the
 * phone number to (xxx) xxx-xxxx format (see {@link FieldCleaner#cleanPhoneNumber(String) FieldCleaner} for rules
 * @param name Field Name
 * @param tabIndex Tab Index
 * @return TextField
 */
public static TextField createPhoneNumberField(String name, int tabIndex) {
    TextField textField = createTextField(name);
    textField.addValidator(new RegexpValidator("[0-9 \\+\\-\\(\\)x]{10,25}",
            "Must contain 10-25 characters, only numbers, dash, space, parenthesis, + or x"));
    textField.addValueChangeListener((Property.ValueChangeListener) event -> {
        if (event != null && event.getProperty() != null && event.getProperty().getValue() != null) {
            String input = event.getProperty().getValue().toString();
                event.getProperty().setValue(FieldCleaner.cleanPhoneNumber(input));
        }
    });
    textField.setTabIndex(tabIndex);
    return textField;
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:22,代码来源:FieldFactory.java

示例12: setPropertyDataSource

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource)
{
    super.setPropertyDataSource(newDataSource);

    if (newDataSource != null) {
        layout.removeAllComponents();
        Component value = (Component) newDataSource.getValue();
        if (value != null) {
            layout.addComponent(value);
        }
    }
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:14,代码来源:ComponentCustomField.java

示例13: testCustomField

import com.vaadin.v7.data.Property; //导入依赖的package包/类
@Test
public void testCustomField() {

    Grid grid = createTestGrid();
    ComponentGridDecorator<ExampleBean> decorator = new ComponentGridDecorator<>(grid, ExampleBean.class);
    decorator.addComponentColumn(COLUMN_CAPTION, new ComponentGenerator<ExampleBean>() {
        @Override
        public Component getComponent(ExampleBean bean) {
            return new Label(bean.getCaption());
        }
    });

    Item item = grid.getContainerDataSource().getItem(grid.getContainerDataSource().getIdByIndex(0));

    Property prop = item.getItemProperty(COLUMN_CAPTION)
            ;
    ComponentCustomField field = new ComponentCustomField();
    HorizontalLayout layout = (HorizontalLayout)field.initContent();
    assertThat(layout, not(hasItem(isA(Label.class))));

    field.setPropertyDataSource(prop);

    assertThat(field.getValue(), instanceOf(Label.class));

    assertThat(layout, hasItem(isA(Label.class)));

}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:28,代码来源:ComponentCustomFieldTest.java

示例14: populateTable

import com.vaadin.v7.data.Property; //导入依赖的package包/类
private void populateTable(final String table) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setValue(select(getSelectedCatalog(), getSelectedSchema(), table));
    listOfTablesTable.addItem(new Object[] { checkBox, table }, table);
    checkBox.addValueChangeListener(new Property.ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (checkBox.getValue()) {
                org.jumpmind.db.model.Table t = new org.jumpmind.db.model.Table(table);
                selectedTablesSet.add(t);
            } else {
                Iterator<org.jumpmind.db.model.Table> selectedIterator = selectedTablesSet
                        .iterator();
                boolean notFound = true;
                while (selectedIterator.hasNext() || notFound) {
                    if (selectedIterator.next().getName().equals(table)) {
                        selectedIterator.remove();
                        notFound = false;
                    }
                }
            }
            selectionChanged();
        }
    });
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:29,代码来源:TableSelectionLayout.java

示例15: getPrimaryKeys

import com.vaadin.v7.data.Property; //导入依赖的package包/类
protected Object[] getPrimaryKeys() {
    String[] columnNames = resultTable.getPrimaryKeyColumnNames();
    Object[] pks = new Object[columnNames.length];
    Item row = grid.getContainerDataSource().getItem(grid.getEditedItemId());
    int index = 0;
    for (String columnName : columnNames) {
        Property<?> p = row.getItemProperty(columnName);
        if (p != null) {
            pks[index++] = p.getValue();
        } else {
            return null;
        }
    }
    return pks;
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:16,代码来源:TabularResultLayout.java


注:本文中的com.vaadin.v7.data.Property类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。