@@ -697,6 +697,7 @@ public interface Container extends Serializable { | |||
* @return <code>true</code> if the operation succeeded, | |||
* <code>false</code> if not | |||
*/ | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException; | |||
} |
@@ -23,6 +23,7 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { | |||
public static final Object CAPTION_PROPERTY_ID = "Caption"; | |||
@Override | |||
public <T extends Field> T createField(Class<?> type, Class<T> fieldType) { | |||
if (Enum.class.isAssignableFrom(type)) { | |||
return createEnumField(type, fieldType); |
@@ -96,6 +96,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
this.propertyId = propertyId; | |||
} | |||
@Override | |||
@SuppressWarnings("unchecked") | |||
public IDTYPE getIdForBean(BEANTYPE bean) | |||
throws IllegalArgumentException { | |||
@@ -163,6 +164,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* | |||
* @see com.vaadin.data.Container#getType(java.lang.Object) | |||
*/ | |||
@Override | |||
public Class<?> getType(Object propertyId) { | |||
return model.get(propertyId).getPropertyType(); | |||
} | |||
@@ -195,6 +197,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* | |||
* @see com.vaadin.data.Container#getContainerPropertyIds() | |||
*/ | |||
@Override | |||
public Collection<String> getContainerPropertyIds() { | |||
return model.keySet(); | |||
} | |||
@@ -258,6 +261,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, | |||
* java.lang.Object) | |||
*/ | |||
@Override | |||
public Property<?> getContainerProperty(Object itemId, Object propertyId) { | |||
Item item = getItem(itemId); | |||
if (item == null) { | |||
@@ -300,6 +304,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
/** | |||
* Re-filter the container when one of the monitored properties changes. | |||
*/ | |||
@Override | |||
public void valueChange(ValueChangeEvent event) { | |||
// if a property that is used in a filter is changed, refresh filtering | |||
filterAll(); | |||
@@ -312,6 +317,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* com.vaadin.data.Container.Filterable#addContainerFilter(java.lang.Object, | |||
* java.lang.String, boolean, boolean) | |||
*/ | |||
@Override | |||
public void addContainerFilter(Object propertyId, String filterString, | |||
boolean ignoreCase, boolean onlyMatchPrefix) { | |||
try { | |||
@@ -328,6 +334,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* | |||
* @see com.vaadin.data.Container.Filterable#removeAllContainerFilters() | |||
*/ | |||
@Override | |||
public void removeAllContainerFilters() { | |||
if (!getFilters().isEmpty()) { | |||
for (Item item : itemIdToItem.values()) { | |||
@@ -344,6 +351,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* com.vaadin.data.Container.Filterable#removeContainerFilters(java.lang | |||
* .Object) | |||
*/ | |||
@Override | |||
public void removeContainerFilters(Object propertyId) { | |||
Collection<Filter> removedFilters = super.removeFilters(propertyId); | |||
if (!removedFilters.isEmpty()) { | |||
@@ -354,11 +362,13 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
} | |||
} | |||
@Override | |||
public void addContainerFilter(Filter filter) | |||
throws UnsupportedFilterException { | |||
addFilter(filter); | |||
} | |||
@Override | |||
public void removeContainerFilter(Filter filter) { | |||
removeFilter(filter); | |||
} | |||
@@ -416,6 +426,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* | |||
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() | |||
*/ | |||
@Override | |||
public Collection<?> getSortableContainerPropertyIds() { | |||
return getSortablePropertyIds(); | |||
} | |||
@@ -426,6 +437,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends | |||
* @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], | |||
* boolean[]) | |||
*/ | |||
@Override | |||
public void sort(Object[] propertyId, boolean[] ascending) { | |||
sortContainer(propertyId, ascending); | |||
} |
@@ -52,6 +52,7 @@ public abstract class AbstractContainer implements Container { | |||
super(source); | |||
} | |||
@Override | |||
public Container getContainer() { | |||
return (Container) getSource(); | |||
} | |||
@@ -72,6 +73,7 @@ public abstract class AbstractContainer implements Container { | |||
super(source); | |||
} | |||
@Override | |||
public Container getContainer() { | |||
return (Container) getSource(); | |||
} |
@@ -125,6 +125,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
// Container interface methods with more specific return class | |||
// default implementation, can be overridden | |||
@Override | |||
public ITEMCLASS getItem(Object itemId) { | |||
if (containsId(itemId)) { | |||
return getUnfilteredItem(itemId); | |||
@@ -152,10 +153,12 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
// Container interface method implementations | |||
@Override | |||
public int size() { | |||
return getVisibleItemIds().size(); | |||
} | |||
@Override | |||
public boolean containsId(Object itemId) { | |||
// only look at visible items after filtering | |||
if (itemId == null) { | |||
@@ -165,12 +168,14 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
} | |||
} | |||
@Override | |||
public List<?> getItemIds() { | |||
return Collections.unmodifiableList(getVisibleItemIds()); | |||
} | |||
// Container.Ordered | |||
@Override | |||
public ITEMIDTYPE nextItemId(Object itemId) { | |||
int index = indexOfId(itemId); | |||
if (index >= 0 && index < size() - 1) { | |||
@@ -181,6 +186,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
} | |||
} | |||
@Override | |||
public ITEMIDTYPE prevItemId(Object itemId) { | |||
int index = indexOfId(itemId); | |||
if (index > 0) { | |||
@@ -191,6 +197,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
} | |||
} | |||
@Override | |||
public ITEMIDTYPE firstItemId() { | |||
if (size() > 0) { | |||
return getIdByIndex(0); | |||
@@ -199,6 +206,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
} | |||
} | |||
@Override | |||
public ITEMIDTYPE lastItemId() { | |||
if (size() > 0) { | |||
return getIdByIndex(size() - 1); | |||
@@ -207,6 +215,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
} | |||
} | |||
@Override | |||
public boolean isFirstId(Object itemId) { | |||
if (itemId == null) { | |||
return false; | |||
@@ -214,6 +223,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
return itemId.equals(firstItemId()); | |||
} | |||
@Override | |||
public boolean isLastId(Object itemId) { | |||
if (itemId == null) { | |||
return false; | |||
@@ -223,66 +233,78 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE | |||
// Container.Indexed | |||
@Override | |||
public ITEMIDTYPE getIdByIndex(int index) { | |||
return getVisibleItemIds().get(index); | |||
} | |||
@Override | |||
public int indexOfId(Object itemId) { | |||
return getVisibleItemIds().indexOf(itemId); | |||
} | |||
// methods that are unsupported by default, override to support | |||
@Override | |||
public Object addItemAt(int index) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public Item addItemAt(int index, Object newItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public Object addItemAfter(Object previousItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public Item addItemAfter(Object previousItemId, Object newItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public Item addItem(Object itemId) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public Object addItem() throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Removing items not supported. Override the removeItem() method if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public boolean removeAllItems() throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Removing items not supported. Override the removeAllItems() method if required as specified in AbstractInMemoryContainer javadoc."); | |||
} | |||
@Override | |||
public boolean addContainerProperty(Object propertyId, Class<?> type, | |||
Object defaultValue) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"Adding container properties not supported. Override the addContainerProperty() method if required."); | |||
} | |||
@Override | |||
public boolean removeContainerProperty(Object propertyId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( |
@@ -42,10 +42,12 @@ public abstract class AbstractProperty<T> implements Property<T>, | |||
* Override for additional restrictions on what is considered a read-only | |||
* property. | |||
*/ | |||
@Override | |||
public boolean isReadOnly() { | |||
return readOnly; | |||
} | |||
@Override | |||
public void setReadOnly(boolean newStatus) { | |||
boolean oldStatus = isReadOnly(); | |||
readOnly = newStatus; | |||
@@ -93,6 +95,7 @@ public abstract class AbstractProperty<T> implements Property<T>, | |||
* | |||
* @return source Property of the event. | |||
*/ | |||
@Override | |||
public Property getProperty() { | |||
return (Property) getSource(); | |||
} | |||
@@ -105,6 +108,7 @@ public abstract class AbstractProperty<T> implements Property<T>, | |||
* @param listener | |||
* the new Listener to be registered. | |||
*/ | |||
@Override | |||
public void addListener(Property.ReadOnlyStatusChangeListener listener) { | |||
if (readOnlyStatusChangeListeners == null) { | |||
readOnlyStatusChangeListeners = new LinkedList<ReadOnlyStatusChangeListener>(); | |||
@@ -118,6 +122,7 @@ public abstract class AbstractProperty<T> implements Property<T>, | |||
* @param listener | |||
* the listener to be removed. | |||
*/ | |||
@Override | |||
public void removeListener(Property.ReadOnlyStatusChangeListener listener) { | |||
if (readOnlyStatusChangeListeners != null) { | |||
readOnlyStatusChangeListeners.remove(listener); | |||
@@ -161,12 +166,14 @@ public abstract class AbstractProperty<T> implements Property<T>, | |||
* | |||
* @return source Property of the event. | |||
*/ | |||
@Override | |||
public Property getProperty() { | |||
return (Property) getSource(); | |||
} | |||
} | |||
@Override | |||
public void addListener(ValueChangeListener listener) { | |||
if (valueChangeListeners == null) { | |||
valueChangeListeners = new LinkedList<ValueChangeListener>(); | |||
@@ -175,6 +182,7 @@ public abstract class AbstractProperty<T> implements Property<T>, | |||
} | |||
@Override | |||
public void removeListener(ValueChangeListener listener) { | |||
if (valueChangeListeners != null) { | |||
valueChangeListeners.remove(listener); |
@@ -59,6 +59,7 @@ public class BeanItemContainer<BEANTYPE> extends | |||
private static class IdentityBeanIdResolver<BT> implements | |||
BeanIdResolver<BT, BT> { | |||
@Override | |||
public BT getIdForBean(BT bean) { | |||
return bean; | |||
} |
@@ -71,6 +71,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
this.itemIds = itemIds; | |||
} | |||
@Override | |||
public int compare(Object o1, Object o2) { | |||
if (o1.equals(o2)) { | |||
return 0; | |||
@@ -233,6 +234,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* Can the specified Item have any children? Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public boolean areChildrenAllowed(Object itemId) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -253,6 +255,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> getChildren(Object itemId) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -272,6 +275,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Object getParent(Object itemId) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -287,6 +291,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean hasChildren(Object itemId) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -303,6 +308,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean isRoot(Object itemId) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -322,6 +328,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> rootItemIds() { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -351,6 +358,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @return <code>true</code> if the operation succeeded, <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean setChildrenAllowed(Object itemId, boolean childrenAllowed) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -391,6 +399,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @return <code>true</code> if the operation succeeded, <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean setParent(Object itemId, Object newParentId) { | |||
// If the wrapped container implements the method directly, use it | |||
@@ -483,6 +492,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @throws UnsupportedOperationException | |||
* if the addItem is not supported. | |||
*/ | |||
@Override | |||
public Object addItem() throws UnsupportedOperationException { | |||
final Object id = container.addItem(); | |||
@@ -502,6 +512,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @throws UnsupportedOperationException | |||
* if the addItem is not supported. | |||
*/ | |||
@Override | |||
public Item addItem(Object itemId) throws UnsupportedOperationException { | |||
// Null ids are not accepted | |||
@@ -524,6 +535,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @throws UnsupportedOperationException | |||
* if the removeAllItems is not supported. | |||
*/ | |||
@Override | |||
public boolean removeAllItems() throws UnsupportedOperationException { | |||
final boolean success = container.removeAllItems(); | |||
@@ -548,6 +560,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @throws UnsupportedOperationException | |||
* if the removeItem is not supported. | |||
*/ | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException { | |||
@@ -586,6 +599,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @throws UnsupportedOperationException | |||
* if the addContainerProperty is not supported. | |||
*/ | |||
@Override | |||
public boolean addContainerProperty(Object propertyId, Class<?> type, | |||
Object defaultValue) throws UnsupportedOperationException { | |||
@@ -606,6 +620,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* @throws UnsupportedOperationException | |||
* if the removeContainerProperty is not supported. | |||
*/ | |||
@Override | |||
public boolean removeContainerProperty(Object propertyId) | |||
throws UnsupportedOperationException { | |||
return container.removeContainerProperty(propertyId); | |||
@@ -616,6 +631,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean containsId(Object itemId) { | |||
return container.containsId(itemId); | |||
} | |||
@@ -624,6 +640,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* Gets the specified Item from the container. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Item getItem(Object itemId) { | |||
return container.getItem(itemId); | |||
} | |||
@@ -633,6 +650,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> getItemIds() { | |||
return container.getItemIds(); | |||
} | |||
@@ -642,6 +660,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* Container Don't add a JavaDoc comment here, we use the default | |||
* documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Property<?> getContainerProperty(Object itemId, Object propertyId) { | |||
return container.getContainerProperty(itemId, propertyId); | |||
} | |||
@@ -651,6 +670,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> getContainerPropertyIds() { | |||
return container.getContainerPropertyIds(); | |||
} | |||
@@ -660,6 +680,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* Don't add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public Class<?> getType(Object propertyId) { | |||
return container.getType(propertyId); | |||
} | |||
@@ -668,6 +689,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* Gets the number of Items in the Container. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public int size() { | |||
return container.size(); | |||
} | |||
@@ -677,6 +699,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void addListener(Container.ItemSetChangeListener listener) { | |||
if (container instanceof Container.ItemSetChangeNotifier) { | |||
((Container.ItemSetChangeNotifier) container) | |||
@@ -689,6 +712,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void removeListener(Container.ItemSetChangeListener listener) { | |||
if (container instanceof Container.ItemSetChangeNotifier) { | |||
((Container.ItemSetChangeNotifier) container) | |||
@@ -701,6 +725,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public void addListener(Container.PropertySetChangeListener listener) { | |||
if (container instanceof Container.PropertySetChangeNotifier) { | |||
((Container.PropertySetChangeNotifier) container) | |||
@@ -713,6 +738,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void removeListener(Container.PropertySetChangeListener listener) { | |||
if (container instanceof Container.PropertySetChangeNotifier) { | |||
((Container.PropertySetChangeNotifier) container) | |||
@@ -736,6 +762,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
listener = realListener; | |||
} | |||
@Override | |||
public void containerItemSetChange(ItemSetChangeEvent event) { | |||
updateHierarchicalWrapper(); | |||
((Container.ItemSetChangeListener) listener) | |||
@@ -743,6 +770,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, | |||
} | |||
@Override | |||
public void containerPropertySetChange(PropertySetChangeEvent event) { | |||
updateHierarchicalWrapper(); | |||
((Container.PropertySetChangeListener) listener) |
@@ -221,6 +221,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Object firstItemId() { | |||
if (ordered) { | |||
return ((Container.Ordered) container).firstItemId(); | |||
@@ -233,6 +234,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean isFirstId(Object itemId) { | |||
if (ordered) { | |||
return ((Container.Ordered) container).isFirstId(itemId); | |||
@@ -245,6 +247,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean isLastId(Object itemId) { | |||
if (ordered) { | |||
return ((Container.Ordered) container).isLastId(itemId); | |||
@@ -257,6 +260,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Object lastItemId() { | |||
if (ordered) { | |||
return ((Container.Ordered) container).lastItemId(); | |||
@@ -269,6 +273,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Object nextItemId(Object itemId) { | |||
if (ordered) { | |||
return ((Container.Ordered) container).nextItemId(itemId); | |||
@@ -284,6 +289,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Object prevItemId(Object itemId) { | |||
if (ordered) { | |||
return ((Container.Ordered) container).prevItemId(itemId); | |||
@@ -306,6 +312,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @return <code>true</code> if the operation succeeded, <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean addContainerProperty(Object propertyId, Class<?> type, | |||
Object defaultValue) throws UnsupportedOperationException { | |||
@@ -321,6 +328,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItem is not supported. | |||
*/ | |||
@Override | |||
public Object addItem() throws UnsupportedOperationException { | |||
final Object id = container.addItem(); | |||
@@ -340,6 +348,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItem is not supported. | |||
*/ | |||
@Override | |||
public Item addItem(Object itemId) throws UnsupportedOperationException { | |||
final Item item = container.addItem(itemId); | |||
if (!ordered && item != null) { | |||
@@ -356,6 +365,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeAllItems is not supported. | |||
*/ | |||
@Override | |||
public boolean removeAllItems() throws UnsupportedOperationException { | |||
final boolean success = container.removeAllItems(); | |||
if (!ordered && success) { | |||
@@ -377,6 +387,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeItem is not supported. | |||
*/ | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException { | |||
@@ -401,6 +412,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeContainerProperty is not supported. | |||
*/ | |||
@Override | |||
public boolean removeContainerProperty(Object propertyId) | |||
throws UnsupportedOperationException { | |||
return container.removeContainerProperty(propertyId); | |||
@@ -411,6 +423,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean containsId(Object itemId) { | |||
return container.containsId(itemId); | |||
} | |||
@@ -419,6 +432,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* Gets the specified Item from the container. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Item getItem(Object itemId) { | |||
return container.getItem(itemId); | |||
} | |||
@@ -428,6 +442,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> getItemIds() { | |||
return container.getItemIds(); | |||
} | |||
@@ -437,6 +452,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* Container Don't add a JavaDoc comment here, we use the default | |||
* documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Property<?> getContainerProperty(Object itemId, Object propertyId) { | |||
return container.getContainerProperty(itemId, propertyId); | |||
} | |||
@@ -446,6 +462,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> getContainerPropertyIds() { | |||
return container.getContainerPropertyIds(); | |||
} | |||
@@ -455,6 +472,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* Don't add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public Class<?> getType(Object propertyId) { | |||
return container.getType(propertyId); | |||
} | |||
@@ -463,6 +481,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* Gets the number of Items in the Container. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public int size() { | |||
int newSize = container.size(); | |||
if (lastKnownSize != -1 && newSize != lastKnownSize | |||
@@ -480,6 +499,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void addListener(Container.ItemSetChangeListener listener) { | |||
if (container instanceof Container.ItemSetChangeNotifier) { | |||
((Container.ItemSetChangeNotifier) container) | |||
@@ -492,6 +512,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void removeListener(Container.ItemSetChangeListener listener) { | |||
if (container instanceof Container.ItemSetChangeNotifier) { | |||
((Container.ItemSetChangeNotifier) container) | |||
@@ -504,6 +525,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public void addListener(Container.PropertySetChangeListener listener) { | |||
if (container instanceof Container.PropertySetChangeNotifier) { | |||
((Container.PropertySetChangeNotifier) container) | |||
@@ -516,6 +538,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void removeListener(Container.PropertySetChangeListener listener) { | |||
if (container instanceof Container.PropertySetChangeNotifier) { | |||
((Container.PropertySetChangeNotifier) container) | |||
@@ -529,6 +552,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object, | |||
* java.lang.Object) | |||
*/ | |||
@Override | |||
public Item addItemAfter(Object previousItemId, Object newItemId) | |||
throws UnsupportedOperationException { | |||
@@ -553,6 +577,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
* | |||
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) | |||
*/ | |||
@Override | |||
public Object addItemAfter(Object previousItemId) | |||
throws UnsupportedOperationException { | |||
@@ -588,6 +613,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
listener = realListener; | |||
} | |||
@Override | |||
public void containerItemSetChange(ItemSetChangeEvent event) { | |||
updateOrderWrapper(); | |||
((Container.ItemSetChangeListener) listener) | |||
@@ -595,6 +621,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, | |||
} | |||
@Override | |||
public void containerPropertySetChange(PropertySetChangeEvent event) { | |||
updateOrderWrapper(); | |||
((Container.PropertySetChangeListener) listener) |
@@ -61,6 +61,7 @@ public class DefaultItemSorter implements ItemSorter { | |||
* @see com.vaadin.data.util.ItemSorter#compare(java.lang.Object, | |||
* java.lang.Object) | |||
*/ | |||
@Override | |||
public int compare(Object o1, Object o2) { | |||
Item item1 = container.getItem(o1); | |||
Item item2 = container.getItem(o2); | |||
@@ -147,6 +148,7 @@ public class DefaultItemSorter implements ItemSorter { | |||
* com.vaadin.data.util.ItemSorter#setSortProperties(com.vaadin.data.Container | |||
* .Sortable, java.lang.Object[], boolean[]) | |||
*/ | |||
@Override | |||
public void setSortProperties(Container.Sortable container, | |||
Object[] propertyId, boolean[] ascending) { | |||
this.container = container; | |||
@@ -181,6 +183,7 @@ public class DefaultItemSorter implements ItemSorter { | |||
public static class DefaultPropertyValueComparator implements | |||
Comparator<Object>, Serializable { | |||
@Override | |||
@SuppressWarnings("unchecked") | |||
public int compare(Object o1, Object o2) { | |||
int r = 0; |
@@ -187,6 +187,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* @return <code>true</code> if the specified Item is a directory, | |||
* <code>false</code> otherwise. | |||
*/ | |||
@Override | |||
public boolean areChildrenAllowed(Object itemId) { | |||
return itemId instanceof File && ((File) itemId).canRead() | |||
&& ((File) itemId).isDirectory(); | |||
@@ -197,6 +198,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public Collection<File> getChildren(Object itemId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -223,6 +225,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* Gets the parent item of the specified Item. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Object getParent(Object itemId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -235,6 +238,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* Tests if the specified Item has any children. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public boolean hasChildren(Object itemId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -254,6 +258,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean isRoot(Object itemId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -272,6 +277,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<File> rootItemIds() { | |||
File[] f; | |||
@@ -311,6 +317,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* @throws UnsupportedOperationException | |||
* if the setChildrenAllowed is not supported. | |||
*/ | |||
@Override | |||
public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) | |||
throws UnsupportedOperationException { | |||
@@ -332,6 +339,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* @throws UnsupportedOperationException | |||
* if the setParent is not supported. | |||
*/ | |||
@Override | |||
public boolean setParent(Object itemId, Object newParentId) | |||
throws UnsupportedOperationException { | |||
@@ -343,6 +351,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean containsId(Object itemId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -371,6 +380,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* Gets the specified Item from the filesystem. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Item getItem(Object itemId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -416,6 +426,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* Gets the IDs of Items in the filesystem. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Collection<File> getItemIds() { | |||
if (recursive) { | |||
@@ -459,6 +470,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* the property's ID. | |||
* @return the requested property's value, or <code>null</code> | |||
*/ | |||
@Override | |||
public Property<?> getContainerProperty(Object itemId, Object propertyId) { | |||
if (!(itemId instanceof File)) { | |||
@@ -493,6 +505,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @return Unmodifiable collection containing all available file properties. | |||
*/ | |||
@Override | |||
public Collection<String> getContainerPropertyIds() { | |||
return FILE_PROPERTIES; | |||
} | |||
@@ -506,6 +519,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* the ID of the property whose type is requested. | |||
* @return data type of the requested property, or <code>null</code> | |||
*/ | |||
@Override | |||
public Class<?> getType(Object propertyId) { | |||
if (propertyId.equals(PROPERTY_NAME)) { | |||
@@ -556,6 +570,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @return Number of Items in the container. | |||
*/ | |||
@Override | |||
public int size() { | |||
if (recursive) { | |||
@@ -609,6 +624,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* Gets the specified property of this file. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public Property<?> getItemProperty(Object id) { | |||
return getContainerProperty(file, id); | |||
} | |||
@@ -618,6 +634,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public Collection<String> getItemPropertyIds() { | |||
return getContainerPropertyIds(); | |||
} | |||
@@ -716,6 +733,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Item#addItemProperty(Object, Property) | |||
*/ | |||
@Override | |||
public boolean addItemProperty(Object id, Property property) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException("Filesystem container " | |||
@@ -727,6 +745,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Item#removeItemProperty(Object) | |||
*/ | |||
@Override | |||
public boolean removeItemProperty(Object id) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
@@ -763,6 +782,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see java.io.FilenameFilter#accept(File, String) | |||
*/ | |||
@Override | |||
public boolean accept(File dir, String name) { | |||
if (name.endsWith(filter)) { | |||
return true; | |||
@@ -832,6 +852,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, | |||
* java.lang.Class, java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean addContainerProperty(Object propertyId, Class<?> type, | |||
Object defaultValue) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
@@ -843,6 +864,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Container#addItem() | |||
*/ | |||
@Override | |||
public Object addItem() throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"File system container does not support this operation"); | |||
@@ -853,6 +875,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Container#addItem(java.lang.Object) | |||
*/ | |||
@Override | |||
public Item addItem(Object itemId) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"File system container does not support this operation"); | |||
@@ -863,6 +886,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Container#removeAllItems() | |||
*/ | |||
@Override | |||
public boolean removeAllItems() throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
"File system container does not support this operation"); | |||
@@ -873,6 +897,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Container#removeItem(java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
@@ -884,6 +909,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
* | |||
* @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object ) | |||
*/ | |||
@Override | |||
public boolean removeContainerProperty(Object propertyId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( |
@@ -77,6 +77,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* Can the specified Item have any children? Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public boolean areChildrenAllowed(Object itemId) { | |||
if (noChildrenAllowed.contains(itemId)) { | |||
return false; | |||
@@ -89,6 +90,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> getChildren(Object itemId) { | |||
LinkedList<Object> c; | |||
@@ -109,6 +111,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Object getParent(Object itemId) { | |||
if (filteredParent != null) { | |||
return filteredParent.get(itemId); | |||
@@ -121,6 +124,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean hasChildren(Object itemId) { | |||
if (filteredChildren != null) { | |||
return filteredChildren.containsKey(itemId); | |||
@@ -134,6 +138,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public boolean isRoot(Object itemId) { | |||
// If the container is filtered the itemId must be among filteredRoots | |||
// to be a root. | |||
@@ -156,6 +161,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public Collection<?> rootItemIds() { | |||
if (filteredRoots != null) { | |||
return Collections.unmodifiableCollection(filteredRoots); | |||
@@ -183,6 +189,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* @return <code>true</code> if the operation succeeded, <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean setChildrenAllowed(Object itemId, boolean childrenAllowed) { | |||
// Checks that the item is in the container | |||
@@ -217,6 +224,7 @@ public class HierarchicalContainer extends IndexedContainer implements | |||
* @return <code>true</code> if the operation succeeded, <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean setParent(Object itemId, Object newParentId) { | |||
// Checks that the item is in the container |
@@ -25,35 +25,43 @@ public class HierarchicalContainerOrderedWrapper extends | |||
hierarchical = toBeWrapped; | |||
} | |||
@Override | |||
public boolean areChildrenAllowed(Object itemId) { | |||
return hierarchical.areChildrenAllowed(itemId); | |||
} | |||
@Override | |||
public Collection<?> getChildren(Object itemId) { | |||
return hierarchical.getChildren(itemId); | |||
} | |||
@Override | |||
public Object getParent(Object itemId) { | |||
return hierarchical.getParent(itemId); | |||
} | |||
@Override | |||
public boolean hasChildren(Object itemId) { | |||
return hierarchical.hasChildren(itemId); | |||
} | |||
@Override | |||
public boolean isRoot(Object itemId) { | |||
return hierarchical.isRoot(itemId); | |||
} | |||
@Override | |||
public Collection<?> rootItemIds() { | |||
return hierarchical.rootItemIds(); | |||
} | |||
@Override | |||
public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) | |||
throws UnsupportedOperationException { | |||
return hierarchical.setChildrenAllowed(itemId, areChildrenAllowed); | |||
} | |||
@Override | |||
public boolean setParent(Object itemId, Object newParentId) | |||
throws UnsupportedOperationException { | |||
return hierarchical.setParent(itemId, newParentId); |
@@ -128,6 +128,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Container#getContainerPropertyIds() | |||
*/ | |||
@Override | |||
public Collection<?> getContainerPropertyIds() { | |||
return Collections.unmodifiableCollection(propertyIds); | |||
} | |||
@@ -139,6 +140,7 @@ public class IndexedContainer extends | |||
* the ID of the Property. | |||
* @return Type of the requested Property | |||
*/ | |||
@Override | |||
public Class<?> getType(Object propertyId) { | |||
return types.get(propertyId); | |||
} | |||
@@ -149,6 +151,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, | |||
* java.lang.Object) | |||
*/ | |||
@Override | |||
public Property<?> getContainerProperty(Object itemId, Object propertyId) { | |||
if (!containsId(itemId)) { | |||
return null; | |||
@@ -466,6 +469,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Property.ValueChangeEvent#getProperty() | |||
*/ | |||
@Override | |||
public Property getProperty() { | |||
return (Property) getSource(); | |||
} | |||
@@ -488,6 +492,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Property.ValueChangeNotifier#addListener(com. | |||
* vaadin.data.Property.ValueChangeListener) | |||
*/ | |||
@Override | |||
public void addListener(Property.ValueChangeListener listener) { | |||
if (propertyValueChangeListeners == null) { | |||
propertyValueChangeListeners = new LinkedList<Property.ValueChangeListener>(); | |||
@@ -501,6 +506,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Property.ValueChangeNotifier#removeListener(com | |||
* .vaadin.data.Property.ValueChangeListener) | |||
*/ | |||
@Override | |||
public void removeListener(Property.ValueChangeListener listener) { | |||
if (propertyValueChangeListeners != null) { | |||
propertyValueChangeListeners.remove(listener); | |||
@@ -679,10 +685,12 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Item#getItemProperty(java.lang.Object) | |||
*/ | |||
@Override | |||
public Property<?> getItemProperty(Object id) { | |||
return new IndexedContainerProperty(itemId, id); | |||
} | |||
@Override | |||
public Collection<?> getItemPropertyIds() { | |||
return Collections.unmodifiableCollection(propertyIds); | |||
} | |||
@@ -753,6 +761,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Item#addProperty(Object, Property) | |||
*/ | |||
@Override | |||
public boolean addItemProperty(Object id, Property property) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException("Indexed container item " | |||
@@ -766,6 +775,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Item#removeProperty(Object) | |||
*/ | |||
@Override | |||
public boolean removeItemProperty(Object id) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException( | |||
@@ -824,6 +834,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Property#getType() | |||
*/ | |||
@Override | |||
public Class<?> getType() { | |||
return types.get(propertyId); | |||
} | |||
@@ -833,6 +844,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Property#getValue() | |||
*/ | |||
@Override | |||
public Object getValue() { | |||
return items.get(itemId).get(propertyId); | |||
} | |||
@@ -842,6 +854,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Property#isReadOnly() | |||
*/ | |||
@Override | |||
public boolean isReadOnly() { | |||
return readOnlyProperties.contains(this); | |||
} | |||
@@ -851,6 +864,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Property#setReadOnly(boolean) | |||
*/ | |||
@Override | |||
public void setReadOnly(boolean newStatus) { | |||
if (newStatus) { | |||
readOnlyProperties.add(this); | |||
@@ -864,6 +878,7 @@ public class IndexedContainer extends | |||
* | |||
* @see com.vaadin.data.Property#setValue(java.lang.Object) | |||
*/ | |||
@Override | |||
public void setValue(Object newValue) throws Property.ReadOnlyException { | |||
// Gets the Property set | |||
final Map<Object, Object> propertySet = items.get(itemId); | |||
@@ -946,6 +961,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Property.ValueChangeNotifier#addListener( | |||
* com.vaadin.data.Property.ValueChangeListener) | |||
*/ | |||
@Override | |||
public void addListener(Property.ValueChangeListener listener) { | |||
addSinglePropertyChangeListener(propertyId, itemId, listener); | |||
} | |||
@@ -956,6 +972,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Property.ValueChangeNotifier#removeListener | |||
* (com.vaadin.data.Property.ValueChangeListener) | |||
*/ | |||
@Override | |||
public void removeListener(Property.ValueChangeListener listener) { | |||
removeSinglePropertyChangeListener(propertyId, itemId, listener); | |||
} | |||
@@ -972,6 +989,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], | |||
* boolean[]) | |||
*/ | |||
@Override | |||
public void sort(Object[] propertyId, boolean[] ascending) { | |||
sortContainer(propertyId, ascending); | |||
} | |||
@@ -982,6 +1000,7 @@ public class IndexedContainer extends | |||
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds | |||
* () | |||
*/ | |||
@Override | |||
public Collection<?> getSortableContainerPropertyIds() { | |||
return getSortablePropertyIds(); | |||
} | |||
@@ -1054,6 +1073,7 @@ public class IndexedContainer extends | |||
return nc; | |||
} | |||
@Override | |||
public void addContainerFilter(Object propertyId, String filterString, | |||
boolean ignoreCase, boolean onlyMatchPrefix) { | |||
try { | |||
@@ -1065,19 +1085,23 @@ public class IndexedContainer extends | |||
} | |||
} | |||
@Override | |||
public void removeAllContainerFilters() { | |||
removeAllFilters(); | |||
} | |||
@Override | |||
public void removeContainerFilters(Object propertyId) { | |||
removeFilters(propertyId); | |||
} | |||
@Override | |||
public void addContainerFilter(Filter filter) | |||
throws UnsupportedFilterException { | |||
addFilter(filter); | |||
} | |||
@Override | |||
public void removeContainerFilter(Filter filter) { | |||
removeFilter(filter); | |||
} |
@@ -51,6 +51,7 @@ public interface ItemSorter extends Comparator<Object>, Cloneable, Serializable | |||
* | |||
* @see Comparator#compare(Object, Object) | |||
*/ | |||
@Override | |||
int compare(Object itemId1, Object itemId2); | |||
} |
@@ -568,6 +568,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { | |||
* | |||
* @return type of the Property | |||
*/ | |||
@Override | |||
public final Class<? extends T> getType() { | |||
return type; | |||
} | |||
@@ -591,6 +592,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { | |||
* | |||
* @return the value of the Property | |||
*/ | |||
@Override | |||
public T getValue() { | |||
try { | |||
return (T) getMethod.invoke(instance, getArgs); | |||
@@ -638,6 +640,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { | |||
* read-only mode. | |||
* @see #invokeSetMethod(Object) | |||
*/ | |||
@Override | |||
@SuppressWarnings("unchecked") | |||
public void setValue(Object newValue) throws Property.ReadOnlyException { | |||
@@ -112,14 +112,17 @@ public class MethodPropertyDescriptor<BT> implements | |||
} | |||
}; | |||
@Override | |||
public String getName() { | |||
return name; | |||
} | |||
@Override | |||
public Class<?> getPropertyType() { | |||
return propertyType; | |||
} | |||
@Override | |||
public Property<?> createProperty(Object bean) { | |||
return new MethodProperty<Object>(propertyType, bean, readMethod, | |||
writeMethod); |
@@ -165,6 +165,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> { | |||
this.setMethod = setMethod; | |||
} | |||
@Override | |||
public Class<? extends T> getType() { | |||
return type; | |||
} | |||
@@ -180,6 +181,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> { | |||
* | |||
* @return the value of the Property | |||
*/ | |||
@Override | |||
public T getValue() { | |||
try { | |||
Object object = instance; | |||
@@ -202,6 +204,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> { | |||
* read-only mode. | |||
* @see #invokeSetMethod(Object) | |||
*/ | |||
@Override | |||
public void setValue(Object newValue) throws ReadOnlyException { | |||
// Checks the mode | |||
if (isReadOnly()) { |
@@ -42,14 +42,17 @@ public class NestedPropertyDescriptor<BT> implements | |||
this.propertyType = property.getType(); | |||
} | |||
@Override | |||
public String getName() { | |||
return name; | |||
} | |||
@Override | |||
public Class<?> getPropertyType() { | |||
return propertyType; | |||
} | |||
@Override | |||
public Property<?> createProperty(BT bean) { | |||
return new NestedMethodProperty<Object>(bean, name); | |||
} |
@@ -91,6 +91,7 @@ public class ObjectProperty<T> extends AbstractProperty<T> { | |||
* | |||
* @return type of the Property | |||
*/ | |||
@Override | |||
public final Class<T> getType() { | |||
return type; | |||
} | |||
@@ -100,6 +101,7 @@ public class ObjectProperty<T> extends AbstractProperty<T> { | |||
* | |||
* @return the value stored in the Property | |||
*/ | |||
@Override | |||
public T getValue() { | |||
return value; | |||
} | |||
@@ -115,6 +117,7 @@ public class ObjectProperty<T> extends AbstractProperty<T> { | |||
* @throws <code>Property.ReadOnlyException</code> if the object is in | |||
* read-only mode | |||
*/ | |||
@Override | |||
@SuppressWarnings("unchecked") | |||
public void setValue(Object newValue) throws Property.ReadOnlyException { | |||
@@ -75,6 +75,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
* @return the current data source as a Property, or <code>null</code> if | |||
* none defined. | |||
*/ | |||
@Override | |||
public Property<T> getPropertyDataSource() { | |||
return dataSource; | |||
} | |||
@@ -91,6 +92,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
* @param newDataSource | |||
* the new data source Property. | |||
*/ | |||
@Override | |||
public void setPropertyDataSource(Property newDataSource) { | |||
boolean readOnly = false; | |||
@@ -132,6 +134,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
} | |||
/* Documented in the interface */ | |||
@Override | |||
public Class<String> getType() { | |||
return String.class; | |||
} | |||
@@ -142,6 +145,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
* @return If the datasource returns null, this is null. Otherwise this is | |||
* String given by format(). | |||
*/ | |||
@Override | |||
public String getValue() { | |||
T value = dataSource == null ? null : dataSource.getValue(); | |||
if (value == null) { | |||
@@ -195,6 +199,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
} | |||
} | |||
@Override | |||
public void setValue(Object newValue) throws ReadOnlyException { | |||
if (dataSource == null) { | |||
return; | |||
@@ -221,6 +226,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
* | |||
* This should not be called directly. | |||
*/ | |||
@Override | |||
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { | |||
fireValueChange(); | |||
} | |||
@@ -230,6 +236,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
* | |||
* This should not be called directly. | |||
*/ | |||
@Override | |||
public void readOnlyStatusChange( | |||
com.vaadin.data.Property.ReadOnlyStatusChangeEvent event) { | |||
fireReadOnlyStatusChange(); |
@@ -57,6 +57,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* the identifier of the Property to get. | |||
* @return the Property with the given ID or <code>null</code> | |||
*/ | |||
@Override | |||
public Property<?> getItemProperty(Object id) { | |||
return map.get(id); | |||
} | |||
@@ -67,6 +68,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* @return unmodifiable collection containing IDs of the Properties stored | |||
* the Item | |||
*/ | |||
@Override | |||
public Collection<?> getItemPropertyIds() { | |||
return Collections.unmodifiableCollection(list); | |||
} | |||
@@ -83,6 +85,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* @return <code>true</code> if the operation succeeded <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean removeItemProperty(Object id) { | |||
// Cant remove missing properties | |||
@@ -107,6 +110,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* @return <code>true</code> if the operation succeeded, <code>false</code> | |||
* if not | |||
*/ | |||
@Override | |||
public boolean addItemProperty(Object id, Property property) { | |||
// Null ids are not accepted | |||
@@ -175,6 +179,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* | |||
* @return source object of the event as an <code>Item</code> | |||
*/ | |||
@Override | |||
public Item getItem() { | |||
return (Item) getSource(); | |||
} | |||
@@ -186,6 +191,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* @param listener | |||
* the new Listener to be registered. | |||
*/ | |||
@Override | |||
public void addListener(Item.PropertySetChangeListener listener) { | |||
if (propertySetChangeListeners == null) { | |||
propertySetChangeListeners = new LinkedList<PropertySetChangeListener>(); | |||
@@ -199,6 +205,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, | |||
* @param listener | |||
* the Listener to be removed. | |||
*/ | |||
@Override | |||
public void removeListener(Item.PropertySetChangeListener listener) { | |||
if (propertySetChangeListeners != null) { | |||
propertySetChangeListeners.remove(listener); |
@@ -188,6 +188,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @return Item Id. | |||
*/ | |||
@Override | |||
public Item getItem(Object id) { | |||
return new Row(id); | |||
} | |||
@@ -198,6 +199,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @return Collection of Property ID. | |||
*/ | |||
@Override | |||
public Collection<String> getContainerPropertyIds() { | |||
return propertyIds; | |||
} | |||
@@ -207,6 +209,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* | |||
* @return collection of Item IDs | |||
*/ | |||
@Override | |||
public Collection<?> getItemIds() { | |||
final Collection<Integer> c = new ArrayList<Integer>(size); | |||
for (int i = 1; i <= size; i++) { | |||
@@ -229,6 +232,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* otherwise. | |||
*/ | |||
@Override | |||
public synchronized Property<?> getContainerProperty(Object itemId, | |||
Object propertyId) { | |||
if (!(itemId instanceof Integer && propertyId instanceof String)) { | |||
@@ -256,6 +260,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @return data type of the Properties | |||
*/ | |||
@Override | |||
public Class<?> getType(Object id) { | |||
return propertyTypes.get(id); | |||
} | |||
@@ -265,6 +270,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* | |||
* @return the number of items in the container. | |||
*/ | |||
@Override | |||
public int size() { | |||
return size; | |||
} | |||
@@ -277,6 +283,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @return <code>true</code> if given id is in the container; | |||
* <code>false</code> otherwise. | |||
*/ | |||
@Override | |||
public boolean containsId(Object id) { | |||
if (!(id instanceof Integer)) { | |||
return false; | |||
@@ -302,6 +309,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItem method is not supported. | |||
*/ | |||
@Override | |||
public Item addItem(Object itemId) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -313,6 +321,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItem method is not supported. | |||
*/ | |||
@Override | |||
public Object addItem() throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -327,6 +336,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeItem method is not supported. | |||
*/ | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -346,6 +356,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addContainerProperty method is not supported. | |||
*/ | |||
@Override | |||
public boolean addContainerProperty(Object propertyId, Class<?> type, | |||
Object defaultValue) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -361,6 +372,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeContainerProperty method is not supported. | |||
*/ | |||
@Override | |||
public boolean removeContainerProperty(Object propertyId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -374,6 +386,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeAllItems method is not supported. | |||
*/ | |||
@Override | |||
public boolean removeAllItems() throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -389,6 +402,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItemAfter method is not supported. | |||
*/ | |||
@Override | |||
public Item addItemAfter(Object previousItemId, Object newItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -404,6 +418,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItemAfter method is not supported. | |||
*/ | |||
@Override | |||
public Object addItemAfter(Object previousItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -414,6 +429,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* | |||
* @return ID of the first Item in the list. | |||
*/ | |||
@Override | |||
public Object firstItemId() { | |||
if (size < 1) { | |||
return null; | |||
@@ -427,6 +443,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @param id | |||
* ID of an Item in the Container. | |||
*/ | |||
@Override | |||
public boolean isFirstId(Object id) { | |||
return size > 0 && (id instanceof Integer) | |||
&& ((Integer) id).intValue() == 1; | |||
@@ -439,6 +456,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* ID of an Item in the Container | |||
* | |||
*/ | |||
@Override | |||
public boolean isLastId(Object id) { | |||
return size > 0 && (id instanceof Integer) | |||
&& ((Integer) id).intValue() == size; | |||
@@ -449,6 +467,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* | |||
* @return ID of the last Item. | |||
*/ | |||
@Override | |||
public Object lastItemId() { | |||
if (size < 1) { | |||
return null; | |||
@@ -463,6 +482,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* ID of an Item in the Container. | |||
* @return ID of the next Item or null. | |||
*/ | |||
@Override | |||
public Object nextItemId(Object id) { | |||
if (size < 1 || !(id instanceof Integer)) { | |||
return null; | |||
@@ -481,6 +501,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* ID of an Item in the Container. | |||
* @return ID of the previous Item or null. | |||
*/ | |||
@Override | |||
public Object prevItemId(Object id) { | |||
if (size < 1 || !(id instanceof Integer)) { | |||
return null; | |||
@@ -519,6 +540,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItemProperty method is not supported. | |||
*/ | |||
@Override | |||
public boolean addItemProperty(Object id, Property property) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -532,6 +554,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* identifier of the Property to get | |||
* @return the Property with the given ID or <code>null</code> | |||
*/ | |||
@Override | |||
public Property<?> getItemProperty(Object propertyId) { | |||
return getContainerProperty(id, propertyId); | |||
} | |||
@@ -542,6 +565,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @return unmodifiable collection containing IDs of the Properties | |||
* stored the Item. | |||
*/ | |||
@Override | |||
public Collection<String> getItemPropertyIds() { | |||
return propertyIds; | |||
} | |||
@@ -556,6 +580,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the removeItemProperty is not supported. | |||
*/ | |||
@Override | |||
public boolean removeItemProperty(Object id) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -588,6 +613,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* @throws UnsupportedOperationException | |||
* if the addItemAt is not supported. | |||
*/ | |||
@Override | |||
public Item addItemAt(int index, Object newItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -605,6 +631,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* if the addItemAt is not supported. | |||
*/ | |||
@Override | |||
public Object addItemAt(int index) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -616,6 +643,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* Index Id. | |||
* @return ID in the given index. | |||
*/ | |||
@Override | |||
public Object getIdByIndex(int index) { | |||
if (size < 1 || index < 0 || index >= size) { | |||
return null; | |||
@@ -632,6 +660,7 @@ public class QueryContainer implements Container, Container.Ordered, | |||
* Item | |||
*/ | |||
@Override | |||
public int indexOfId(Object id) { | |||
if (size < 1 || !(id instanceof Integer)) { | |||
return -1; |
@@ -64,6 +64,7 @@ public class TextFileProperty extends AbstractProperty<String> { | |||
* | |||
* @see com.vaadin.data.Property#getType() | |||
*/ | |||
@Override | |||
public Class<String> getType() { | |||
return String.class; | |||
} | |||
@@ -73,6 +74,7 @@ public class TextFileProperty extends AbstractProperty<String> { | |||
* | |||
* @see com.vaadin.data.Property#getValue() | |||
*/ | |||
@Override | |||
public String getValue() { | |||
if (file == null) { | |||
return null; | |||
@@ -114,6 +116,7 @@ public class TextFileProperty extends AbstractProperty<String> { | |||
* | |||
* @see com.vaadin.data.Property#setValue(java.lang.Object) | |||
*/ | |||
@Override | |||
public void setValue(Object newValue) throws ReadOnlyException { | |||
if (isReadOnly()) { | |||
throw new ReadOnlyException(); |
@@ -44,6 +44,7 @@ public class TransactionalPropertyWrapper<T> extends AbstractProperty<T> | |||
((ValueChangeNotifier) wrappedProperty) | |||
.addListener(new ValueChangeListener() { | |||
@Override | |||
public void valueChange(ValueChangeEvent event) { | |||
fireValueChange(); | |||
} | |||
@@ -51,29 +52,35 @@ public class TransactionalPropertyWrapper<T> extends AbstractProperty<T> | |||
} | |||
} | |||
@Override | |||
public Class getType() { | |||
return wrappedProperty.getType(); | |||
} | |||
@Override | |||
public T getValue() { | |||
return wrappedProperty.getValue(); | |||
} | |||
@Override | |||
public void setValue(Object newValue) throws ReadOnlyException { | |||
// Causes a value change to be sent to this listener which in turn fires | |||
// a new value change event for this property | |||
wrappedProperty.setValue(newValue); | |||
} | |||
@Override | |||
public void startTransaction() { | |||
inTransaction = true; | |||
valueBeforeTransaction = getValue(); | |||
} | |||
@Override | |||
public void commit() { | |||
endTransaction(); | |||
} | |||
@Override | |||
public void rollback() { | |||
try { | |||
wrappedProperty.setValue(valueBeforeTransaction); |
@@ -24,6 +24,7 @@ public class DateToLongConverter implements Converter<Date, Long> { | |||
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, | |||
* java.util.Locale) | |||
*/ | |||
@Override | |||
public Long convertToModel(Date value, Locale locale) { | |||
if (value == null) { | |||
return null; | |||
@@ -39,6 +40,7 @@ public class DateToLongConverter implements Converter<Date, Long> { | |||
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang | |||
* .Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public Date convertToPresentation(Long value, Locale locale) { | |||
if (value == null) { | |||
return null; | |||
@@ -52,6 +54,7 @@ public class DateToLongConverter implements Converter<Date, Long> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getModelType() | |||
*/ | |||
@Override | |||
public Class<Long> getModelType() { | |||
return Long.class; | |||
} | |||
@@ -61,6 +64,7 @@ public class DateToLongConverter implements Converter<Date, Long> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getPresentationType() | |||
*/ | |||
@Override | |||
public Class<Date> getPresentationType() { | |||
return Date.class; | |||
} |
@@ -27,6 +27,7 @@ public class DefaultConverterFactory implements ConverterFactory { | |||
private final static Logger log = Logger | |||
.getLogger(DefaultConverterFactory.class.getName()); | |||
@Override | |||
public <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> createConverter( | |||
Class<PRESENTATION> presentationType, Class<MODEL> modelType) { | |||
Converter<PRESENTATION, MODEL> converter = findConverter( |
@@ -42,6 +42,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements | |||
* @see com.vaadin.data.util.converter.Converter#convertToModel(java | |||
* .lang.Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public MODEL convertToModel(PRESENTATION value, Locale locale) | |||
throws com.vaadin.data.util.converter.Converter.ConversionException { | |||
return realConverter.convertToPresentation(value, locale); | |||
@@ -54,6 +55,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements | |||
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang | |||
* .Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public PRESENTATION convertToPresentation(MODEL value, Locale locale) | |||
throws com.vaadin.data.util.converter.Converter.ConversionException { | |||
return realConverter.convertToModel(value, locale); | |||
@@ -64,6 +66,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getSourceType() | |||
*/ | |||
@Override | |||
public Class<MODEL> getModelType() { | |||
return realConverter.getPresentationType(); | |||
} | |||
@@ -73,6 +76,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getTargetType() | |||
*/ | |||
@Override | |||
public Class<PRESENTATION> getPresentationType() { | |||
return realConverter.getModelType(); | |||
} |
@@ -27,6 +27,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { | |||
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, | |||
* java.util.Locale) | |||
*/ | |||
@Override | |||
public Boolean convertToModel(String value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -71,6 +72,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { | |||
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang | |||
* .Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public String convertToPresentation(Boolean value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -88,6 +90,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getModelType() | |||
*/ | |||
@Override | |||
public Class<Boolean> getModelType() { | |||
return Boolean.class; | |||
} | |||
@@ -97,6 +100,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getPresentationType() | |||
*/ | |||
@Override | |||
public Class<String> getPresentationType() { | |||
return String.class; | |||
} |
@@ -52,6 +52,7 @@ public class StringToDateConverter implements Converter<String, Date> { | |||
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, | |||
* java.util.Locale) | |||
*/ | |||
@Override | |||
public Date convertToModel(String value, Locale locale) | |||
throws com.vaadin.data.util.converter.Converter.ConversionException { | |||
if (value == null) { | |||
@@ -78,6 +79,7 @@ public class StringToDateConverter implements Converter<String, Date> { | |||
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang | |||
* .Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public String convertToPresentation(Date value, Locale locale) | |||
throws com.vaadin.data.util.converter.Converter.ConversionException { | |||
if (value == null) { | |||
@@ -92,6 +94,7 @@ public class StringToDateConverter implements Converter<String, Date> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getModelType() | |||
*/ | |||
@Override | |||
public Class<Date> getModelType() { | |||
return Date.class; | |||
} | |||
@@ -101,6 +104,7 @@ public class StringToDateConverter implements Converter<String, Date> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getPresentationType() | |||
*/ | |||
@Override | |||
public Class<String> getPresentationType() { | |||
return String.class; | |||
} |
@@ -49,6 +49,7 @@ public class StringToDoubleConverter implements Converter<String, Double> { | |||
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, | |||
* java.util.Locale) | |||
*/ | |||
@Override | |||
public Double convertToModel(String value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -74,6 +75,7 @@ public class StringToDoubleConverter implements Converter<String, Double> { | |||
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang | |||
* .Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public String convertToPresentation(Double value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -88,6 +90,7 @@ public class StringToDoubleConverter implements Converter<String, Double> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getModelType() | |||
*/ | |||
@Override | |||
public Class<Double> getModelType() { | |||
return Double.class; | |||
} | |||
@@ -97,6 +100,7 @@ public class StringToDoubleConverter implements Converter<String, Double> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getPresentationType() | |||
*/ | |||
@Override | |||
public Class<String> getPresentationType() { | |||
return String.class; | |||
} |
@@ -39,6 +39,7 @@ public class StringToIntegerConverter implements Converter<String, Integer> { | |||
return NumberFormat.getIntegerInstance(locale); | |||
} | |||
@Override | |||
public Integer convertToModel(String value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -64,6 +65,7 @@ public class StringToIntegerConverter implements Converter<String, Integer> { | |||
return parsedValue.intValue(); | |||
} | |||
@Override | |||
public String convertToPresentation(Integer value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -73,10 +75,12 @@ public class StringToIntegerConverter implements Converter<String, Integer> { | |||
return getFormat(locale).format(value); | |||
} | |||
@Override | |||
public Class<Integer> getModelType() { | |||
return Integer.class; | |||
} | |||
@Override | |||
public Class<String> getPresentationType() { | |||
return String.class; | |||
} |
@@ -45,6 +45,7 @@ public class StringToNumberConverter implements Converter<String, Number> { | |||
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, | |||
* java.util.Locale) | |||
*/ | |||
@Override | |||
public Number convertToModel(String value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -77,6 +78,7 @@ public class StringToNumberConverter implements Converter<String, Number> { | |||
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang | |||
* .Object, java.util.Locale) | |||
*/ | |||
@Override | |||
public String convertToPresentation(Number value, Locale locale) | |||
throws ConversionException { | |||
if (value == null) { | |||
@@ -91,6 +93,7 @@ public class StringToNumberConverter implements Converter<String, Number> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getModelType() | |||
*/ | |||
@Override | |||
public Class<Number> getModelType() { | |||
return Number.class; | |||
} | |||
@@ -100,6 +103,7 @@ public class StringToNumberConverter implements Converter<String, Number> { | |||
* | |||
* @see com.vaadin.data.util.converter.Converter#getPresentationType() | |||
*/ | |||
@Override | |||
public Class<String> getPresentationType() { | |||
return String.class; | |||
} |
@@ -45,6 +45,7 @@ public abstract class AbstractJunctionFilter implements Filter { | |||
* If there are no sub-filters, false is returned - override in subclasses | |||
* to change this behavior. | |||
*/ | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
for (Filter filter : getFilters()) { | |||
if (filter.appliesToProperty(propertyId)) { |
@@ -30,6 +30,7 @@ public final class And extends AbstractJunctionFilter { | |||
super(filters); | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) | |||
throws UnsupportedFilterException { | |||
for (Filter filter : getFilters()) { |
@@ -30,6 +30,7 @@ public class Between implements Filter { | |||
return endValue; | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) | |||
throws UnsupportedOperationException { | |||
Object value = item.getItemProperty(getPropertyId()).getValue(); | |||
@@ -41,6 +42,7 @@ public class Between implements Filter { | |||
return false; | |||
} | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
return getPropertyId() != null && getPropertyId().equals(propertyId); | |||
} |
@@ -227,6 +227,7 @@ public abstract class Compare implements Filter { | |||
this.operation = operation; | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) { | |||
final Property<?> p = item.getItemProperty(getPropertyId()); | |||
if (null == p) { | |||
@@ -264,6 +265,7 @@ public abstract class Compare implements Filter { | |||
+ value1 + ", " + getValue()); | |||
} | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
return getPropertyId().equals(propertyId); | |||
} |
@@ -33,6 +33,7 @@ public final class IsNull implements Filter { | |||
this.propertyId = propertyId; | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) | |||
throws UnsupportedOperationException { | |||
final Property<?> p = item.getItemProperty(getPropertyId()); | |||
@@ -42,6 +43,7 @@ public final class IsNull implements Filter { | |||
return null == p.getValue(); | |||
} | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
return getPropertyId().equals(propertyId); | |||
} |
@@ -37,6 +37,7 @@ public class Like implements Filter { | |||
return caseSensitive; | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) | |||
throws UnsupportedOperationException { | |||
if (!item.getItemProperty(getPropertyId()).getType() | |||
@@ -54,6 +55,7 @@ public class Like implements Filter { | |||
return colValue.toUpperCase().matches(pattern.toUpperCase()); | |||
} | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
return getPropertyId() != null && getPropertyId().equals(propertyId); | |||
} |
@@ -36,6 +36,7 @@ public final class Not implements Filter { | |||
return filter; | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) | |||
throws UnsupportedOperationException { | |||
return !filter.passesFilter(itemId, item); | |||
@@ -48,6 +49,7 @@ public final class Not implements Filter { | |||
* | |||
* @return boolean | |||
*/ | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
return filter.appliesToProperty(propertyId); | |||
} |
@@ -30,6 +30,7 @@ public final class Or extends AbstractJunctionFilter { | |||
super(filters); | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) | |||
throws UnsupportedFilterException { | |||
for (Filter filter : getFilters()) { |
@@ -39,6 +39,7 @@ public final class SimpleStringFilter implements Filter { | |||
this.onlyMatchPrefix = onlyMatchPrefix; | |||
} | |||
@Override | |||
public boolean passesFilter(Object itemId, Item item) { | |||
final Property<?> p = item.getItemProperty(propertyId); | |||
if (p == null) { | |||
@@ -62,6 +63,7 @@ public final class SimpleStringFilter implements Filter { | |||
return true; | |||
} | |||
@Override | |||
public boolean appliesToProperty(Object propertyId) { | |||
return this.propertyId.equals(propertyId); | |||
} |
@@ -61,6 +61,7 @@ final public class ColumnProperty implements Property { | |||
this.readOnly = readOnly; | |||
} | |||
@Override | |||
public Object getValue() { | |||
if (isModified()) { | |||
return changedValue; | |||
@@ -68,6 +69,7 @@ final public class ColumnProperty implements Property { | |||
return value; | |||
} | |||
@Override | |||
public void setValue(Object newValue) throws ReadOnlyException { | |||
if (newValue == null && !nullable) { | |||
throw new NotNullableException( | |||
@@ -134,10 +136,12 @@ final public class ColumnProperty implements Property { | |||
|| newValue.equals(referenceValue); | |||
} | |||
@Override | |||
public Class<?> getType() { | |||
return type; | |||
} | |||
@Override | |||
public boolean isReadOnly() { | |||
return readOnly; | |||
} | |||
@@ -146,6 +150,7 @@ final public class ColumnProperty implements Property { | |||
return allowReadOnlyChange; | |||
} | |||
@Override | |||
public void setReadOnly(boolean newStatus) { | |||
if (allowReadOnlyChange) { | |||
readOnly = newStatus; |
@@ -48,6 +48,7 @@ public final class RowItem implements Item { | |||
this.id = id; | |||
} | |||
@Override | |||
public Property<?> getItemProperty(Object id) { | |||
if (id instanceof String && id != null) { | |||
for (ColumnProperty cp : properties) { | |||
@@ -59,6 +60,7 @@ public final class RowItem implements Item { | |||
return null; | |||
} | |||
@Override | |||
public Collection<?> getItemPropertyIds() { | |||
Collection<String> ids = new ArrayList<String>(properties.size()); | |||
for (ColumnProperty cp : properties) { | |||
@@ -71,6 +73,7 @@ public final class RowItem implements Item { | |||
* Adding properties is not supported. Properties are generated by | |||
* SQLContainer. | |||
*/ | |||
@Override | |||
public boolean addItemProperty(Object id, Property property) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -80,6 +83,7 @@ public final class RowItem implements Item { | |||
* Removing properties is not supported. Properties are generated by | |||
* SQLContainer. | |||
*/ | |||
@Override | |||
public boolean removeItemProperty(Object id) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); |
@@ -130,6 +130,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public Object addItem() throws UnsupportedOperationException { | |||
Object emptyKey[] = new Object[delegate.getPrimaryKeyColumns().size()]; | |||
RowId itemId = new TemporaryRowId(emptyKey); | |||
@@ -186,6 +187,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#containsId(java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean containsId(Object itemId) { | |||
if (itemId == null) { | |||
return false; | |||
@@ -227,6 +229,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* java.lang.Object) | |||
*/ | |||
@Override | |||
public Property<?> getContainerProperty(Object itemId, Object propertyId) { | |||
Item item = getItem(itemId); | |||
if (item == null) { | |||
@@ -241,6 +244,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#getContainerPropertyIds() | |||
*/ | |||
@Override | |||
public Collection<?> getContainerPropertyIds() { | |||
return Collections.unmodifiableCollection(propertyIds); | |||
} | |||
@@ -251,6 +255,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#getItem(java.lang.Object) | |||
*/ | |||
@Override | |||
public Item getItem(Object itemId) { | |||
if (!cachedItems.containsKey(itemId)) { | |||
int index = indexOfId(itemId); | |||
@@ -298,6 +303,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public Collection<?> getItemIds() { | |||
updateCount(); | |||
ArrayList<RowId> ids = new ArrayList<RowId>(); | |||
@@ -355,6 +361,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#getType(java.lang.Object) | |||
*/ | |||
@Override | |||
public Class<?> getType(Object propertyId) { | |||
if (!propertyIds.contains(propertyId)) { | |||
return null; | |||
@@ -368,6 +375,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#size() | |||
*/ | |||
@Override | |||
public int size() { | |||
updateCount(); | |||
return size + sizeOfAddedItems() - removedItems.size(); | |||
@@ -379,6 +387,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#removeItem(java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean removeItem(Object itemId) | |||
throws UnsupportedOperationException { | |||
if (!containsId(itemId)) { | |||
@@ -447,6 +456,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#removeAllItems() | |||
*/ | |||
@Override | |||
public boolean removeAllItems() throws UnsupportedOperationException { | |||
if (autoCommit) { | |||
/* Remove and commit instantly. */ | |||
@@ -508,6 +518,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public void addContainerFilter(Filter filter) | |||
throws UnsupportedFilterException { | |||
// filter.setCaseSensitive(!ignoreCase); | |||
@@ -520,6 +531,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public void removeContainerFilter(Filter filter) { | |||
filters.remove(filter); | |||
} | |||
@@ -560,6 +572,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public void removeAllContainerFilters() { | |||
filters.clear(); | |||
refresh(); | |||
@@ -575,6 +588,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Indexed#indexOfId(java.lang.Object) | |||
*/ | |||
@Override | |||
public int indexOfId(Object itemId) { | |||
// First check if the id is in the added items | |||
for (int ix = 0; ix < addedItems.size(); ix++) { | |||
@@ -622,6 +636,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Indexed#getIdByIndex(int) | |||
*/ | |||
@Override | |||
public Object getIdByIndex(int index) { | |||
if (index < 0 || index > size() - 1) { | |||
return null; | |||
@@ -649,6 +664,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object) | |||
*/ | |||
@Override | |||
public Object nextItemId(Object itemId) { | |||
return getIdByIndex(indexOfId(itemId) + 1); | |||
} | |||
@@ -659,6 +675,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object) | |||
*/ | |||
@Override | |||
public Object prevItemId(Object itemId) { | |||
return getIdByIndex(indexOfId(itemId) - 1); | |||
} | |||
@@ -669,6 +686,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#firstItemId() | |||
*/ | |||
@Override | |||
public Object firstItemId() { | |||
updateCount(); | |||
if (size == 0) { | |||
@@ -697,6 +715,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#lastItemId() | |||
*/ | |||
@Override | |||
public Object lastItemId() { | |||
if (addedItems.isEmpty()) { | |||
int lastIx = size() - 1; | |||
@@ -723,6 +742,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean isFirstId(Object itemId) { | |||
return firstItemId().equals(itemId); | |||
} | |||
@@ -733,6 +753,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean isLastId(Object itemId) { | |||
return lastItemId().equals(itemId); | |||
} | |||
@@ -748,6 +769,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* boolean[]) | |||
*/ | |||
@Override | |||
public void sort(Object[] propertyId, boolean[] ascending) { | |||
sorters.clear(); | |||
if (propertyId == null || propertyId.length == 0) { | |||
@@ -777,6 +799,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() | |||
*/ | |||
@Override | |||
public Collection<?> getSortableContainerPropertyIds() { | |||
return getContainerPropertyIds(); | |||
} | |||
@@ -1351,6 +1374,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* java.lang.Class, java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean addContainerProperty(Object propertyId, Class<?> type, | |||
Object defaultValue) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -1362,6 +1386,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object) | |||
*/ | |||
@Override | |||
public boolean removeContainerProperty(Object propertyId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -1373,6 +1398,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container#addItem(java.lang.Object) | |||
*/ | |||
@Override | |||
public Item addItem(Object itemId) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -1384,6 +1410,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* java.lang.Object) | |||
*/ | |||
@Override | |||
public Item addItemAfter(Object previousItemId, Object newItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -1395,6 +1422,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Indexed#addItemAt(int, java.lang.Object) | |||
*/ | |||
@Override | |||
public Item addItemAt(int index, Object newItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -1406,6 +1434,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Indexed#addItemAt(int) | |||
*/ | |||
@Override | |||
public Object addItemAt(int index) throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -1416,6 +1445,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) | |||
*/ | |||
@Override | |||
public Object addItemAfter(Object previousItemId) | |||
throws UnsupportedOperationException { | |||
throw new UnsupportedOperationException(); | |||
@@ -1433,6 +1463,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* .data.Container.ItemSetChangeListener) | |||
*/ | |||
@Override | |||
public void addListener(Container.ItemSetChangeListener listener) { | |||
if (itemSetChangeListeners == null) { | |||
itemSetChangeListeners = new LinkedList<Container.ItemSetChangeListener>(); | |||
@@ -1448,6 +1479,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
* .data.Container.ItemSetChangeListener) | |||
*/ | |||
@Override | |||
public void removeListener(Container.ItemSetChangeListener listener) { | |||
if (itemSetChangeListeners != null) { | |||
itemSetChangeListeners.remove(listener); | |||
@@ -1477,6 +1509,7 @@ public class SQLContainer implements Container, Container.Filterable, | |||
super(source); | |||
} | |||
@Override | |||
public Container getContainer() { | |||
return (Container) getSource(); | |||
} |
@@ -26,6 +26,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool { | |||
this.dataSourceJndiName = dataSourceJndiName; | |||
} | |||
@Override | |||
public Connection reserveConnection() throws SQLException { | |||
Connection conn = getDataSource().getConnection(); | |||
conn.setAutoCommit(false); | |||
@@ -51,6 +52,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool { | |||
} | |||
} | |||
@Override | |||
public void releaseConnection(Connection conn) { | |||
if (conn != null) { | |||
try { | |||
@@ -62,6 +64,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool { | |||
} | |||
} | |||
@Override | |||
public void destroy() { | |||
dataSource = null; | |||
} |
@@ -81,6 +81,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { | |||
initialized = true; | |||
} | |||
@Override | |||
public synchronized Connection reserveConnection() throws SQLException { | |||
if (!initialized) { | |||
initializeConnections(); | |||
@@ -100,6 +101,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { | |||
return c; | |||
} | |||
@Override | |||
public synchronized void releaseConnection(Connection conn) { | |||
if (conn == null || !initialized) { | |||
return; | |||
@@ -139,6 +141,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { | |||
return c; | |||
} | |||
@Override | |||
public void destroy() { | |||
for (Connection c : availableConnections) { | |||
try { |
@@ -99,6 +99,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public int getCount() throws SQLException { | |||
// First try the delegate | |||
int count = countByDelegate(); | |||
@@ -187,6 +188,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* | |||
* @see FreeformQueryDelegate#getQueryString(int, int) | |||
*/ | |||
@Override | |||
@SuppressWarnings("deprecation") | |||
public ResultSet getResults(int offset, int pagelength) throws SQLException { | |||
if (activeConnection == null) { | |||
@@ -218,6 +220,7 @@ public class FreeformQuery implements QueryDelegate { | |||
return rs; | |||
} | |||
@Override | |||
@SuppressWarnings("deprecation") | |||
public boolean implementationRespectsPagingLimits() { | |||
if (delegate == null) { | |||
@@ -251,6 +254,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setFilters(java | |||
* .util.List) | |||
*/ | |||
@Override | |||
public void setFilters(List<Filter> filters) | |||
throws UnsupportedOperationException { | |||
if (delegate != null) { | |||
@@ -268,6 +272,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setOrderBy(java | |||
* .util.List) | |||
*/ | |||
@Override | |||
public void setOrderBy(List<OrderBy> orderBys) | |||
throws UnsupportedOperationException { | |||
if (delegate != null) { | |||
@@ -285,6 +290,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin | |||
* .data.util.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public int storeRow(RowItem row) throws SQLException { | |||
if (activeConnection == null) { | |||
throw new IllegalStateException("No transaction is active!"); | |||
@@ -307,6 +313,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin | |||
* .data.util.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public boolean removeRow(RowItem row) throws SQLException { | |||
if (activeConnection == null) { | |||
throw new IllegalStateException("No transaction is active!"); | |||
@@ -328,6 +335,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* @see | |||
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#beginTransaction() | |||
*/ | |||
@Override | |||
public synchronized void beginTransaction() | |||
throws UnsupportedOperationException, SQLException { | |||
if (activeConnection != null) { | |||
@@ -342,6 +350,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* | |||
* @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#commit() | |||
*/ | |||
@Override | |||
public synchronized void commit() throws UnsupportedOperationException, | |||
SQLException { | |||
if (activeConnection == null) { | |||
@@ -359,6 +368,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* | |||
* @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#rollback() | |||
*/ | |||
@Override | |||
public synchronized void rollback() throws UnsupportedOperationException, | |||
SQLException { | |||
if (activeConnection == null) { | |||
@@ -376,6 +386,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns | |||
* () | |||
*/ | |||
@Override | |||
public List<String> getPrimaryKeyColumns() { | |||
return primaryKeyColumns; | |||
} | |||
@@ -403,6 +414,7 @@ public class FreeformQuery implements QueryDelegate { | |||
* @see FreeformQueryDelegate#getContainsRowQueryString(Object...) | |||
* | |||
*/ | |||
@Override | |||
@SuppressWarnings("deprecation") | |||
public boolean containsRowWithKey(Object... keys) throws SQLException { | |||
String query = null; |
@@ -111,6 +111,7 @@ public class TableQuery implements QueryDelegate, | |||
* | |||
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getCount() | |||
*/ | |||
@Override | |||
public int getCount() throws SQLException { | |||
getLogger().log(Level.FINE, "Fetching count..."); | |||
StatementHelper sh = sqlGenerator.generateSelectQuery(tableName, | |||
@@ -137,6 +138,7 @@ public class TableQuery implements QueryDelegate, | |||
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getResults(int, | |||
* int) | |||
*/ | |||
@Override | |||
public ResultSet getResults(int offset, int pagelength) throws SQLException { | |||
StatementHelper sh; | |||
/* | |||
@@ -161,6 +163,7 @@ public class TableQuery implements QueryDelegate, | |||
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate# | |||
* implementationRespectsPagingLimits() | |||
*/ | |||
@Override | |||
public boolean implementationRespectsPagingLimits() { | |||
return true; | |||
} | |||
@@ -172,6 +175,7 @@ public class TableQuery implements QueryDelegate, | |||
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin | |||
* .addon.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public int storeRow(RowItem row) throws UnsupportedOperationException, | |||
SQLException { | |||
if (row == null) { | |||
@@ -254,6 +258,7 @@ public class TableQuery implements QueryDelegate, | |||
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#setFilters(java.util | |||
* .List) | |||
*/ | |||
@Override | |||
public void setFilters(List<Filter> filters) | |||
throws UnsupportedOperationException { | |||
if (filters == null) { | |||
@@ -270,6 +275,7 @@ public class TableQuery implements QueryDelegate, | |||
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#setOrderBy(java.util | |||
* .List) | |||
*/ | |||
@Override | |||
public void setOrderBy(List<OrderBy> orderBys) | |||
throws UnsupportedOperationException { | |||
if (orderBys == null) { | |||
@@ -284,6 +290,7 @@ public class TableQuery implements QueryDelegate, | |||
* | |||
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#beginTransaction() | |||
*/ | |||
@Override | |||
public void beginTransaction() throws UnsupportedOperationException, | |||
SQLException { | |||
if (transactionOpen && activeConnection != null) { | |||
@@ -301,6 +308,7 @@ public class TableQuery implements QueryDelegate, | |||
* | |||
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#commit() | |||
*/ | |||
@Override | |||
public void commit() throws UnsupportedOperationException, SQLException { | |||
if (transactionOpen && activeConnection != null) { | |||
getLogger().log(Level.FINE, "DB -> commit"); | |||
@@ -329,6 +337,7 @@ public class TableQuery implements QueryDelegate, | |||
* | |||
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#rollback() | |||
*/ | |||
@Override | |||
public void rollback() throws UnsupportedOperationException, SQLException { | |||
if (transactionOpen && activeConnection != null) { | |||
getLogger().log(Level.FINE, "DB -> rollback"); | |||
@@ -346,6 +355,7 @@ public class TableQuery implements QueryDelegate, | |||
* @see | |||
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns() | |||
*/ | |||
@Override | |||
public List<String> getPrimaryKeyColumns() { | |||
return Collections.unmodifiableList(primaryKeyColumns); | |||
} | |||
@@ -581,6 +591,7 @@ public class TableQuery implements QueryDelegate, | |||
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin | |||
* .addon.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public boolean removeRow(RowItem row) throws UnsupportedOperationException, | |||
SQLException { | |||
getLogger().log(Level.FINE, | |||
@@ -604,6 +615,7 @@ public class TableQuery implements QueryDelegate, | |||
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#containsRowWithKey( | |||
* java.lang.Object[]) | |||
*/ | |||
@Override | |||
public boolean containsRowWithKey(Object... keys) throws SQLException { | |||
ArrayList<Filter> filtersAndKeys = new ArrayList<Filter>(); | |||
if (filters != null) { | |||
@@ -665,10 +677,12 @@ public class TableQuery implements QueryDelegate, | |||
this.newId = newId; | |||
} | |||
@Override | |||
public RowId getNewRowId() { | |||
return newId; | |||
} | |||
@Override | |||
public RowId getOldRowId() { | |||
return oldId; | |||
} | |||
@@ -677,6 +691,7 @@ public class TableQuery implements QueryDelegate, | |||
/** | |||
* Adds RowIdChangeListener to this query | |||
*/ | |||
@Override | |||
public void addListener(RowIdChangeListener listener) { | |||
if (rowIdChangeListeners == null) { | |||
rowIdChangeListeners = new LinkedList<QueryDelegate.RowIdChangeListener>(); | |||
@@ -687,6 +702,7 @@ public class TableQuery implements QueryDelegate, | |||
/** | |||
* Removes the given RowIdChangeListener from this query | |||
*/ | |||
@Override | |||
public void removeListener(RowIdChangeListener listener) { | |||
if (rowIdChangeListeners != null) { | |||
rowIdChangeListeners.remove(listener); |
@@ -51,6 +51,7 @@ public class DefaultSQLGenerator implements SQLGenerator { | |||
* generateSelectQuery(java.lang.String, java.util.List, java.util.List, | |||
* int, int, java.lang.String) | |||
*/ | |||
@Override | |||
public StatementHelper generateSelectQuery(String tableName, | |||
List<Filter> filters, List<OrderBy> orderBys, int offset, | |||
int pagelength, String toSelect) { | |||
@@ -84,6 +85,7 @@ public class DefaultSQLGenerator implements SQLGenerator { | |||
* generateUpdateQuery(java.lang.String, | |||
* com.vaadin.addon.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public StatementHelper generateUpdateQuery(String tableName, RowItem item) { | |||
if (tableName == null || tableName.trim().equals("")) { | |||
throw new IllegalArgumentException("Table name must be given."); | |||
@@ -133,6 +135,7 @@ public class DefaultSQLGenerator implements SQLGenerator { | |||
* generateInsertQuery(java.lang.String, | |||
* com.vaadin.addon.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public StatementHelper generateInsertQuery(String tableName, RowItem item) { | |||
if (tableName == null || tableName.trim().equals("")) { | |||
throw new IllegalArgumentException("Table name must be given."); | |||
@@ -184,6 +187,7 @@ public class DefaultSQLGenerator implements SQLGenerator { | |||
* generateDeleteQuery(java.lang.String, | |||
* com.vaadin.addon.sqlcontainer.RowItem) | |||
*/ | |||
@Override | |||
public StatementHelper generateDeleteQuery(String tableName, | |||
List<String> primaryKeyColumns, String versionColumn, RowItem item) { | |||
if (tableName == null || tableName.trim().equals("")) { |
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class AndTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof And; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
return QueryBuilder.group(QueryBuilder.getJoinedFilterString( | |||
((And) filter).getFilters(), "AND", sh)); |
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class BetweenTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof Between; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
Between between = (Between) filter; | |||
sh.addParameterValue(between.getStartValue()); |
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class CompareTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof Compare; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
Compare compare = (Compare) filter; | |||
sh.addParameterValue(compare.getValue()); |
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class IsNullTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof IsNull; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
IsNull in = (IsNull) filter; | |||
return QueryBuilder.quote(in.getPropertyId()) + " IS NULL"; |
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class LikeTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof Like; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
Like like = (Like) filter; | |||
if (like.isCaseSensitive()) { |
@@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class NotTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof Not; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
Not not = (Not) filter; | |||
if (not.getFilter() instanceof IsNull) { |
@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class OrTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof Or; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
return QueryBuilder.group(QueryBuilder.getJoinedFilterString( | |||
((Or) filter).getFilters(), "OR", sh)); |
@@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; | |||
public class SimpleStringTranslator implements FilterTranslator { | |||
@Override | |||
public boolean translatesFilter(Filter filter) { | |||
return filter instanceof SimpleStringFilter; | |||
} | |||
@Override | |||
public String getWhereStringForFilter(Filter filter, StatementHelper sh) { | |||
SimpleStringFilter ssf = (SimpleStringFilter) filter; | |||
// Create a Like filter based on the SimpleStringFilter and execute the |
@@ -84,6 +84,7 @@ public abstract class AbstractValidator<T> implements Validator { | |||
*/ | |||
protected abstract boolean isValidValue(T value); | |||
@Override | |||
public void validate(Object value) throws InvalidValueException { | |||
// isValidType ensures that value can safely be cast to TYPE | |||
if (!isValidType(value) || !isValidValue((T) value)) { |
@@ -67,10 +67,12 @@ public class BeanValidator implements Validator { | |||
this.descriptor = descriptor; | |||
} | |||
@Override | |||
public ConstraintDescriptor<?> getConstraintDescriptor() { | |||
return descriptor; | |||
} | |||
@Override | |||
public Object getValidatedValue() { | |||
return value; | |||
} | |||
@@ -96,6 +98,7 @@ public class BeanValidator implements Validator { | |||
* | |||
* @see com.vaadin.data.Validator#validate(java.lang.Object) | |||
*/ | |||
@Override | |||
public void validate(final Object value) throws InvalidValueException { | |||
Set<?> violations = getJavaxBeanValidator().validateValue(beanClass, | |||
propertyName, value); |
@@ -101,6 +101,7 @@ public class CompositeValidator implements Validator { | |||
* @throws Validator.InvalidValueException | |||
* if the value is not valid. | |||
*/ | |||
@Override | |||
public void validate(Object value) throws Validator.InvalidValueException { | |||
switch (mode) { | |||
case AND: |
@@ -43,6 +43,7 @@ public class NullValidator implements Validator { | |||
* @throws Validator.InvalidValueException | |||
* if the value was invalid. | |||
*/ | |||
@Override | |||
public void validate(Object value) throws Validator.InvalidValueException { | |||
if ((onlyNullAllowed && value != null) | |||
|| (!onlyNullAllowed && value == null)) { |
@@ -75,6 +75,7 @@ public class ActionManager implements Action.Container, Action.Handler, | |||
requestRepaint(); // this goes to the new viewer | |||
} | |||
@Override | |||
public <T extends Action & Action.Listener> void addAction(T action) { | |||
if (ownActions == null) { | |||
ownActions = new HashSet<Action>(); | |||
@@ -84,6 +85,7 @@ public class ActionManager implements Action.Container, Action.Handler, | |||
} | |||
} | |||
@Override | |||
public <T extends Action & Action.Listener> void removeAction(T action) { | |||
if (ownActions != null) { | |||
if (ownActions.remove(action)) { | |||
@@ -92,6 +94,7 @@ public class ActionManager implements Action.Container, Action.Handler, | |||
} | |||
} | |||
@Override | |||
public void addActionHandler(Handler actionHandler) { | |||
if (actionHandler == this) { | |||
// don't add the actionHandler to itself | |||
@@ -109,6 +112,7 @@ public class ActionManager implements Action.Container, Action.Handler, | |||
} | |||
} | |||
@Override | |||
public void removeActionHandler(Action.Handler actionHandler) { | |||
if (actionHandlers != null && actionHandlers.contains(actionHandler)) { | |||
@@ -206,6 +210,7 @@ public class ActionManager implements Action.Container, Action.Handler, | |||
} | |||
} | |||
@Override | |||
public Action[] getActions(Object target, Object sender) { | |||
HashSet<Action> actions = new HashSet<Action>(); | |||
if (ownActions != null) { | |||
@@ -226,6 +231,7 @@ public class ActionManager implements Action.Container, Action.Handler, | |||
return actions.toArray(new Action[actions.size()]); | |||
} | |||
@Override | |||
public void handleAction(Action action, Object sender, Object target) { | |||
if (actionHandlers != null) { | |||
Handler[] array = actionHandlers.toArray(new Handler[actionHandlers |
@@ -35,6 +35,7 @@ public class EventRouter implements MethodEventSource { | |||
* events generated by this component. Don't add a JavaDoc comment here, we | |||
* use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public void addListener(Class<?> eventType, Object object, Method method) { | |||
if (listenerList == null) { | |||
listenerList = new LinkedHashSet<ListenerMethod>(); | |||
@@ -47,6 +48,7 @@ public class EventRouter implements MethodEventSource { | |||
* listen events generated by this component. Don't add a JavaDoc comment | |||
* here, we use the default documentation from implemented interface. | |||
*/ | |||
@Override | |||
public void addListener(Class<?> eventType, Object object, String methodName) { | |||
if (listenerList == null) { | |||
listenerList = new LinkedHashSet<ListenerMethod>(); | |||
@@ -59,6 +61,7 @@ public class EventRouter implements MethodEventSource { | |||
* a JavaDoc comment here, we use the default documentation from implemented | |||
* interface. | |||
*/ | |||
@Override | |||
public void removeListener(Class<?> eventType, Object target) { | |||
if (listenerList != null) { | |||
final Iterator<ListenerMethod> i = listenerList.iterator(); | |||
@@ -77,6 +80,7 @@ public class EventRouter implements MethodEventSource { | |||
* Don't add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public void removeListener(Class<?> eventType, Object target, Method method) { | |||
if (listenerList != null) { | |||
final Iterator<ListenerMethod> i = listenerList.iterator(); | |||
@@ -95,6 +99,7 @@ public class EventRouter implements MethodEventSource { | |||
* Don't add a JavaDoc comment here, we use the default documentation from | |||
* implemented interface. | |||
*/ | |||
@Override | |||
public void removeListener(Class<?> eventType, Object target, | |||
String methodName) { | |||
@@ -261,10 +261,12 @@ public interface FieldEvents { | |||
protected abstract void fireEvent(Event event); | |||
@Override | |||
public void blur() { | |||
fireEvent(new BlurEvent(component)); | |||
} | |||
@Override | |||
public void focus() { | |||
fireEvent(new FocusEvent(component)); | |||
} |
@@ -28,5 +28,6 @@ public abstract class ShortcutListener extends ShortcutAction implements | |||
super(shorthandCaption); | |||
} | |||
@Override | |||
abstract public void handleAction(Object sender, Object target); | |||
} |
@@ -24,18 +24,22 @@ public class TransferableImpl implements Transferable { | |||
this.rawVariables = rawVariables; | |||
} | |||
@Override | |||
public Component getSourceComponent() { | |||
return sourceComponent; | |||
} | |||
@Override | |||
public Object getData(String dataFlavor) { | |||
return rawVariables.get(dataFlavor); | |||
} | |||
@Override | |||
public void setData(String dataFlavor, Object value) { | |||
rawVariables.put(dataFlavor, value); | |||
} | |||
@Override | |||
public Collection<String> getDataFlavors() { | |||
return rawVariables.keySet(); | |||
} |
@@ -29,6 +29,7 @@ public class TargetDetailsImpl implements TargetDetails { | |||
this.dropTarget = dropTarget; | |||
} | |||
@Override | |||
public Object getData(String key) { | |||
return data.get(key); | |||
} | |||
@@ -37,6 +38,7 @@ public class TargetDetailsImpl implements TargetDetails { | |||
return data.put(key, value); | |||
} | |||
@Override | |||
public DropTarget getTarget() { | |||
return dropTarget; | |||
} |
@@ -29,6 +29,7 @@ public final class AcceptAll extends ClientSideCriterion { | |||
return singleton; | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
return true; | |||
} |
@@ -41,6 +41,7 @@ public class And extends ClientSideCriterion { | |||
} | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
for (ClientSideCriterion crit : criteria) { | |||
if (!crit.accept(dragEvent)) { |
@@ -33,10 +33,12 @@ public abstract class ClientSideCriterion implements Serializable, | |||
* com.vaadin.event.dd.acceptCriteria.AcceptCriterion#isClientSideVerifiable | |||
* () | |||
*/ | |||
@Override | |||
public final boolean isClientSideVerifiable() { | |||
return true; | |||
} | |||
@Override | |||
public void paint(PaintTarget target) throws PaintException { | |||
target.startTag("-ac"); | |||
target.addAttribute("name", getIdentifier()); | |||
@@ -51,6 +53,7 @@ public abstract class ClientSideCriterion implements Serializable, | |||
return getClass().getCanonicalName(); | |||
} | |||
@Override | |||
public final void paintResponse(PaintTarget target) throws PaintException { | |||
// NOP, nothing to do as this is client side verified criterion | |||
} |
@@ -39,6 +39,7 @@ public class ContainsDataFlavor extends ClientSideCriterion { | |||
target.addAttribute("p", dataFlavorId); | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
return dragEvent.getTransferable().getDataFlavors() | |||
.contains(dataFlavorId); |
@@ -31,6 +31,7 @@ public class Not extends ClientSideCriterion { | |||
acceptCriterion.paint(target); | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
return !acceptCriterion.accept(dragEvent); | |||
} |
@@ -39,6 +39,7 @@ public class Or extends ClientSideCriterion { | |||
} | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
for (AcceptCriterion crit : criteria) { | |||
if (crit.accept(dragEvent)) { |
@@ -31,10 +31,12 @@ public abstract class ServerSideCriterion implements Serializable, | |||
private static final long serialVersionUID = 2128510128911628902L; | |||
@Override | |||
public final boolean isClientSideVerifiable() { | |||
return false; | |||
} | |||
@Override | |||
public void paint(PaintTarget target) throws PaintException { | |||
target.startTag("-ac"); | |||
target.addAttribute("name", getIdentifier()); | |||
@@ -45,6 +47,7 @@ public abstract class ServerSideCriterion implements Serializable, | |||
public void paintContent(PaintTarget target) { | |||
} | |||
@Override | |||
public void paintResponse(PaintTarget target) throws PaintException { | |||
} | |||
@@ -49,6 +49,7 @@ public class SourceIs extends ClientSideCriterion { | |||
target.addAttribute("c", paintedComponents); | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
if (dragEvent.getTransferable() instanceof TransferableImpl) { | |||
Component sourceComponent = ((TransferableImpl) dragEvent |
@@ -33,6 +33,7 @@ public class SourceIsTarget extends ClientSideCriterion { | |||
private SourceIsTarget() { | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
if (dragEvent.getTransferable() instanceof TransferableImpl) { | |||
Component sourceComponent = ((TransferableImpl) dragEvent |
@@ -58,6 +58,7 @@ public class TargetDetailIs extends ClientSideCriterion { | |||
} | |||
} | |||
@Override | |||
public boolean accept(DragAndDropEvent dragEvent) { | |||
Object data = dragEvent.getTargetDetails().getData(propertyName); | |||
return value.equals(data); |
@@ -25,6 +25,7 @@ public class JSONException extends Exception { | |||
this.cause = cause; | |||
} | |||
@Override | |||
public Throwable getCause() { | |||
return this.cause; | |||
} |
@@ -77,6 +77,7 @@ public class JSONStringer extends JSONWriter { | |||
* | |||
* @return The JSON text. | |||
*/ | |||
@Override | |||
public String toString() { | |||
return this.mode == 'd' ? this.writer.toString() : null; | |||
} |
@@ -54,6 +54,7 @@ public class Navigator implements Serializable { | |||
setHeight("0px"); | |||
} | |||
@Override | |||
public void navigateTo(String fragmentParameters) { | |||
// nothing to do | |||
} | |||
@@ -88,14 +89,17 @@ public class Navigator implements Serializable { | |||
page.addListener(this); | |||
} | |||
@Override | |||
public String getFragment() { | |||
return page.getFragment(); | |||
} | |||
@Override | |||
public void setFragment(String fragment) { | |||
page.setFragment(fragment, false); | |||
} | |||
@Override | |||
public void fragmentChanged(FragmentChangedEvent event) { | |||
UriFragmentManager.this.navigator.navigateTo(getFragment()); | |||
} | |||
@@ -122,6 +126,7 @@ public class Navigator implements Serializable { | |||
setSizeFull(); | |||
} | |||
@Override | |||
public void showView(View view) { | |||
if (view instanceof Component) { | |||
setCompositionRoot((Component) view); | |||
@@ -155,6 +160,7 @@ public class Navigator implements Serializable { | |||
this.container = container; | |||
} | |||
@Override | |||
public void showView(View view) { | |||
if (view instanceof Component) { | |||
container.removeAllComponents(); | |||
@@ -190,6 +196,7 @@ public class Navigator implements Serializable { | |||
this.view = view; | |||
} | |||
@Override | |||
public String getViewName(String viewAndParameters) { | |||
if (null == viewAndParameters) { | |||
return null; | |||
@@ -200,6 +207,7 @@ public class Navigator implements Serializable { | |||
return null; | |||
} | |||
@Override | |||
public View getView(String viewName) { | |||
if (this.viewName.equals(viewName)) { | |||
return view; | |||
@@ -250,6 +258,7 @@ public class Navigator implements Serializable { | |||
this.viewClass = viewClass; | |||
} | |||
@Override | |||
public String getViewName(String viewAndParameters) { | |||
if (null == viewAndParameters) { | |||
return null; | |||
@@ -261,6 +270,7 @@ public class Navigator implements Serializable { | |||
return null; | |||
} | |||
@Override | |||
public View getView(String viewName) { | |||
if (this.viewName.equals(viewName)) { | |||
try { |
@@ -69,6 +69,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
private ClientConnector parent; | |||
/* Documentation copied from interface */ | |||
@Override | |||
public void requestRepaint() { | |||
Root root = getRoot(); | |||
if (root != null) { | |||
@@ -125,6 +126,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
registerRpc(implementation, type); | |||
} | |||
@Override | |||
public SharedState getState() { | |||
if (null == sharedState) { | |||
sharedState = createState(); | |||
@@ -164,6 +166,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
* | |||
* @see com.vaadin.terminal.gwt.server.ClientConnector#getStateType() | |||
*/ | |||
@Override | |||
public Class<? extends SharedState> getStateType() { | |||
try { | |||
Method m = getClass().getMethod("getState", (Class[]) null); | |||
@@ -214,6 +217,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
this.connector = connector; | |||
} | |||
@Override | |||
public Iterator<ClientConnector> iterator() { | |||
CombinedIterator<ClientConnector> iterator = new CombinedIterator<ClientConnector>(); | |||
iterator.addIterator(connector.getExtensions().iterator()); | |||
@@ -236,6 +240,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
rpcInterfaceName = rpcInterface.getName().replaceAll("\\$", "."); | |||
} | |||
@Override | |||
public Object invoke(Object proxy, Method method, Object[] args) | |||
throws Throwable { | |||
addMethodInvocationToQueue(rpcInterfaceName, method, args); | |||
@@ -274,10 +279,12 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
* | |||
* @since 7.0 | |||
*/ | |||
@Override | |||
public RpcManager getRpcManager(Class<?> rpcInterface) { | |||
return rpcManagerMap.get(rpcInterface); | |||
} | |||
@Override | |||
public List<ClientMethodInvocation> retrievePendingRpcCalls() { | |||
if (pendingInvocations.isEmpty()) { | |||
return Collections.emptyList(); | |||
@@ -288,6 +295,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
} | |||
} | |||
@Override | |||
public String getConnectorId() { | |||
if (connectorId == null) { | |||
if (getApplication() == null) { | |||
@@ -322,6 +330,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
* @return the Root ancestor of this connector, or <code>null</code> if none | |||
* is found. | |||
*/ | |||
@Override | |||
public Root getRoot() { | |||
ClientConnector connector = this; | |||
while (connector != null) { | |||
@@ -337,6 +346,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
return Logger.getLogger(AbstractClientConnector.class.getName()); | |||
} | |||
@Override | |||
public void requestRepaintAll() { | |||
requestRepaint(); | |||
@@ -354,6 +364,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
iterators.add(iterator); | |||
} | |||
@Override | |||
public boolean hasNext() { | |||
for (Iterator<? extends T> i : iterators) { | |||
if (i.hasNext()) { | |||
@@ -363,6 +374,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
return false; | |||
} | |||
@Override | |||
public T next() { | |||
for (Iterator<? extends T> i : iterators) { | |||
if (i.hasNext()) { | |||
@@ -372,6 +384,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
throw new NoSuchElementException(); | |||
} | |||
@Override | |||
public void remove() { | |||
throw new UnsupportedOperationException(); | |||
} | |||
@@ -390,6 +403,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
return new AllChildrenIterable(connector); | |||
} | |||
@Override | |||
public Collection<Extension> getExtensions() { | |||
return Collections.unmodifiableCollection(extensions); | |||
} | |||
@@ -416,12 +430,14 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
requestRepaint(); | |||
} | |||
@Override | |||
public void removeExtension(Extension extension) { | |||
extension.setParent(null); | |||
extensions.remove(extension); | |||
requestRepaint(); | |||
} | |||
@Override | |||
public void setParent(ClientConnector parent) { | |||
// If the parent is not changed, don't do anything | |||
@@ -448,10 +464,12 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
} | |||
} | |||
@Override | |||
public ClientConnector getParent() { | |||
return parent; | |||
} | |||
@Override | |||
public void attach() { | |||
requestRepaint(); | |||
@@ -471,6 +489,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
* <code>null</code> after this method is called. | |||
* </p> | |||
*/ | |||
@Override | |||
public void detach() { | |||
for (ClientConnector connector : getAllChildrenIterable(this)) { | |||
connector.detach(); | |||
@@ -479,6 +498,7 @@ public abstract class AbstractClientConnector implements ClientConnector { | |||
getRoot().getConnectorTracker().unregisterConnector(this); | |||
} | |||
@Override | |||
public boolean isConnectorEnabled() { | |||
if (getParent() == null) { | |||
// No parent -> the component cannot receive updates from the client |
@@ -68,6 +68,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { | |||
} | |||
/* Documented in interface */ | |||
@Override | |||
public ErrorLevel getErrorLevel() { | |||
return level; | |||
} | |||
@@ -92,6 +93,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { | |||
causes.add(cause); | |||
} | |||
@Override | |||
public String getFormattedHtmlMessage() { | |||
String result = null; | |||
switch (getMode()) { |
@@ -89,6 +89,7 @@ public class ClassResource implements ApplicationResource, Serializable { | |||
* | |||
* @see com.vaadin.terminal.Resource#getMIMEType() | |||
*/ | |||
@Override | |||
public String getMIMEType() { | |||
return FileTypeResolver.getMIMEType(resourceName); | |||
} | |||
@@ -98,6 +99,7 @@ public class ClassResource implements ApplicationResource, Serializable { | |||
* | |||
* @see com.vaadin.terminal.ApplicationResource#getApplication() | |||
*/ | |||
@Override | |||
public Application getApplication() { | |||
return application; | |||
} | |||
@@ -108,6 +110,7 @@ public class ClassResource implements ApplicationResource, Serializable { | |||
* @return the file name associated to this resource. | |||
* @see com.vaadin.terminal.ApplicationResource#getFilename() | |||
*/ | |||
@Override | |||
public String getFilename() { | |||
int index = 0; | |||
int next = 0; | |||
@@ -123,6 +126,7 @@ public class ClassResource implements ApplicationResource, Serializable { | |||
* | |||
* @see com.vaadin.terminal.ApplicationResource#getStream() | |||
*/ | |||
@Override | |||
public DownloadStream getStream() { | |||
final DownloadStream ds = new DownloadStream( | |||
associatedClass.getResourceAsStream(resourceName), | |||
@@ -133,6 +137,7 @@ public class ClassResource implements ApplicationResource, Serializable { | |||
} | |||
/* documented in superclass */ | |||
@Override | |||
public int getBufferSize() { | |||
return bufferSize; | |||
} | |||
@@ -148,6 +153,7 @@ public class ClassResource implements ApplicationResource, Serializable { | |||
} | |||
/* documented in superclass */ | |||
@Override | |||
public long getCacheTime() { | |||
return cacheTime; | |||
} |
@@ -63,6 +63,7 @@ public class CombinedRequest implements WrappedRequest { | |||
} | |||
@Override | |||
public String getParameter(String parameter) { | |||
String[] strings = getParameterMap().get(parameter); | |||
if (strings == null || strings.length == 0) { | |||
@@ -72,48 +73,60 @@ public class CombinedRequest implements WrappedRequest { | |||
} | |||
} | |||
@Override | |||
public Map<String, String[]> getParameterMap() { | |||
return parameterMap; | |||
} | |||
@Override | |||
public int getContentLength() { | |||
return secondRequest.getContentLength(); | |||
} | |||
@Override | |||
public InputStream getInputStream() throws IOException { | |||
return secondRequest.getInputStream(); | |||
} | |||
@Override | |||
public Object getAttribute(String name) { | |||
return secondRequest.getAttribute(name); | |||
} | |||
@Override | |||
public void setAttribute(String name, Object value) { | |||
secondRequest.setAttribute(name, value); | |||
} | |||
@Override | |||
public String getRequestPathInfo() { | |||
return secondRequest.getParameter("initialPath"); | |||
} | |||
@Override | |||
public int getSessionMaxInactiveInterval() { | |||
return secondRequest.getSessionMaxInactiveInterval(); | |||
} | |||
@Override | |||
public Object getSessionAttribute(String name) { | |||
return secondRequest.getSessionAttribute(name); | |||
} | |||
@Override | |||
public void setSessionAttribute(String name, Object attribute) { | |||
secondRequest.setSessionAttribute(name, attribute); | |||
} | |||
@Override | |||
public String getContentType() { | |||
return secondRequest.getContentType(); | |||
} | |||
@Override | |||
public BrowserDetails getBrowserDetails() { | |||
return new BrowserDetails() { | |||
@Override | |||
public String getUriFragment() { | |||
String fragment = secondRequest.getParameter("fr"); | |||
if (fragment == null) { | |||
@@ -123,10 +136,12 @@ public class CombinedRequest implements WrappedRequest { | |||
} | |||
} | |||
@Override | |||
public String getWindowName() { | |||
return secondRequest.getParameter("wn"); | |||
} | |||
@Override | |||
public WebBrowser getWebBrowser() { | |||
WebApplicationContext context = (WebApplicationContext) Application | |||
.getCurrent().getContext(); | |||
@@ -145,22 +160,27 @@ public class CombinedRequest implements WrappedRequest { | |||
return secondRequest; | |||
} | |||
@Override | |||
public Locale getLocale() { | |||
return secondRequest.getLocale(); | |||
} | |||
@Override | |||
public String getRemoteAddr() { | |||
return secondRequest.getRemoteAddr(); | |||
} | |||
@Override | |||
public boolean isSecure() { | |||
return secondRequest.isSecure(); | |||
} | |||
@Override | |||
public String getHeader(String name) { | |||
return secondRequest.getHeader(name); | |||
} | |||
@Override | |||
public DeploymentConfiguration getDeploymentConfiguration() { | |||
return secondRequest.getDeploymentConfiguration(); | |||
} |
@@ -100,6 +100,7 @@ public class ExternalResource implements Resource, Serializable { | |||
* | |||
* @see com.vaadin.terminal.Resource#getMIMEType() | |||
*/ | |||
@Override | |||
public String getMIMEType() { | |||
if (mimeType == null) { | |||
mimeType = FileTypeResolver.getMIMEType(getURL().toString()); |
@@ -61,6 +61,7 @@ public class FileResource implements ApplicationResource { | |||
* | |||
* @see com.vaadin.terminal.ApplicationResource#getStream() | |||
*/ | |||
@Override | |||
public DownloadStream getStream() { | |||
try { | |||
final DownloadStream ds = new DownloadStream(new FileInputStream( | |||
@@ -74,6 +75,7 @@ public class FileResource implements ApplicationResource { | |||
// Log the exception using the application error handler | |||
getApplication().getErrorHandler().terminalError(new ErrorEvent() { | |||
@Override | |||
public Throwable getThrowable() { | |||
return e; | |||
} | |||
@@ -106,6 +108,7 @@ public class FileResource implements ApplicationResource { | |||
/** | |||
* @see com.vaadin.terminal.ApplicationResource#getApplication() | |||
*/ | |||
@Override | |||
public Application getApplication() { | |||
return application; | |||
} | |||
@@ -113,6 +116,7 @@ public class FileResource implements ApplicationResource { | |||
/** | |||
* @see com.vaadin.terminal.ApplicationResource#getFilename() | |||
*/ | |||
@Override | |||
public String getFilename() { | |||
return sourceFile.getName(); | |||
} | |||
@@ -120,6 +124,7 @@ public class FileResource implements ApplicationResource { | |||
/** | |||
* @see com.vaadin.terminal.Resource#getMIMEType() | |||
*/ | |||
@Override | |||
public String getMIMEType() { | |||
return FileTypeResolver.getMIMEType(sourceFile); | |||
} | |||
@@ -132,6 +137,7 @@ public class FileResource implements ApplicationResource { | |||
* | |||
* @return Cache time in milliseconds. | |||
*/ | |||
@Override | |||
public long getCacheTime() { | |||
return cacheTime; | |||
} | |||
@@ -150,6 +156,7 @@ public class FileResource implements ApplicationResource { | |||
} | |||
/* documented in superclass */ | |||
@Override | |||
public int getBufferSize() { | |||
return bufferSize; | |||
} |
@@ -65,6 +65,7 @@ public class JavaScriptCallbackHelper implements Serializable { | |||
private void ensureRpc() { | |||
if (javascriptCallbackRpc == null) { | |||
javascriptCallbackRpc = new JavaScriptCallbackRpc() { | |||
@Override | |||
public void call(String name, JSONArray arguments) { | |||
JavaScriptCallback callback = callbacks.get(name); | |||
try { |
@@ -79,6 +79,7 @@ public class StreamResource implements ApplicationResource { | |||
/** | |||
* @see com.vaadin.terminal.Resource#getMIMEType() | |||
*/ | |||
@Override | |||
public String getMIMEType() { | |||
if (MIMEType != null) { | |||
return MIMEType; | |||
@@ -123,6 +124,7 @@ public class StreamResource implements ApplicationResource { | |||
* | |||
* @return the filename. | |||
*/ | |||
@Override | |||
public String getFilename() { | |||
return filename; | |||
} | |||
@@ -140,6 +142,7 @@ public class StreamResource implements ApplicationResource { | |||
/** | |||
* @see com.vaadin.terminal.ApplicationResource#getApplication() | |||
*/ | |||
@Override | |||
public Application getApplication() { | |||
return application; | |||
} | |||
@@ -147,6 +150,7 @@ public class StreamResource implements ApplicationResource { | |||
/** | |||
* @see com.vaadin.terminal.ApplicationResource#getStream() | |||
*/ | |||
@Override | |||
public DownloadStream getStream() { | |||
final StreamSource ss = getStreamSource(); | |||
if (ss == null) { | |||
@@ -176,6 +180,7 @@ public class StreamResource implements ApplicationResource { | |||
} | |||
/* documented in superclass */ | |||
@Override | |||
public int getBufferSize() { | |||
return bufferSize; | |||
} | |||
@@ -191,6 +196,7 @@ public class StreamResource implements ApplicationResource { | |||
} | |||
/* documented in superclass */ | |||
@Override | |||
public long getCacheTime() { | |||
return cacheTime; | |||
} |
@@ -89,6 +89,7 @@ public class ThemeResource implements Resource { | |||
/** | |||
* @see com.vaadin.terminal.Resource#getMIMEType() | |||
*/ | |||
@Override | |||
public String getMIMEType() { | |||
return FileTypeResolver.getMIMEType(getResourceId()); | |||
} |
@@ -121,6 +121,7 @@ public class AbstractFieldState extends ComponentState implements TabIndexState | |||
* | |||
* @see com.vaadin.terminal.gwt.client.ComponentState#getTabIndex() | |||
*/ | |||
@Override | |||
public int getTabIndex() { | |||
return tabIndex; | |||
} | |||
@@ -130,6 +131,7 @@ public class AbstractFieldState extends ComponentState implements TabIndexState | |||
* | |||
* @see com.vaadin.terminal.gwt.client.ui.TabIndexState#setTabIndex(int) | |||
*/ | |||
@Override | |||
public void setTabIndex(int tabIndex) { | |||
this.tabIndex = tabIndex; | |||
} |
@@ -348,6 +348,7 @@ public class ApplicationConfiguration implements EntryPoint { | |||
public static void startApplication(final String applicationId) { | |||
Scheduler.get().scheduleDeferred(new ScheduledCommand() { | |||
@Override | |||
public void execute() { | |||
ApplicationConfiguration appConf = getConfigFromDOM(applicationId); | |||
ApplicationConnection a = GWT | |||
@@ -553,6 +554,7 @@ public class ApplicationConfiguration implements EntryPoint { | |||
private static DeferredWidgetLoader deferredWidgetLoader; | |||
@Override | |||
public void onModuleLoad() { | |||
// Prepare VConsole for debugging | |||
@@ -571,6 +573,7 @@ public class ApplicationConfiguration implements EntryPoint { | |||
*/ | |||
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() { | |||
@Override | |||
public void onUncaughtException(Throwable e) { | |||
/* | |||
* Note in case of null console (without ?debug) we eat |
@@ -22,6 +22,7 @@ public interface ComponentConnector extends ServerConnector { | |||
* | |||
* @see com.vaadin.terminal.gwt.client.VPaintable#getState() | |||
*/ | |||
@Override | |||
public ComponentState getState(); | |||
/** |
@@ -49,6 +49,7 @@ public class JavaScriptConnectorHelper { | |||
public void init() { | |||
connector.addStateChangeHandler(new StateChangeHandler() { | |||
@Override | |||
public void onStateChanged(StateChangeEvent stateChangeEvent) { | |||
JavaScriptObject wrapper = getConnectorWrapper(); | |||
JavaScriptConnectorState state = getConnectorState(); |
@@ -21,6 +21,7 @@ public final class JavaScriptExtension extends AbstractExtensionConnector | |||
helper.init(); | |||
} | |||
@Override | |||
public JavaScriptConnectorHelper getJavascriptConnectorHelper() { | |||
return helper; | |||
} |
@@ -18,6 +18,7 @@ public class JavaScriptExtensionState extends SharedState implements | |||
private Set<String> callbackNames = new HashSet<String>(); | |||
private Map<String, Set<String>> rpcInterfaces = new HashMap<String, Set<String>>(); | |||
@Override | |||
public Set<String> getCallbackNames() { | |||
return callbackNames; | |||
} | |||
@@ -26,6 +27,7 @@ public class JavaScriptExtensionState extends SharedState implements | |||
this.callbackNames = callbackNames; | |||
} | |||
@Override | |||
public Map<String, Set<String>> getRpcInterfaces() { | |||
return rpcInterfaces; | |||
} |
@@ -15,39 +15,48 @@ import com.google.gwt.core.client.GWT; | |||
*/ | |||
public class NullConsole implements Console { | |||
@Override | |||
public void dirUIDL(ValueMap u, ApplicationConfiguration cnf) { | |||
} | |||
@Override | |||
public void error(String msg) { | |||
GWT.log(msg); | |||
} | |||
@Override | |||
public void log(String msg) { | |||
GWT.log(msg); | |||
} | |||
@Override | |||
public void printObject(Object msg) { | |||
GWT.log(msg.toString()); | |||
} | |||
@Override | |||
public void printLayoutProblems(ValueMap meta, | |||
ApplicationConnection applicationConnection, | |||
Set<ComponentConnector> zeroHeightComponents, | |||
Set<ComponentConnector> zeroWidthComponents) { | |||
} | |||
@Override | |||
public void log(Throwable e) { | |||
GWT.log(e.getMessage(), e); | |||
} | |||
@Override | |||
public void error(Throwable e) { | |||
// Borrow exception handling from VDebugConsole | |||
VDebugConsole.handleError(e, this); | |||
} | |||
@Override | |||
public void setQuietMode(boolean quietDebugMode) { | |||
} | |||
@Override | |||
public void init() { | |||
} | |||
@@ -206,10 +206,12 @@ public class ResourceLoader { | |||
if (preloadListeners.containsKey(url)) { | |||
// Preload going on, continue when preloaded | |||
preloadResource(url, new ResourceLoadListener() { | |||
@Override | |||
public void onLoad(ResourceLoadEvent event) { | |||
loadScript(url, resourceLoadListener); | |||
} | |||
@Override | |||
public void onError(ResourceLoadEvent event) { | |||
// Preload failed -> signal error to own listener | |||
if (resourceLoadListener != null) { | |||
@@ -225,10 +227,12 @@ public class ResourceLoader { | |||
scriptTag.setSrc(url); | |||
scriptTag.setType("text/javascript"); | |||
addOnloadHandler(scriptTag, new ResourceLoadListener() { | |||
@Override | |||
public void onLoad(ResourceLoadEvent event) { | |||
fireLoad(event); | |||
} | |||
@Override | |||
public void onError(ResourceLoadEvent event) { | |||
fireError(event); | |||
} | |||
@@ -280,10 +284,12 @@ public class ResourceLoader { | |||
Element element = getPreloadElement(url); | |||
addOnloadHandler(element, new ResourceLoadListener() { | |||
@Override | |||
public void onLoad(ResourceLoadEvent event) { | |||
fireLoad(event); | |||
} | |||
@Override | |||
public void onError(ResourceLoadEvent event) { | |||
fireError(event); | |||
} | |||
@@ -358,10 +364,12 @@ public class ResourceLoader { | |||
if (preloadListeners.containsKey(url)) { | |||
// Preload going on, continue when preloaded | |||
preloadResource(url, new ResourceLoadListener() { | |||
@Override | |||
public void onLoad(ResourceLoadEvent event) { | |||
loadStylesheet(url, resourceLoadListener); | |||
} | |||
@Override | |||
public void onError(ResourceLoadEvent event) { | |||
// Preload failed -> signal error to own listener | |||
if (resourceLoadListener != null) { | |||
@@ -384,6 +392,7 @@ public class ResourceLoader { | |||
Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() { | |||
private final Duration duration = new Duration(); | |||
@Override | |||
public boolean execute() { | |||
int styleSheetLength = getStyleSheetLength(url); | |||
if (getStyleSheetLength(url) > 0) { | |||
@@ -403,6 +412,7 @@ public class ResourceLoader { | |||
}, 10); | |||
} else { | |||
addOnloadHandler(linkElement, new ResourceLoadListener() { | |||
@Override | |||
public void onLoad(ResourceLoadEvent event) { | |||
// Chrome && IE fires load for errors, must check | |||
// stylesheet data | |||
@@ -418,6 +428,7 @@ public class ResourceLoader { | |||
fireLoad(event); | |||
} | |||
@Override | |||
public void onError(ResourceLoadEvent event) { | |||
fireError(event); | |||
} |
@@ -93,6 +93,7 @@ public interface ServerConnector extends Connector { | |||
* @return The parent of this connector, as set by | |||
* {@link #setParent(ServerConnector)}. | |||
*/ | |||
@Override | |||
public ServerConnector getParent(); | |||
/** |