@Test public void testAddRemoveProperty() throws Exception { MethodPropertyDescriptor<BeanItemTest.MyClass> pd = new MethodPropertyDescriptor<BeanItemTest.MyClass>( "myname", MyClass.class, MyClass.class.getDeclaredMethod("getName"), MyClass.class.getDeclaredMethod("setName", String.class)); BeanItem<MyClass> item = new BeanItem<MyClass>(new MyClass("bean1")); Assert.assertEquals(6, item.getItemPropertyIds().size()); Assert.assertEquals(null, item.getItemProperty("myname")); item.addItemProperty("myname", pd.createProperty(item.getBean())); Assert.assertEquals(7, item.getItemPropertyIds().size()); Assert.assertEquals("bean1", item.getItemProperty("myname").getValue()); item.removeItemProperty("myname"); Assert.assertEquals(6, item.getItemPropertyIds().size()); Assert.assertEquals(null, item.getItemProperty("myname")); }
public BT getBean() { return bean; }
BeanItem extends PropertysetItem { public BT getBean() { return bean; } }
BeanItem extends PropertysetItem { public BT getBean() { return bean; } BeanItem(BT bean);  BeanItem(BT bean, Class<BT> beanClass);   BeanItem(BT bean,
            Map<String, VaadinPropertyDescriptor<BT>> propertyDescriptors);  BeanItem(BT bean, Collection<?> propertyIds);  BeanItem(BT bean, String... propertyIds); }
BeanItem extends PropertysetItem { public BT getBean() { return bean; } BeanItem(BT bean);  BeanItem(BT bean, Class<BT> beanClass);   BeanItem(BT bean,
            Map<String, VaadinPropertyDescriptor<BT>> propertyDescriptors);  BeanItem(BT bean, Collection<?> propertyIds);  BeanItem(BT bean, String... propertyIds); void expandProperty(String propertyId, String... subPropertyIds); void addNestedProperty(String nestedPropertyId); BT getBean(); }
BeanItem extends PropertysetItem { public BT getBean() { return bean; } BeanItem(BT bean);  BeanItem(BT bean, Class<BT> beanClass);   BeanItem(BT bean,
            Map<String, VaadinPropertyDescriptor<BT>> propertyDescriptors);  BeanItem(BT bean, Collection<?> propertyIds);  BeanItem(BT bean, String... propertyIds); void expandProperty(String propertyId, String... subPropertyIds); void addNestedProperty(String nestedPropertyId); BT getBean();  }