summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/util/LargeContainer.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/util/LargeContainer.java')
-rw-r--r--uitest/src/com/vaadin/tests/util/LargeContainer.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/util/LargeContainer.java b/uitest/src/com/vaadin/tests/util/LargeContainer.java
index 9d02cfa53c..3c18899493 100644
--- a/uitest/src/com/vaadin/tests/util/LargeContainer.java
+++ b/uitest/src/com/vaadin/tests/util/LargeContainer.java
@@ -23,6 +23,7 @@ public class LargeContainer extends AbstractContainer implements
this.itemId = itemId;
}
+ @Override
public Property<?> getItemProperty(Object propertyId) {
ObjectProperty<String> property = new ObjectProperty<String>(
containerPropertyIdDefaults.get(propertyId) + " (item "
@@ -31,16 +32,19 @@ public class LargeContainer extends AbstractContainer implements
}
+ @Override
public Collection<?> getItemPropertyIds() {
return getContainerPropertyIds();
}
+ @Override
@SuppressWarnings("rawtypes")
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Cannot add item property");
}
+ @Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
@@ -54,6 +58,7 @@ public class LargeContainer extends AbstractContainer implements
private Map<Object, Class<?>> containerPropertyIdTypes = new HashMap<Object, Class<?>>();
private Map<Object, Object> containerPropertyIdDefaults = new HashMap<Object, Object>();
+ @Override
public Object nextItemId(Object itemId) {
Integer id = (Integer) itemId;
if (id >= size() - 1) {
@@ -62,6 +67,7 @@ public class LargeContainer extends AbstractContainer implements
return (id + 1);
}
+ @Override
public Object prevItemId(Object itemId) {
Integer id = (Integer) itemId;
if (id <= 0) {
@@ -70,6 +76,7 @@ public class LargeContainer extends AbstractContainer implements
return (id - 1);
}
+ @Override
public Object firstItemId() {
if (0 == size()) {
return null;
@@ -77,6 +84,7 @@ public class LargeContainer extends AbstractContainer implements
return 0;
}
+ @Override
public Object lastItemId() {
if (0 == size()) {
return null;
@@ -84,6 +92,7 @@ public class LargeContainer extends AbstractContainer implements
return (size() - 1);
}
+ @Override
public boolean isFirstId(Object itemId) {
if (null == itemId) {
return false;
@@ -91,6 +100,7 @@ public class LargeContainer extends AbstractContainer implements
return itemId.equals(firstItemId());
}
+ @Override
public boolean isLastId(Object itemId) {
if (null == itemId) {
return false;
@@ -98,6 +108,7 @@ public class LargeContainer extends AbstractContainer implements
return itemId.equals(lastItemId());
}
+ @Override
public TestItem getItem(Object itemId) {
if (!containsId(itemId)) {
return null;
@@ -105,6 +116,7 @@ public class LargeContainer extends AbstractContainer implements
return new TestItem(itemId);
}
+ @Override
public Collection<?> getItemIds() {
return new RangeCollection(size());
}
@@ -116,6 +128,7 @@ public class LargeContainer extends AbstractContainer implements
numberOfIds, this);
}
+ @Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
TestItem item = getItem(itemId);
if (null == item) {
@@ -124,10 +137,12 @@ public class LargeContainer extends AbstractContainer implements
return item.getItemProperty(propertyId);
}
+ @Override
public int size() {
return size;
}
+ @Override
public boolean containsId(Object itemId) {
if (!(itemId instanceof Integer)) {
return false;
@@ -136,6 +151,7 @@ public class LargeContainer extends AbstractContainer implements
return (id >= 0 && id < (size() - 1));
}
+ @Override
public int indexOfId(Object itemId) {
if (!containsId(itemId)) {
return -1;
@@ -143,6 +159,7 @@ public class LargeContainer extends AbstractContainer implements
return (Integer) itemId;
}
+ @Override
public Object getIdByIndex(int index) {
return index;
}
@@ -151,19 +168,23 @@ public class LargeContainer extends AbstractContainer implements
size = newSize;
}
+ @Override
public boolean removeAllItems() throws UnsupportedOperationException {
setSize(0);
return true;
}
+ @Override
public Class<?> getType(Object propertyId) {
return containerPropertyIdTypes.get(propertyId);
}
+ @Override
public Collection<?> getContainerPropertyIds() {
return containerPropertyIdTypes.keySet();
}
+ @Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
if (containerPropertyIdTypes.containsKey(propertyId) || null == type) {
@@ -174,6 +195,7 @@ public class LargeContainer extends AbstractContainer implements
return true;
}
+ @Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
if (!containerPropertyIdTypes.containsKey(propertyId)) {
@@ -184,33 +206,40 @@ public class LargeContainer extends AbstractContainer implements
return true;
}
+ @Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
+ @Override
public Object addItem() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
+ @Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
+ @Override
public Object addItemAt(int index) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
+ @Override
public Item addItemAt(int index, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
+ @Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
+ @Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");