View Javadoc

1   package org.shortbrain.vaadin.container;
2   
3   import com.vaadin.data.util.BeanContainer;
4   import com.vaadin.data.util.ShortcutPropertyDescriptor;
5   
6   /**
7    * An extension of the {@link BeanContainer}, which adds shorcuts properties.
8    * 
9    * @author Vincent Demeester <vincent@shortbrain.org>
10   * 
11   * @param <IDTYPE>
12   *            The type of the item identifier
13   * @param <BEANTYPE>
14   *            The type of the Bean
15   * 
16   * @since 0.2.0
17   * 
18   * @see BeanContainer
19   */
20  public class ShortcutBeanContainer<IDTYPE, BEANTYPE> extends com.vaadin.data.util.BeanContainer<IDTYPE, BEANTYPE>
21          implements IShortcutBeanContainer {
22  
23      private static final long serialVersionUID = 2865701930991415312L;
24  
25      /**
26       * Create a {@link ShortcutBeanContainer}
27       * 
28       * @param type
29       *            The type of the Bean
30       */
31      public ShortcutBeanContainer(Class<? super BEANTYPE> type) {
32          super(type);
33      }
34  
35      @SuppressWarnings({ "rawtypes", "unchecked" })
36      public boolean addShortcutContainerProperty(String propertyId, String propertyPath) {
37          return addContainerProperty(propertyId, new ShortcutPropertyDescriptor(propertyId, propertyPath, getBeanType()));
38      }
39  }