* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
public interface Buffered extends Serializable {
/**
* @since 3.0
*/
@SuppressWarnings("serial")
+ @Deprecated
public class SourceException extends RuntimeException
implements Serializable, ErrorMessageProducer {
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
public interface BufferedValidatable
extends Buffered, Validatable, Serializable {
* <p>
*
*/
+@Deprecated
public interface Collapsible extends Hierarchical, Ordered {
/**
* @author Vaadin Ltd
* @since 3.0
*/
+@Deprecated
public interface Container extends Serializable {
/**
* {@link Sortable} for more information.
* </p>
*/
+ @Deprecated
public interface Ordered extends Container {
/**
* change the internal order of items in the container.
* </p>
*/
+ @Deprecated
public interface Sortable extends Ordered {
/**
* position based on sorting.
* </p>
*/
+ @Deprecated
public interface Indexed extends Ordered {
/**
*
* @since 7.4
*/
+ @Deprecated
public interface ItemAddEvent extends ItemSetChangeEvent {
/**
*
* @since 7.4
*/
+ @Deprecated
public interface ItemRemoveEvent extends ItemSetChangeEvent {
/**
* Gets the item id of the first removed item.
* unable to have children.
* </ul>
*/
+ @Deprecated
public interface Hierarchical extends Container {
/**
*
* @since 5.0 (renamed from Filterable to SimpleFilterable in 6.6)
*/
+ @Deprecated
public interface SimpleFilterable extends Container, Serializable {
/**
*
* @since 6.6
*/
+ @Deprecated
public interface Filter extends Serializable {
/**
*
* @since 6.6
*/
+ @Deprecated
public interface Filterable extends Container, Serializable {
/**
* Adds a filter for the container.
* Interface implemented by viewer classes capable of using a Container as a
* data source.
*/
+ @Deprecated
public interface Viewer extends Serializable {
/**
* internally.
* </p>
*/
+ @Deprecated
public interface Editor extends Container.Viewer, Serializable {
}
*
* A simple property value change is not an item set change.
*/
+ @Deprecated
public interface ItemSetChangeEvent extends Serializable {
/**
* An item set change refers to addition, removal or reordering of items in
* the container. A simple property value change is not an item set change.
*/
+ @Deprecated
public interface ItemSetChangeListener extends Serializable {
/**
* be able to implement an interface.
* </p>
*/
+ @Deprecated
public interface ItemSetChangeNotifier extends Serializable {
/**
* items in the container and their property values are not property set
* changes.
*/
+ @Deprecated
public interface PropertySetChangeEvent extends Serializable {
/**
* concerning the set of items in the container and their property values
* are not property set changes.
*/
+ @Deprecated
public interface PropertySetChangeListener extends Serializable {
/**
* be able to implement an interface.
* </p>
*/
+ @Deprecated
public interface PropertySetChangeNotifier extends Serializable {
/**
*
* @since 7.0
*/
+@Deprecated
public class ContainerHelpers implements Serializable {
/**
endIndex = container.size();
}
- ArrayList<Object> rangeOfIds = new ArrayList<Object>();
+ ArrayList<Object> rangeOfIds = new ArrayList<>();
for (int i = startIndex; i < endIndex; i++) {
Object idByIndex = container.getIdByIndex(i);
if (idByIndex == null) {
* @author Vaadin Ltd
* @since 3.0
*/
+@Deprecated
public interface Item extends Serializable {
/**
* Interface implemented by viewer classes capable of using an Item as a
* data source.
*/
+ @Deprecated
public interface Viewer extends Serializable {
/**
* restrict the class from editing the contents of an internally.
* </p>
*/
+ @Deprecated
public interface Editor extends Item.Viewer, Serializable {
}
* this event.
* </p>
*/
+ @Deprecated
public interface PropertySetChangeEvent extends Serializable {
/**
* The listener interface for receiving <code>PropertySetChangeEvent</code>
* objects.
*/
+ @Deprecated
public interface PropertySetChangeListener extends Serializable {
/**
* be able to implement an interface.
* </p>
*/
+ @Deprecated
public interface PropertySetChangeNotifier extends Serializable {
/**
* @author Vaadin Ltd
* @since 3.0
*/
+@Deprecated
public interface Property<T> extends Serializable {
/**
* @author Vaadin Ltd
* @since 7.0
*/
+ @Deprecated
public interface Transactional<T> extends Property<T> {
/**
* @since 3.0
*/
@SuppressWarnings("serial")
+ @Deprecated
public class ReadOnlyException extends RuntimeException {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface Viewer extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface Editor extends Property.Viewer, Serializable {
}
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ValueChangeEvent extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ValueChangeListener extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ValueChangeNotifier extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ReadOnlyStatusChangeEvent extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ReadOnlyStatusChangeListener extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ReadOnlyStatusChangeNotifier extends Serializable {
/**
* @since 3.0
* @see com.vaadin.v7.data.Validator
*/
+@Deprecated
public interface Validatable extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
public interface Validator extends Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
@SuppressWarnings("serial")
public class InvalidValueException extends RuntimeException
implements ErrorMessageProducer {
* @since 5.3.0
*/
@SuppressWarnings("serial")
+ @Deprecated
public class EmptyValueException extends Validator.InvalidValueException {
public EmptyValueException(String message) {
import com.vaadin.v7.data.validator.BeanValidator;
import com.vaadin.v7.ui.Field;
+@Deprecated
public class BeanFieldGroup<T> extends FieldGroup {
private final Class<T> beanType;
public BeanFieldGroup(Class<T> beanType) {
this.beanType = beanType;
- this.defaultValidators = new HashMap<Field<?>, BeanValidator>();
+ this.defaultValidators = new HashMap<>();
}
@Override
if (bean == null) {
setItemDataSource((Item) null);
} else {
- setItemDataSource(new BeanItem<T>(bean, beanType));
+ setItemDataSource(new BeanItem<>(bean, beanType));
}
}
private static <T> BeanFieldGroup<T> createAndBindFields(T bean,
Object objectWithMemberFields, boolean buffered) {
@SuppressWarnings("unchecked")
- BeanFieldGroup<T> beanFieldGroup = new BeanFieldGroup<T>(
+ BeanFieldGroup<T> beanFieldGroup = new BeanFieldGroup<>(
(Class<T>) bean.getClass());
beanFieldGroup.setItemDataSource(bean);
beanFieldGroup.setBuffered(buffered);
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface Caption {
String value();
}
*
* @author Vaadin Ltd
*/
+@Deprecated
public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory {
private static final DefaultFieldGroupFieldFactory INSTANCE = new DefaultFieldGroupFieldFactory();
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class FieldGroup implements Serializable {
private Item itemDataSource;
private boolean enabled = true;
private boolean readOnly = false;
- private HashMap<Object, Field<?>> propertyIdToField = new HashMap<Object, Field<?>>();
- private LinkedHashMap<Field<?>, Object> fieldToPropertyId = new LinkedHashMap<Field<?>, Object>();
- private List<CommitHandler> commitHandlers = new ArrayList<CommitHandler>();
+ private HashMap<Object, Field<?>> propertyIdToField = new HashMap<>();
+ private LinkedHashMap<Field<?>, Object> fieldToPropertyId = new LinkedHashMap<>();
+ private List<CommitHandler> commitHandlers = new ArrayList<>();
/**
* The field factory used by builder methods.
*/
protected <T> Property.Transactional<T> wrapInTransactionalProperty(
Property<T> itemProperty) {
- return new TransactionalPropertyWrapper<T>(itemProperty);
+ return new TransactionalPropertyWrapper<>(itemProperty);
}
private void throwIfFieldIsNull(Field<?> field, Object propertyId) {
*/
public Collection<Object> getUnboundPropertyIds() {
if (getItemDataSource() == null) {
- return new ArrayList<Object>();
+ return new ArrayList<>();
}
- List<Object> unboundPropertyIds = new ArrayList<Object>();
+ List<Object> unboundPropertyIds = new ArrayList<>();
unboundPropertyIds.addAll(getItemDataSource().getItemPropertyIds());
unboundPropertyIds.removeAll(propertyIdToField.keySet());
return unboundPropertyIds;
* commits succeeded
*/
private Map<Field<?>, InvalidValueException> commitFields() {
- Map<Field<?>, InvalidValueException> invalidValueExceptions = new HashMap<Field<?>, InvalidValueException>();
+ Map<Field<?>, InvalidValueException> invalidValueExceptions = new HashMap<>();
for (Field<?> f : fieldToPropertyId.keySet()) {
try {
*
* @since 7.4
*/
+ @Deprecated
public static class FieldGroupInvalidValueException
extends InvalidValueException {
private Map<Field<?>, InvalidValueException> invalidValueExceptions;
* of the commit and cause the commit to be aborted by throwing a
* {@link CommitException}.
*/
+ @Deprecated
public interface CommitHandler extends Serializable {
/**
* Called before changes are committed to the field and the item is
* FIXME javadoc
*
*/
+ @Deprecated
public static class CommitEvent implements Serializable {
private FieldGroup fieldBinder;
* fields did not pass validation
*
*/
+ @Deprecated
public static class CommitException extends Exception {
private FieldGroup fieldGroup;
return ((FieldGroupInvalidValueException) getCause())
.getInvalidFields();
}
- return new HashMap<Field<?>, InvalidValueException>();
+ return new HashMap<>();
}
/**
}
+ @Deprecated
public static class BindException extends RuntimeException {
public BindException(String message) {
}
+ @Deprecated
public static class SearchException extends RuntimeException {
public SearchException(String message) {
*/
protected static List<java.lang.reflect.Field> getFieldsInDeclareOrder(
Class searchClass) {
- ArrayList<java.lang.reflect.Field> memberFieldInOrder = new ArrayList<java.lang.reflect.Field>();
+ ArrayList<java.lang.reflect.Field> memberFieldInOrder = new ArrayList<>();
while (searchClass != null) {
for (java.lang.reflect.Field memberField : searchClass
* @author Vaadin Ltd.
* @since 7.0
*/
+@Deprecated
public interface FieldGroupFieldFactory extends Serializable {
/**
* Creates a field based on the data type that we want to edit
*/
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
+@Deprecated
public @interface PropertyId {
String value();
}
*
* @since 6.5
*/
+@Deprecated
public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE>
extends AbstractInMemoryContainer<IDTYPE, String, BeanItem<BEANTYPE>>
implements Filterable, SimpleFilterable, Sortable, ValueChangeListener,
*
* @since 6.5
*/
+ @Deprecated
public static interface BeanIdResolver<IDTYPE, BEANTYPE>
extends Serializable {
/**
* The bean must have a getter for the property, and the getter must return
* an object of type IDTYPE.
*/
+ @Deprecated
protected class PropertyBasedBeanIdResolver
implements BeanIdResolver<IDTYPE, BEANTYPE> {
* Maps all item ids in the container (including filtered) to their
* corresponding BeanItem.
*/
- private final Map<IDTYPE, BeanItem<BEANTYPE>> itemIdToItem = new HashMap<IDTYPE, BeanItem<BEANTYPE>>();
+ private final Map<IDTYPE, BeanItem<BEANTYPE>> itemIdToItem = new HashMap<>();
/**
* The type of the beans in the container.
* @return created {@link BeanItem} or null if bean is null
*/
protected BeanItem<BEANTYPE> createBeanItem(BEANTYPE bean) {
- return bean == null ? null : new BeanItem<BEANTYPE>(bean, model);
+ return bean == null ? null : new BeanItem<>(bean, model);
}
/**
.getPropertyDescriptors((Class<Object>) propertyType);
for (String subPropertyId : pds.keySet()) {
String qualifiedPropertyId = propertyId + "." + subPropertyId;
- NestedPropertyDescriptor<BEANTYPE> pd = new NestedPropertyDescriptor<BEANTYPE>(
+ NestedPropertyDescriptor<BEANTYPE> pd = new NestedPropertyDescriptor<>(
qualifiedPropertyId, (Class<BEANTYPE>) type);
model.put(qualifiedPropertyId, pd);
model.remove(propertyId);
*
* @since 6.6
*/
+@Deprecated
public abstract class AbstractContainer implements Container {
/**
* concerned by the change, but subclasses can provide additional
* information about the changes.
*/
+ @Deprecated
protected static class BasePropertySetChangeEvent extends EventObject
implements Container.PropertySetChangeEvent, Serializable {
* performed, but subclasses can add provide additional information about
* the changes.
*/
+ @Deprecated
protected static class BaseItemSetChangeEvent extends EventObject
implements Container.ItemSetChangeEvent, Serializable {
*
* @since 6.6
*/
+@Deprecated
public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITEMCLASS extends Item>
extends AbstractContainer
implements ItemSetChangeNotifier, Container.Indexed {
* Filters that are applied to the container to limit the items visible in
* it
*/
- private Set<Filter> filters = new HashSet<Filter>();
+ private Set<Filter> filters = new HashSet<>();
/**
* The item sorter which is used for sorting the container.
*
* @since 7.4
*/
+ @Deprecated
protected static class BaseItemAddEvent extends BaseItemAddOrRemoveEvent
implements Container.Indexed.ItemAddEvent {
*
* @since 7.4
*/
+ @Deprecated
protected static class BaseItemRemoveEvent extends BaseItemAddOrRemoveEvent
implements Container.Indexed.ItemRemoveEvent {
if (getFilters().isEmpty() || propertyId == null) {
return Collections.emptyList();
}
- List<Filter> removedFilters = new LinkedList<Filter>();
+ List<Filter> removedFilters = new LinkedList<>();
for (Iterator<Filter> iterator = getFilters().iterator(); iterator
.hasNext();) {
Filter f = iterator.next();
* to implement {@link Sortable#getSortableContainerPropertyIds()}.
*/
protected Collection<?> getSortablePropertyIds() {
- LinkedList<Object> sortables = new LinkedList<Object>();
+ LinkedList<Object> sortables = new LinkedList<>();
for (Object propertyId : getContainerPropertyIds()) {
Class<?> propertyType = getType(propertyId);
if (Comparable.class.isAssignableFrom(propertyType)
*
* @since 6.6
*/
+@Deprecated
public abstract class AbstractProperty<T> implements Property<T>,
Property.ValueChangeNotifier, Property.ReadOnlyStatusChangeNotifier {
* An <code>Event</code> object specifying the Property whose read-only
* status has been changed.
*/
+ @Deprecated
protected static class ReadOnlyStatusChangeEvent
extends java.util.EventObject
implements Property.ReadOnlyStatusChangeEvent {
public void addReadOnlyStatusChangeListener(
Property.ReadOnlyStatusChangeListener listener) {
if (readOnlyStatusChangeListeners == null) {
- readOnlyStatusChangeListeners = new LinkedList<ReadOnlyStatusChangeListener>();
+ readOnlyStatusChangeListeners = new LinkedList<>();
}
readOnlyStatusChangeListeners.add(listener);
}
@Override
public void addValueChangeListener(ValueChangeListener listener) {
if (valueChangeListeners == null) {
- valueChangeListeners = new LinkedList<ValueChangeListener>();
+ valueChangeListeners = new LinkedList<>();
}
valueChangeListeners.add(listener);
*
* @since 6.5
*/
+@Deprecated
public class BeanContainer<IDTYPE, BEANTYPE>
extends AbstractBeanContainer<IDTYPE, BEANTYPE> {
* @since 3.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class BeanItem<BT> extends PropertysetItem {
/**
*/
static <BT> LinkedHashMap<String, VaadinPropertyDescriptor<BT>> getPropertyDescriptors(
final Class<BT> beanClass) {
- final LinkedHashMap<String, VaadinPropertyDescriptor<BT>> pdMap = new LinkedHashMap<String, VaadinPropertyDescriptor<BT>>();
+ final LinkedHashMap<String, VaadinPropertyDescriptor<BT>> pdMap = new LinkedHashMap<>();
// Try to introspect, if it fails, we just have an empty Item
try {
final Method getMethod = pd.getReadMethod();
if ((getMethod != null)
&& getMethod.getDeclaringClass() != Object.class) {
- VaadinPropertyDescriptor<BT> vaadinPropertyDescriptor = new MethodPropertyDescriptor<BT>(
+ VaadinPropertyDescriptor<BT> vaadinPropertyDescriptor = new MethodPropertyDescriptor<>(
pd.getName(), pd.getPropertyType(),
pd.getReadMethod(), pd.getWriteMethod());
pdMap.put(pd.getName(), vaadinPropertyDescriptor);
* not specified
*/
public void expandProperty(String propertyId, String... subPropertyIds) {
- Set<String> subPropertySet = new HashSet<String>(
+ Set<String> subPropertySet = new HashSet<>(
Arrays.asList(subPropertyIds));
if (0 == subPropertyIds.length) {
*/
public void addNestedProperty(String nestedPropertyId) {
addItemProperty(nestedPropertyId,
- new NestedMethodProperty<Object>(getBean(), nestedPropertyId));
+ new NestedMethodProperty<>(getBean(), nestedPropertyId));
}
/**
*
* @since 5.4
*/
+@Deprecated
@SuppressWarnings("serial")
public class BeanItemContainer<BEANTYPE>
extends AbstractBeanContainer<BEANTYPE, BEANTYPE> {
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class ContainerHierarchicalWrapper implements Container.Hierarchical,
Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier {
// Create initial order if needed
if (!hierarchical) {
- noChildrenAllowed = new HashSet<Object>();
- parent = new Hashtable<Object, Object>();
- children = new Hashtable<Object, LinkedList<Object>>();
- roots = new LinkedHashSet<Object>(container.getItemIds());
+ noChildrenAllowed = new HashSet<>();
+ parent = new Hashtable<>();
+ children = new Hashtable<>();
+ roots = new LinkedHashSet<>(container.getItemIds());
}
updateHierarchicalWrapper();
// Recreate hierarchy and data structures if missing
if (noChildrenAllowed == null || parent == null || children == null
|| roots == null) {
- noChildrenAllowed = new HashSet<Object>();
- parent = new Hashtable<Object, Object>();
- children = new Hashtable<Object, LinkedList<Object>>();
- roots = new LinkedHashSet<Object>(container.getItemIds());
+ noChildrenAllowed = new HashSet<>();
+ parent = new Hashtable<>();
+ children = new Hashtable<>();
+ roots = new LinkedHashSet<>(container.getItemIds());
}
// Check that the hierarchy is up-to-date
itemIds);
// Calculate the set of all items in the hierarchy
- final HashSet<Object> s = new HashSet<Object>();
+ final HashSet<Object> s = new HashSet<>();
s.addAll(parent.keySet());
s.addAll(children.keySet());
s.addAll(roots);
Object[] array = roots.toArray();
Arrays.sort(array, basedOnOrderFromWrappedContainer);
- roots = new LinkedHashSet<Object>();
+ roots = new LinkedHashSet<>();
for (int i = 0; i < array.length; i++) {
roots.add(array[i]);
}
parent.put(itemId, newParentId);
LinkedList<Object> pcl = children.get(newParentId);
if (pcl == null) {
- pcl = new LinkedList<Object>();
+ pcl = new LinkedList<>();
children.put(newParentId, pcl);
}
pcl.add(itemId);
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class ContainerOrderedWrapper implements Container.Ordered,
Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier {
if (next == null || first == null || last == null || prev == null) {
first = null;
last = null;
- next = new Hashtable<Object, Object>();
- prev = new Hashtable<Object, Object>();
+ next = new Hashtable<>();
+ prev = new Hashtable<>();
}
// Filter out all the missing items
- final LinkedList<?> l = new LinkedList<Object>(next.keySet());
+ final LinkedList<?> l = new LinkedList<>(next.keySet());
for (final Iterator<?> i = l.iterator(); i.hasNext();) {
final Object id = i.next();
if (!container.containsId(id)) {
if (ordered) {
return ((Container.Ordered) container).getItemIds();
} else if (first == null) {
- return new ArrayList<Object>();
+ return new ArrayList<>();
} else {
- List<Object> itemIds = new ArrayList<Object>();
+ List<Object> itemIds = new ArrayList<>();
itemIds.add(first);
Object current = first;
while (next.containsKey(current)) {
* provided a default comparator is used.
*
*/
+@Deprecated
public class DefaultItemSorter implements ItemSorter {
private java.lang.Object[] sortPropertyIds;
this.container = container;
// Removes any non-sortable property ids
- final List<Object> ids = new ArrayList<Object>();
- final List<Boolean> orders = new ArrayList<Boolean>();
+ final List<Object> ids = new ArrayList<>();
+ final List<Boolean> orders = new ArrayList<>();
final Collection<?> sortable = container
.getSortableContainerPropertyIds();
for (int i = 0; i < propertyId.length; i++) {
* compares can be cast to Comparable.
*
*/
+ @Deprecated
public static class DefaultPropertyValueComparator
implements Comparator<Object>, Serializable {
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class FilesystemContainer implements Container.Hierarchical {
static {
- FILE_PROPERTIES = new ArrayList<String>();
+ FILE_PROPERTIES = new ArrayList<>();
FILE_PROPERTIES.add(PROPERTY_NAME);
FILE_PROPERTIES.add(PROPERTY_ICON);
FILE_PROPERTIES.add(PROPERTY_SIZE);
public Collection<File> getItemIds() {
if (recursive) {
- final Collection<File> col = new ArrayList<File>();
+ final Collection<File> col = new ArrayList<>();
for (int i = 0; i < roots.length; i++) {
addItemIds(col, roots[i]);
}
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public class FileItem implements Item {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public class FileExtensionFilter implements FilenameFilter, Serializable {
private final String filter;
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class GeneratedPropertyContainer extends AbstractContainer
implements Container.Indexed, Container.Sortable, Container.Filterable,
Container.PropertySetChangeNotifier, Container.ItemSetChangeNotifier {
private Filterable filterableContainer = null;
/* Removed properties which are hidden but not actually removed */
- private final Set<Object> removedProperties = new HashSet<Object>();
+ private final Set<Object> removedProperties = new HashSet<>();
/**
* Property implementation for generated properties
*/
+ @Deprecated
protected static class GeneratedProperty<T> implements Property<T> {
private Item item;
* belongs to the wrapped container. To reach that Item use
* {@link #getWrappedItem()}
*/
+ @Deprecated
public class GeneratedPropertyItem implements Item {
private Item wrappedItem;
@Override
public Collection<?> getItemPropertyIds() {
- Set<Object> wrappedProperties = new LinkedHashSet<Object>(
+ Set<Object> wrappedProperties = new LinkedHashSet<>(
wrappedItem.getItemPropertyIds());
wrappedProperties.removeAll(removedProperties);
wrappedProperties.addAll(propertyGenerators.keySet());
* event is fired from wrapped container and needs to be reconstructed to
* act like it actually came from this container.
*/
+ @Deprecated
protected abstract class GeneratedItemAddOrRemoveEvent
implements Serializable {
}
};
+ @Deprecated
protected class GeneratedItemRemoveEvent
extends GeneratedItemAddOrRemoveEvent implements ItemRemoveEvent {
}
}
+ @Deprecated
protected class GeneratedItemAddEvent extends GeneratedItemAddOrRemoveEvent
implements ItemAddEvent {
* @param container
* underlying indexed container
*/
+ @Deprecated
public GeneratedPropertyContainer(Container.Indexed container) {
wrappedContainer = container;
- propertyGenerators = new HashMap<Object, PropertyValueGenerator<?>>();
+ propertyGenerators = new HashMap<>();
if (wrappedContainer instanceof Sortable) {
sortableContainer = (Sortable) wrappedContainer;
}
if (wrappedContainer instanceof Filterable) {
- activeFilters = new HashMap<Filter, List<Filter>>();
+ activeFilters = new HashMap<>();
filterableContainer = (Filterable) wrappedContainer;
} else {
activeFilters = null;
private <T> Property<T> createProperty(final Item item,
final Object propertyId, final Object itemId,
final PropertyValueGenerator<T> generator) {
- return new GeneratedProperty<T>(item, propertyId, itemId, generator);
+ return new GeneratedProperty<>(item, propertyId, itemId, generator);
}
/* Listener functionality */
"Wrapped container is not filterable");
}
- List<Filter> addedFilters = new ArrayList<Filter>();
+ List<Filter> addedFilters = new ArrayList<>();
for (Entry<?, PropertyValueGenerator<?>> entry : propertyGenerators
.entrySet()) {
Object property = entry.getKey();
return;
}
- List<Object> actualSortProperties = new ArrayList<Object>();
- List<Boolean> actualSortDirections = new ArrayList<Boolean>();
+ List<Object> actualSortProperties = new ArrayList<>();
+ List<Boolean> actualSortDirections = new ArrayList<>();
for (int i = 0; i < propertyId.length; ++i) {
Object property = propertyId[i];
return Collections.emptySet();
}
- Set<Object> sortablePropertySet = new HashSet<Object>(
+ Set<Object> sortablePropertySet = new HashSet<>(
sortableContainer.getSortableContainerPropertyIds());
for (Entry<?, PropertyValueGenerator<?>> entry : propertyGenerators
.entrySet()) {
*/
@Override
public Collection<?> getContainerPropertyIds() {
- Set<Object> wrappedProperties = new LinkedHashSet<Object>(
+ Set<Object> wrappedProperties = new LinkedHashSet<>(
wrappedContainer.getContainerPropertyIds());
wrappedProperties.removeAll(removedProperties);
wrappedProperties.addAll(propertyGenerators.keySet());
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class HierarchicalContainer extends IndexedContainer
implements Container.Hierarchical {
/**
* Set of IDs of those contained Items that can't have children.
*/
- private final HashSet<Object> noChildrenAllowed = new HashSet<Object>();
+ private final HashSet<Object> noChildrenAllowed = new HashSet<>();
/**
* Mapping from Item ID to parent Item ID.
*/
- private final HashMap<Object, Object> parent = new HashMap<Object, Object>();
+ private final HashMap<Object, Object> parent = new HashMap<>();
/**
* Mapping from Item ID to parent Item ID for items included in the filtered
/**
* Mapping from Item ID to a list of child IDs.
*/
- private final HashMap<Object, LinkedList<Object>> children = new HashMap<Object, LinkedList<Object>>();
+ private final HashMap<Object, LinkedList<Object>> children = new HashMap<>();
/**
* Mapping from Item ID to a list of child IDs when filtered
/**
* List that contains all root elements of the container.
*/
- private final LinkedList<Object> roots = new LinkedList<Object>();
+ private final LinkedList<Object> roots = new LinkedList<>();
/**
* List that contains all filtered root elements of the container.
if (pcl == null) {
// Create an empty list for holding children if one were not
// previously created
- pcl = new LinkedList<Object>();
+ pcl = new LinkedList<>();
children.put(newParentId, pcl);
}
pcl.add(itemId);
}
// Reset data structures
- filteredRoots = new LinkedList<Object>();
- filteredChildren = new HashMap<Object, LinkedList<Object>>();
- filteredParent = new HashMap<Object, Object>();
+ filteredRoots = new LinkedList<>();
+ filteredChildren = new HashMap<>();
+ filteredParent = new HashMap<>();
if (includeParentsWhenFiltering) {
// Filter so that parents for items that match the filter are also
// included
- HashSet<Object> includedItems = new HashSet<Object>();
+ HashSet<Object> includedItems = new HashSet<>();
for (Object rootId : roots) {
if (filterIncludingParents(rootId, includedItems)) {
filteredRoots.add(rootId);
// match
super.doFilterContainer(hasFilters);
- LinkedHashSet<Object> filteredItemIds = new LinkedHashSet<Object>(
+ LinkedHashSet<Object> filteredItemIds = new LinkedHashSet<>(
getItemIds());
for (Object itemId : filteredItemIds) {
LinkedList<Object> parentToChildrenList = filteredChildren
.get(parentItemId);
if (parentToChildrenList == null) {
- parentToChildrenList = new LinkedList<Object>();
+ parentToChildrenList = new LinkedList<>();
filteredChildren.put(parentItemId, parentToChildrenList);
}
filteredParent.put(childItemId, parentItemId);
*
* @see ContainerOrderedWrapper
*/
+@Deprecated
@SuppressWarnings({ "serial" })
public class HierarchicalContainerOrderedWrapper extends ContainerOrderedWrapper
implements Hierarchical {
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
// item type is really IndexedContainerItem, but using Item not to show it in
// public API
/**
* Linked list of ordered Property IDs.
*/
- private ArrayList<Object> propertyIds = new ArrayList<Object>();
+ private ArrayList<Object> propertyIds = new ArrayList<>();
/**
* Property ID to type mapping.
*/
- private Hashtable<Object, Class<?>> types = new Hashtable<Object, Class<?>>();
+ private Hashtable<Object, Class<?>> types = new Hashtable<>();
/**
* Hash of Items, where each Item is implemented as a mapping from Property
* ID to Property value.
*/
- private Hashtable<Object, Map<Object, Object>> items = new Hashtable<Object, Map<Object, Object>>();
+ private Hashtable<Object, Map<Object, Object>> items = new Hashtable<>();
/**
* Set of properties that are read-only.
*/
- private HashSet<Property<?>> readOnlyProperties = new HashSet<Property<?>>();
+ private HashSet<Property<?>> readOnlyProperties = new HashSet<>();
/**
* List of all Property value change event listeners listening all the
}
// store for next rows
if (defaultPropertyValues == null) {
- defaultPropertyValues = new HashMap<Object, Object>();
+ defaultPropertyValues = new HashMap<>();
}
defaultPropertyValues.put(propertyId, defaultValue);
}
@Override
protected void registerNewItem(int index, Object newItemId, Item item) {
- Hashtable<Object, Object> t = new Hashtable<Object, Object>();
+ Hashtable<Object, Object> t = new Hashtable<>();
items.put(newItemId, t);
addDefaultValues(t);
}
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public static class ItemSetChangeEvent extends BaseItemSetChangeEvent {
private final int addedItemIndex;
@Override
public void addValueChangeListener(Property.ValueChangeListener listener) {
if (propertyValueChangeListeners == null) {
- propertyValueChangeListeners = new LinkedList<Property.ValueChangeListener>();
+ propertyValueChangeListeners = new LinkedList<>();
}
propertyValueChangeListeners.add(listener);
}
Object itemId, Property.ValueChangeListener listener) {
if (listener != null) {
if (singlePropertyValueChangeListeners == null) {
- singlePropertyValueChangeListeners = new Hashtable<Object, Map<Object, List<Property.ValueChangeListener>>>();
+ singlePropertyValueChangeListeners = new Hashtable<>();
}
Map<Object, List<Property.ValueChangeListener>> propertySetToListenerListMap = singlePropertyValueChangeListeners
.get(propertyId);
if (propertySetToListenerListMap == null) {
- propertySetToListenerListMap = new Hashtable<Object, List<Property.ValueChangeListener>>();
+ propertySetToListenerListMap = new Hashtable<>();
singlePropertyValueChangeListeners.put(propertyId,
propertySetToListenerListMap);
}
List<Property.ValueChangeListener> listenerList = propertySetToListenerListMap
.get(itemId);
if (listenerList == null) {
- listenerList = new LinkedList<Property.ValueChangeListener>();
+ listenerList = new LinkedList<>();
propertySetToListenerListMap.put(itemId, listenerList);
}
listenerList.add(listener);
*
* @since 3.0
*/
+ @Deprecated
class IndexedContainerItem implements Item {
/**
? (ListSet<Object>) ((ListSet<Object>) getAllItemIds()).clone()
: null);
nc.setItemSetChangeListeners(getItemSetChangeListeners() != null
- ? new LinkedList<Container.ItemSetChangeListener>(
- getItemSetChangeListeners())
- : null);
+ ? new LinkedList<>(getItemSetChangeListeners()) : null);
nc.propertyIds = propertyIds != null
? (ArrayList<Object>) propertyIds.clone() : null;
nc.setPropertySetChangeListeners(getPropertySetChangeListeners() != null
- ? new LinkedList<Container.PropertySetChangeListener>(
- getPropertySetChangeListeners())
- : null);
+ ? new LinkedList<>(getPropertySetChangeListeners()) : null);
nc.propertyValueChangeListeners = propertyValueChangeListeners != null
? (LinkedList<Property.ValueChangeListener>) propertyValueChangeListeners
.clone()
if (items == null) {
nc.items = null;
} else {
- nc.items = new Hashtable<Object, Map<Object, Object>>();
+ nc.items = new Hashtable<>();
for (final Iterator<?> i = items.keySet().iterator(); i
.hasNext();) {
final Object id = i.next();
* The <code>ItemSorter</code> interface can be used in <code>Sortable</code>
* implementations to provide a custom sorting method.
*/
+@Deprecated
public interface ItemSorter
extends Comparator<Object>, Cloneable, Serializable {
*
* This class is subject to change and should not be used outside Vaadin core.
*/
+@Deprecated
public class ListSet<E> extends ArrayList<E> {
private HashSet<E> itemSet = null;
* Contains a map from an element to the number of duplicates it has. Used
* to temporarily allow duplicates in the list.
*/
- private HashMap<E, Integer> duplicates = new HashMap<E, Integer>();
+ private HashMap<E, Integer> duplicates = new HashMap<>();
public ListSet() {
super();
- itemSet = new HashSet<E>();
+ itemSet = new HashSet<>();
}
public ListSet(Collection<? extends E> c) {
super(c);
- itemSet = new HashSet<E>(c.size());
+ itemSet = new HashSet<>(c.size());
itemSet.addAll(c);
}
public ListSet(int initialCapacity) {
super(initialCapacity);
- itemSet = new HashSet<E>(initialCapacity);
+ itemSet = new HashSet<>(initialCapacity);
}
// Delegate contains operations to the set
@Override
protected void removeRange(int fromIndex, int toIndex) {
- HashSet<E> toRemove = new HashSet<E>();
+ HashSet<E> toRemove = new HashSet<>();
for (int idx = fromIndex; idx < toIndex; idx++) {
toRemove.add(get(idx));
}
@Override
public Object clone() {
ListSet<E> v = (ListSet<E>) super.clone();
- v.itemSet = new HashSet<E>(itemSet);
+ v.itemSet = new HashSet<>(itemSet);
return v;
}
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class MethodProperty<T> extends AbstractProperty<T> {
* @since 3.0
*/
@SuppressWarnings("rawtypes")
+ @Deprecated
// Exceptions cannot be parameterized, ever.
public static class MethodException extends RuntimeException {
*
* @since 6.6
*/
+@Deprecated
public class MethodPropertyDescriptor<BT>
implements VaadinPropertyDescriptor<BT> {
*
* @since 6.6
*/
+@Deprecated
public class NestedMethodProperty<T> extends AbstractProperty<T> {
// needed for de-serialization
private void initialize(Class<?> beanClass, String propertyName)
throws IllegalArgumentException {
- List<Method> getMethods = new ArrayList<Method>();
+ List<Method> getMethods = new ArrayList<>();
String lastSimplePropertyName = propertyName;
Class<?> lastClass = beanClass;
*
* @since 6.6
*/
+@Deprecated
public class NestedPropertyDescriptor<BT>
implements VaadinPropertyDescriptor<BT> {
public NestedPropertyDescriptor(String name, Class<BT> beanType)
throws IllegalArgumentException {
this.name = name;
- NestedMethodProperty<?> property = new NestedMethodProperty<Object>(
+ NestedMethodProperty<?> property = new NestedMethodProperty<>(
beanType, name);
this.propertyType = property.getType();
}
@Override
public Property<?> createProperty(BT bean) {
- return new NestedMethodProperty<Object>(bean, name);
+ return new NestedMethodProperty<>(bean, name);
}
}
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class ObjectProperty<T> extends AbstractProperty<T> {
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public abstract class PropertyValueGenerator<T> implements Serializable {
/**
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings("serial")
public class PropertysetItem
implements Item, Item.PropertySetChangeNotifier, Cloneable {
/**
* Mapping from property id to property.
*/
- private HashMap<Object, Property<?>> map = new HashMap<Object, Property<?>>();
+ private HashMap<Object, Property<?>> map = new HashMap<>();
/**
* List of all property ids to maintain the order.
*/
- private LinkedList<Object> list = new LinkedList<Object>();
+ private LinkedList<Object> list = new LinkedList<>();
/**
* List of property set modification listeners.
public void addPropertySetChangeListener(
Item.PropertySetChangeListener listener) {
if (propertySetChangeListeners == null) {
- propertySetChangeListeners = new LinkedList<PropertySetChangeListener>();
+ propertySetChangeListeners = new LinkedList<>();
}
propertySetChangeListeners.add(listener);
}
* are supported but only fire when setReadOnly(boolean) is explicitly called.
*
*/
+@Deprecated
@SuppressWarnings("serial")
public class TextFileProperty extends AbstractProperty<String> {
*
* @param <T>
*/
+@Deprecated
public class TransactionalPropertyWrapper<T> extends AbstractProperty<T>
implements ValueChangeNotifier, Property.Transactional<T> {
*
* @since 6.6
*/
+@Deprecated
public interface VaadinPropertyDescriptor<BT> extends Serializable {
/**
* Returns the name of the property.
* @author Vaadin Ltd
* @since 7.1
*/
+@Deprecated
public abstract class AbstractStringToNumberConverter<T>
implements Converter<String, T> {
* @author Vaadin Ltd
* @since 7.0
*/
+ @Deprecated
public static class ConversionException extends RuntimeException {
/**
import com.vaadin.server.VaadinSession;
+@Deprecated
public class ConverterUtil implements Serializable {
/**
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class DateToLongConverter implements Converter<Date, Long> {
/*
* @since 7.1
* @author Vaadin Ltd
*/
+@Deprecated
public class DateToSqlDateConverter implements Converter<Date, java.sql.Date> {
@Override
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class DefaultConverterFactory implements ConverterFactory {
private final static Logger log = Logger
if (reverseConverter != null) {
log.finest(getClass().getName() + " created a reverse "
+ reverseConverter.getClass());
- return new ReverseConverter<PRESENTATION, MODEL>(reverseConverter);
+ return new ReverseConverter<>(reverseConverter);
}
log.finest(getClass().getName() + " could not find a converter for "
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class ReverseConverter<PRESENTATION, MODEL>
implements Converter<PRESENTATION, MODEL> {
* @author Vaadin Ltd
* @since 7.2
*/
+@Deprecated
public class StringToBigDecimalConverter
extends AbstractStringToNumberConverter<BigDecimal> {
@Override
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public class StringToBigIntegerConverter
extends AbstractStringToNumberConverter<BigInteger> {
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class StringToBooleanConverter implements Converter<String, Boolean> {
private final String trueString;
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public class StringToByteConverter
extends AbstractStringToNumberConverter<Byte> {
*
* @author Vaadin Ltd
*/
+@Deprecated
public class StringToCollectionConverter
implements Converter<String, Collection> {
*
* @author Vaadin Ltd
*/
+ @Deprecated
public static class DefaultCollectionFactory implements CollectionFactory {
@Override
*
* @author Vaadin Ltd
*/
+ @Deprecated
public interface CollectionFactory extends Serializable {
/**
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class StringToDateConverter implements Converter<String, Date> {
/**
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class StringToDoubleConverter
extends AbstractStringToNumberConverter<Double> {
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public class StringToEnumConverter implements Converter<String, Enum> {
@Override
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class StringToFloatConverter
extends AbstractStringToNumberConverter<Float> {
* @author Vaadin Ltd
* @since 7.0
*/
+@Deprecated
public class StringToIntegerConverter
extends AbstractStringToNumberConverter<Integer> {
* @author Vaadin Ltd
* @since 7.2
*/
+@Deprecated
public class StringToLongConverter
extends AbstractStringToNumberConverter<Long> {
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public class StringToShortConverter
extends AbstractStringToNumberConverter<Short> {
*
* @since 6.6
*/
+@Deprecated
public abstract class AbstractJunctionFilter implements Filter {
protected final Collection<Filter> filters;
*
* @since 6.6
*/
+@Deprecated
public final class And extends AbstractJunctionFilter {
/**
import com.vaadin.v7.data.Container.Filter;
import com.vaadin.v7.data.Item;
+@Deprecated
public class Between implements Filter {
private final Object propertyId;
*
* @since 6.6
*/
+@Deprecated
public abstract class Compare implements Filter {
+ @Deprecated
public enum Operation {
EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL
}
*
* @since 6.6
*/
+ @Deprecated
public static final class Equal extends Compare {
/**
* Construct a filter that accepts items for which the identified
*
* @since 6.6
*/
+ @Deprecated
public static final class Greater extends Compare {
/**
* Construct a filter that accepts items for which the identified
*
* @since 6.6
*/
+ @Deprecated
public static final class Less extends Compare {
/**
* Construct a filter that accepts items for which the identified
*
* @since 6.6
*/
+ @Deprecated
public static final class GreaterOrEqual extends Compare {
/**
* Construct a filter that accepts items for which the identified
*
* @since 6.6
*/
+ @Deprecated
public static final class LessOrEqual extends Compare {
/**
* Construct a filter that accepts items for which the identified
*
* @since 6.6
*/
+@Deprecated
public final class IsNull implements Filter {
private final Object propertyId;
import com.vaadin.v7.data.Container.Filter;
import com.vaadin.v7.data.Item;
+@Deprecated
public class Like implements Filter {
private final Object propertyId;
private final String value;
*
* @since 6.6
*/
+@Deprecated
public final class Not implements Filter {
private final Filter filter;
*
* @since 6.6
*/
+@Deprecated
public final class Or extends AbstractJunctionFilter {
/**
*
* @since 6.6
*/
+@Deprecated
public final class SimpleStringFilter implements Filter {
final Object propertyId;
*
* @since 6.6
*/
+@Deprecated
public class UnsupportedFilterException extends RuntimeException
implements Serializable {
public UnsupportedFilterException() {
* CacheFlushNotifier is a simple static notification mechanism to inform other
* SQLContainers that the contents of their caches may have become stale.
*/
+@Deprecated
class CacheFlushNotifier implements Serializable {
/*
* SQLContainer instance reference list and dead reference queue. Used for
* the cache flush notification feature.
*/
- private static List<WeakReference<SQLContainer>> allInstances = new ArrayList<WeakReference<SQLContainer>>();
- private static ReferenceQueue<SQLContainer> deadInstances = new ReferenceQueue<SQLContainer>();
+ private static List<WeakReference<SQLContainer>> allInstances = new ArrayList<>();
+ private static ReferenceQueue<SQLContainer> deadInstances = new ReferenceQueue<>();
/**
* Adds the given SQLContainer to the cache flush notification receiver list
public static void addInstance(SQLContainer c) {
removeDeadReferences();
if (c != null) {
- allInstances.add(new WeakReference<SQLContainer>(c, deadInstances));
+ allInstances.add(new WeakReference<>(c, deadInstances));
}
}
* number of items. In SQLContainer this is used for RowItem -cache. Cache size
* will be two times the page length parameter of the container.
*/
+@Deprecated
class CacheMap<K, V> extends LinkedHashMap<K, V> {
private static final long serialVersionUID = 679999766473555231L;
private int cacheLimit = SQLContainer.CACHE_RATIO
* Note that depending on the QueryDelegate in use this does not necessarily map
* into an actual column in a database table.
*/
+@Deprecated
final public class ColumnProperty implements Property {
private static final long serialVersionUID = -3694463129581802457L;
* be set to <code>null</code>.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class NotNullableException extends RuntimeException {
/**
*
* @author Jonatan Kronqvist / Vaadin Ltd
*/
+@Deprecated
public class OptimisticLockException extends RuntimeException {
private final RowId rowId;
*/
package com.vaadin.v7.data.util.sqlcontainer;
+@Deprecated
public class ReadOnlyRowId extends RowId {
private static final long serialVersionUID = -2626764781642012467L;
private final Integer rowNum;
* required, but it is recommended to make sure that certain constraints are
* followed.
*/
+@Deprecated
@SuppressWarnings("serial")
class Reference implements Serializable {
* the primary key columns of the identified row. This allows easy equals()
* -comparison of RowItems.
*/
+@Deprecated
public class RowId implements Serializable {
private static final long serialVersionUID = -3161778404698901258L;
protected Object[] id;
* Note that depending on the QueryDelegate in use this does not necessarily map
* into an actual row in a database table.
*/
+@Deprecated
public final class RowItem implements Item {
private static final long serialVersionUID = -6228966439127951408L;
private SQLContainer container;
@Override
public Collection<?> getItemPropertyIds() {
- Collection<String> ids = new ArrayList<String>(properties.size());
+ Collection<String> ids = new ArrayList<>(properties.size());
for (ColumnProperty cp : properties) {
ids.add(cp.getPropertyId());
}
import com.vaadin.v7.data.util.sqlcontainer.query.generator.MSSQLGenerator;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.OracleGenerator;
+@Deprecated
public class SQLContainer implements Container, Container.Filterable,
Container.Indexed, Container.Sortable, Container.ItemSetChangeNotifier {
private int cacheOverlap = pageLength;
/** Item and index caches */
- private final Map<Integer, RowId> itemIndexes = new HashMap<Integer, RowId>();
- private final CacheMap<RowId, RowItem> cachedItems = new CacheMap<RowId, RowItem>();
+ private final Map<Integer, RowId> itemIndexes = new HashMap<>();
+ private final CacheMap<RowId, RowItem> cachedItems = new CacheMap<>();
/** Container properties = column names, data types and statuses */
- private final List<String> propertyIds = new ArrayList<String>();
- private final Map<String, Class<?>> propertyTypes = new HashMap<String, Class<?>>();
- private final Map<String, Boolean> propertyReadOnly = new HashMap<String, Boolean>();
- private final Map<String, Boolean> propertyPersistable = new HashMap<String, Boolean>();
- private final Map<String, Boolean> propertyNullable = new HashMap<String, Boolean>();
- private final Map<String, Boolean> propertyPrimaryKey = new HashMap<String, Boolean>();
+ private final List<String> propertyIds = new ArrayList<>();
+ private final Map<String, Class<?>> propertyTypes = new HashMap<>();
+ private final Map<String, Boolean> propertyReadOnly = new HashMap<>();
+ private final Map<String, Boolean> propertyPersistable = new HashMap<>();
+ private final Map<String, Boolean> propertyNullable = new HashMap<>();
+ private final Map<String, Boolean> propertyPrimaryKey = new HashMap<>();
/** Filters (WHERE) and sorters (ORDER BY) */
- private final List<Filter> filters = new ArrayList<Filter>();
- private final List<OrderBy> sorters = new ArrayList<OrderBy>();
+ private final List<Filter> filters = new ArrayList<>();
+ private final List<OrderBy> sorters = new ArrayList<>();
/**
* Total number of items available in the data source using the current
/**
* Temporary storage for modified items and items to be removed and added
*/
- private final Map<RowId, RowItem> removedItems = new HashMap<RowId, RowItem>();
- private final List<RowItem> addedItems = new ArrayList<RowItem>();
- private final List<RowItem> modifiedItems = new ArrayList<RowItem>();
+ private final Map<RowId, RowItem> removedItems = new HashMap<>();
+ private final List<RowItem> addedItems = new ArrayList<>();
+ private final List<RowItem> modifiedItems = new ArrayList<>();
/** List of references to other SQLContainers */
- private final Map<SQLContainer, Reference> references = new HashMap<SQLContainer, Reference>();
+ private final Map<SQLContainer, Reference> references = new HashMap<>();
/** Cache flush notification system enabled. Disabled by default. */
private boolean notificationsEnabled;
.size()];
RowId itemId = new TemporaryRowId(emptyKey);
// Create new empty column properties for the row item.
- List<ColumnProperty> itemProperties = new ArrayList<ColumnProperty>();
+ List<ColumnProperty> itemProperties = new ArrayList<>();
for (String propertyId : propertyIds) {
/* Default settings for new item properties. */
ColumnProperty cp = new ColumnProperty(propertyId,
@Override
public Collection<?> getItemIds() {
updateCount();
- ArrayList<RowId> ids = new ArrayList<RowId>();
+ ArrayList<RowId> ids = new ArrayList<>();
ResultSet rs = null;
try {
// Load ALL rows :(
* {@inheritDoc}
*/
public void removeContainerFilters(Object propertyId) {
- ArrayList<Filter> toRemove = new ArrayList<Filter>();
+ ArrayList<Filter> toRemove = new ArrayList<>();
for (Filter f : filters) {
if (f.appliesToProperty(propertyId)) {
toRemove.add(f);
setPageLengthInternal(size);
}
while (rs.next()) {
- List<ColumnProperty> itemProperties = new ArrayList<ColumnProperty>();
+ List<ColumnProperty> itemProperties = new ArrayList<>();
/* Generate row itemId based on primary key(s) */
Object[] itemId = new Object[pKeys.size()];
for (int i = 0; i < pKeys.size(); i++) {
} else {
id = new RowId(itemId);
}
- List<String> propertiesToAdd = new ArrayList<String>(
+ List<String> propertiesToAdd = new ArrayList<>(
propertyIds);
if (!removedItems.containsKey(id)) {
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
}
private List<RowItem> getFilteredAddedItems() {
- ArrayList<RowItem> filtered = new ArrayList<RowItem>(addedItems);
+ ArrayList<RowItem> filtered = new ArrayList<>(addedItems);
if (filters != null && !filters.isEmpty()) {
for (RowItem item : addedItems) {
if (!itemPassesFilters(item)) {
public void addItemSetChangeListener(
Container.ItemSetChangeListener listener) {
if (itemSetChangeListeners == null) {
- itemSetChangeListeners = new LinkedList<Container.ItemSetChangeListener>();
+ itemSetChangeListeners = new LinkedList<>();
}
itemSetChangeListeners.add(listener);
}
* Simple ItemSetChangeEvent implementation.
*/
@SuppressWarnings("serial")
+ @Deprecated
public static class ItemSetChangeEvent extends EventObject
implements Container.ItemSetChangeEvent {
import java.io.Serializable;
+@Deprecated
public class SQLUtil implements Serializable {
/**
* Escapes different special characters in strings that are passed to SQL.
*/
package com.vaadin.v7.data.util.sqlcontainer;
+@Deprecated
public class TemporaryRowId extends RowId {
private static final long serialVersionUID = -641983830469018329L;
import javax.naming.NamingException;
import javax.sql.DataSource;
+@Deprecated
public class J2EEConnectionPool implements JDBCConnectionPool {
private String dataSourceJndiName;
/**
* Interface for implementing connection pools to be used with SQLContainer.
*/
+@Deprecated
public interface JDBCConnectionPool extends Serializable {
/**
* Retrieves a connection.
* usable upon release.
*/
@SuppressWarnings("serial")
+@Deprecated
public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
private int initialConnections = 5;
}
private void initializeConnections() throws SQLException {
- availableConnections = new HashSet<Connection>(initialConnections);
- reservedConnections = new HashSet<Connection>(initialConnections);
+ availableConnections = new HashSet<>(initialConnections);
+ reservedConnections = new HashSet<>(initialConnections);
for (int i = 0; i < initialConnections; i++) {
availableConnections.add(createConnection());
}
* @author Vaadin Ltd
* @since 6.8.9
*/
+@Deprecated
public abstract class AbstractTransactionalQuery implements Serializable {
private JDBCConnectionPool connectionPool;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.filter.QueryBuilder;
@SuppressWarnings("serial")
+@Deprecated
public class FreeformQuery extends AbstractTransactionalQuery
implements QueryDelegate {
JDBCConnectionPool connectionPool) {
super(connectionPool);
if (primaryKeyColumns == null) {
- primaryKeyColumns = new ArrayList<String>();
+ primaryKeyColumns = new ArrayList<>();
}
if (primaryKeyColumns.contains("")) {
throw new IllegalArgumentException(
import com.vaadin.v7.data.Container.Filter;
import com.vaadin.v7.data.util.sqlcontainer.RowItem;
+@Deprecated
public interface FreeformQueryDelegate extends Serializable {
/**
* Should return the SQL query string to be performed. This method is
* is advisable to implement this interface instead of the FreeformQueryDelegate
* whenever possible.
*/
+@Deprecated
public interface FreeformStatementDelegate extends FreeformQueryDelegate {
/**
* Should return a new instance of StatementHelper that contains the query
* The sorting rule is simple and contains only the affected column's name and
* the direction of the sort.
*/
+@Deprecated
public class OrderBy implements Serializable {
private String column;
private boolean isAscending;
import com.vaadin.v7.data.util.sqlcontainer.RowId;
import com.vaadin.v7.data.util.sqlcontainer.RowItem;
+@Deprecated
public interface QueryDelegate extends Serializable {
/**
* Generates and executes a query to determine the current row count from
* An <code>Event</code> object specifying the old and new RowId of an added
* item after the addition has been successfully committed.
*/
+ @Deprecated
public interface RowIdChangeEvent extends Serializable {
/**
* Gets the old (temporary) RowId of the added row that raised this
}
/** RowId change listener interface. */
+ @Deprecated
public interface RowIdChangeListener extends Serializable {
/**
* Lets the listener know that a RowId has been changed.
* that it will generate a <code>RowIdChangeEvent</code> when it performs a
* database commit that may change the RowId.
*/
+ @Deprecated
public interface RowIdChangeNotifier extends Serializable {
/**
* Adds a RowIdChangeListener for the object.
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
@SuppressWarnings("serial")
+@Deprecated
public class TableQuery extends AbstractTransactionalQuery
implements QueryDelegate, QueryDelegate.RowIdChangeNotifier {
/** Row ID change listeners */
private LinkedList<RowIdChangeListener> rowIdChangeListeners;
/** Row ID change events, stored until commit() is called */
- private final List<RowIdChangeEvent> bufferedEvents = new ArrayList<RowIdChangeEvent>();
+ private final List<RowIdChangeEvent> bufferedEvents = new ArrayList<>();
/** Set to true to output generated SQL Queries to System.out */
private final boolean debug = false;
* first primary key column.
*/
if (orderBys == null || orderBys.isEmpty()) {
- List<OrderBy> ob = new ArrayList<OrderBy>();
+ List<OrderBy> ob = new ArrayList<>();
for (int i = 0; i < primaryKeyColumns.size(); i++) {
ob.add(new OrderBy(primaryKeyColumns.get(i), true));
}
}
tables.close();
rs = dbmd.getPrimaryKeys(catalogName, schemaName, tableName);
- List<String> names = new ArrayList<String>();
+ List<String> names = new ArrayList<>();
while (rs.next()) {
names.add(rs.getString("COLUMN_NAME"));
}
private RowId getNewRowId(RowItem row, ResultSet genKeys) {
try {
/* Fetch primary key values and generate a map out of them. */
- Map<String, Object> values = new HashMap<String, Object>();
+ Map<String, Object> values = new HashMap<>();
ResultSetMetaData rsmd = genKeys.getMetaData();
int colCount = rsmd.getColumnCount();
if (genKeys.next()) {
}
}
/* Generate new RowId */
- List<Object> newRowId = new ArrayList<Object>();
+ List<Object> newRowId = new ArrayList<>();
if (values.size() == 1) {
if (primaryKeyColumns.size() == 1) {
newRowId.add(values.get(values.keySet().iterator().next()));
*/
@Override
public boolean containsRowWithKey(Object... keys) throws SQLException {
- ArrayList<Filter> filtersAndKeys = new ArrayList<Filter>();
+ ArrayList<Filter> filtersAndKeys = new ArrayList<>();
if (filters != null) {
filtersAndKeys.addAll(filters);
}
/**
* Simple RowIdChangeEvent implementation.
*/
+ @Deprecated
public static class RowIdChangeEvent extends EventObject
implements QueryDelegate.RowIdChangeEvent {
private final RowId oldId;
@Override
public void addRowIdChangeListener(RowIdChangeListener listener) {
if (rowIdChangeListeners == null) {
- rowIdChangeListeners = new LinkedList<QueryDelegate.RowIdChangeListener>();
+ rowIdChangeListeners = new LinkedList<>();
}
rowIdChangeListeners.add(listener);
}
* @author Jonatan Kronqvist / Vaadin Ltd
*/
@SuppressWarnings("serial")
+@Deprecated
public class DefaultSQLGenerator implements SQLGenerator {
private Class<? extends StatementHelper> statementHelperClass = null;
}
protected Map<String, Object> generateColumnToValueMap(RowItem item) {
- Map<String, Object> columnToValueMap = new HashMap<String, Object>();
+ Map<String, Object> columnToValueMap = new HashMap<>();
for (Object id : item.getItemPropertyIds()) {
ColumnProperty cp = (ColumnProperty) item.getItemProperty(id);
/* Prevent "rownum" usage as a column name if MSSQL or ORACLE */
}
protected Map<String, Object> generateRowIdentifiers(RowItem item) {
- Map<String, Object> rowIdentifiers = new HashMap<String, Object>();
+ Map<String, Object> rowIdentifiers = new HashMap<>();
for (Object id : item.getItemPropertyIds()) {
ColumnProperty cp = (ColumnProperty) item.getItemProperty(id);
/* Prevent "rownum" usage as a column name if MSSQL or ORACLE */
import com.vaadin.v7.data.util.sqlcontainer.query.generator.filter.QueryBuilder;
@SuppressWarnings("serial")
+@Deprecated
public class MSSQLGenerator extends DefaultSQLGenerator {
public MSSQLGenerator() {
import com.vaadin.v7.data.util.sqlcontainer.query.generator.filter.QueryBuilder;
@SuppressWarnings("serial")
+@Deprecated
public class OracleGenerator extends DefaultSQLGenerator {
public OracleGenerator() {
*
* @author Jonatan Kronqvist / Vaadin Ltd
*/
+@Deprecated
public interface SQLGenerator extends Serializable {
/**
* Generates a SELECT query with the provided parameters. Uses default
* This class will also fill the values with correct setters into the
* PreparedStatement on request.
*/
+@Deprecated
public class StatementHelper implements Serializable {
private String queryString;
- private List<Object> parameters = new ArrayList<Object>();
- private Map<Integer, Class<?>> dataTypes = new HashMap<Integer, Class<?>>();
+ private List<Object> parameters = new ArrayList<>();
+ private Map<Integer, Class<?>> dataTypes = new HashMap<>();
public StatementHelper() {
}
import com.vaadin.v7.data.util.filter.And;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class AndTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.util.filter.Between;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class BetweenTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.util.filter.Compare;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class CompareTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.Container.Filter;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public interface FilterTranslator extends Serializable {
public boolean translatesFilter(Filter filter);
import com.vaadin.v7.data.util.filter.IsNull;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class IsNullTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.util.filter.Like;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class LikeTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.util.filter.Not;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class NotTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.util.filter.Or;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class OrTranslator implements FilterTranslator {
@Override
import com.vaadin.v7.data.Container.Filter;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class QueryBuilder implements Serializable {
- private static ArrayList<FilterTranslator> filterTranslators = new ArrayList<FilterTranslator>();
+ private static ArrayList<FilterTranslator> filterTranslators = new ArrayList<>();
private static StringDecorator stringDecorator = new StringDecorator("\"",
"\"");
import com.vaadin.v7.data.util.filter.SimpleStringFilter;
import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper;
+@Deprecated
public class SimpleStringTranslator implements FilterTranslator {
@Override
*
* @author Vaadin Ltd
*/
+@Deprecated
public class StringDecorator implements Serializable {
private final String quoteStart;
* @since 5.4
*/
@SuppressWarnings("serial")
+@Deprecated
public abstract class AbstractStringValidator
extends AbstractValidator<String> {
* @author Vaadin Ltd.
* @since 5.4
*/
+@Deprecated
public abstract class AbstractValidator<T> implements Validator {
/**
* @author Petri Hakala
* @author Henri Sara
*/
+@Deprecated
public class BeanValidator implements Validator {
private static final long serialVersionUID = 1L;
* Simple implementation of a message interpolator context that returns
* fixed values.
*/
+ @Deprecated
protected static class SimpleContext implements Context, Serializable {
private final Object value;
* @since 7.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class BigDecimalRangeValidator extends RangeValidator<BigDecimal> {
/**
* @since 7.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class BigIntegerRangeValidator extends RangeValidator<BigInteger> {
/**
* @since 7.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class ByteRangeValidator extends RangeValidator<Byte> {
/**
* @since 3.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class CompositeValidator implements Validator {
+ @Deprecated
public enum CombinationMode {
/**
* The validators are combined with <code>AND</code> clause: validity of
/**
* List of contained validators.
*/
- private final List<Validator> validators = new LinkedList<Validator>();
+ private final List<Validator> validators = new LinkedList<>();
/**
* Construct a composite validator in <code>AND</code> mode without error
return null;
}
- final HashSet<Validator> found = new HashSet<Validator>();
+ final HashSet<Validator> found = new HashSet<>();
for (Validator v : validators) {
if (validatorType.isAssignableFrom(v.getClass())) {
found.add(v);
* @author Vaadin Ltd.
* @since 7.0
*/
+@Deprecated
public class DateRangeValidator extends RangeValidator<Date> {
/**
* @since 7.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class DoubleRangeValidator extends RangeValidator<Double> {
/**
* field instead or bind the field to a {@link Property} of type
* {@link Double}.
*/
-@Deprecated
@SuppressWarnings("serial")
+@Deprecated
public class DoubleValidator extends AbstractStringValidator {
/**
* @since 5.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class EmailValidator extends RegexpValidator {
/**
* @since 7.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class FloatRangeValidator extends RangeValidator<Float> {
/**
* @since 5.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class IntegerRangeValidator extends RangeValidator<Integer> {
/**
* @since 7.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class LongRangeValidator extends RangeValidator<Long> {
/**
* @since 3.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class NullValidator implements Validator {
private boolean onlyNullAllowed;
* @author Vaadin Ltd.
* @since 7.0
*/
+@Deprecated
public class RangeValidator<T extends Comparable> extends AbstractValidator<T> {
private T minValue = null;
* @since 5.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class RegexpValidator extends AbstractStringValidator {
private Pattern pattern;
* @since 7.4
*/
@SuppressWarnings("serial")
+@Deprecated
public class ShortRangeValidator extends RangeValidator<Short> {
/**
* @since 3.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class StringLengthValidator extends AbstractStringValidator {
private Integer minLength = null;
*
* @since 6.3
*/
+@Deprecated
public abstract class DataBoundTransferable extends TransferableImpl {
public DataBoundTransferable(Component sourceComponent,
/**
* Interface that serves as a wrapper for {@link Field} related events.
*/
+@Deprecated
public interface FieldEvents {
/**
* @see TextField#setTextChangeEventMode(com.vaadin.ui.TextField.TextChangeEventMode)
* @since 6.5
*/
+ @Deprecated
public static abstract class TextChangeEvent extends Component.Event {
public TextChangeEvent(Component source) {
*
* @since 6.5
*/
+ @Deprecated
public interface TextChangeListener extends ConnectorEventListener {
public static String EVENT_ID = "ie";
* {@link TextChangeEvent}s. An example a {@link TextField} supports
* {@link TextChangeListener}s.
*/
+ @Deprecated
public interface TextChangeNotifier extends Serializable {
public void addTextChangeListener(TextChangeListener listener);
*
*/
@SuppressWarnings("serial")
+@Deprecated
public class ItemClickEvent extends ClickEvent implements Serializable {
private Item item;
private Object itemId;
}
}
+ @Deprecated
public interface ItemClickListener extends Serializable {
public void itemClick(ItemClickEvent event);
}
* @see ItemClickListener
* @see ItemClickEvent
*/
+ @Deprecated
public interface ItemClickNotifier extends Serializable {
/**
* Register a listener to handle {@link ItemClickEvent}s.
* @since 7.6
* @author Vaadin Ltd
*/
+@Deprecated
public interface DataGenerator extends Serializable {
/**
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class RpcDataProviderExtension extends AbstractExtension {
/**
*/
private class ActiveItemHandler implements Serializable, DataGenerator {
- private final Map<Object, GridValueChangeListener> activeItemMap = new HashMap<Object, GridValueChangeListener>();
- private final KeyMapper<Object> keyMapper = new KeyMapper<Object>();
- private final Set<Object> droppedItems = new HashSet<Object>();
+ private final Map<Object, GridValueChangeListener> activeItemMap = new HashMap<>();
+ private final KeyMapper<Object> keyMapper = new KeyMapper<>();
+ private final Set<Object> droppedItems = new HashSet<>();
/**
* Registers ValueChangeListeners for given item ids.
* @return collection of item ids
*/
public Collection<Object> getActiveItemIds() {
- return new HashSet<Object>(activeItemMap.keySet());
+ return new HashSet<>(activeItemMap.keySet());
}
/**
* @return collection of value change listeners
*/
public Collection<GridValueChangeListener> getValueChangeListeners() {
- return new HashSet<GridValueChangeListener>(activeItemMap.values());
+ return new HashSet<>(activeItemMap.values());
}
@Override
else {
// Remove obsolete value change listeners.
- Set<Object> keySet = new HashSet<Object>(
+ Set<Object> keySet = new HashSet<>(
activeItemHandler.activeItemMap.keySet());
for (Object itemId : keySet) {
activeItemHandler.removeListener(itemId);
/** Size possibly changed with a bare ItemSetChangeEvent */
private boolean bareItemSetTriggeredSizeChange = false;
- private final Set<DataGenerator> dataGenerators = new LinkedHashSet<DataGenerator>();
+ private final Set<DataGenerator> dataGenerators = new LinkedHashSet<>();
private final ActiveItemHandler activeItemHandler = new ActiveItemHandler();
* @param container
* the container to make available
*/
+ @Deprecated
public RpcDataProviderExtension(Indexed container) {
this.container = container;
rpc = getRpcProxy(DataProviderRpc.class);
*/
private void insertRowData(final int index, final int count) {
if (rowChanges == null) {
- rowChanges = new ArrayList<Runnable>();
+ rowChanges = new ArrayList<>();
}
if (rowChanges.isEmpty()) {
*/
private void removeRowData(final int index, final int count) {
if (rowChanges == null) {
- rowChanges = new ArrayList<Runnable>();
+ rowChanges = new ArrayList<>();
}
if (rowChanges.isEmpty()) {
*/
public void updateRowData(Object itemId) {
if (updatedItemIds == null) {
- updatedItemIds = new LinkedHashSet<Object>();
+ updatedItemIds = new LinkedHashSet<>();
}
if (updatedItemIds.isEmpty()) {
import com.vaadin.v7.data.Validator.InvalidValueException;
import com.vaadin.v7.data.util.converter.Converter;
import com.vaadin.v7.data.util.converter.Converter.ConversionException;
-import com.vaadin.v7.shared.AbstractFieldState;
import com.vaadin.v7.data.util.converter.ConverterUtil;
+import com.vaadin.v7.shared.AbstractFieldState;
/**
* <p>
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public static class ReadOnlyStatusChangeEvent extends Component.Event
implements Property.ReadOnlyStatusChangeEvent, Serializable {
* invoked.
*
*/
+ @Deprecated
public static class FocusShortcut extends ShortcutListener {
protected Focusable focusable;
* @since 5.0
*/
@SuppressWarnings("serial")
+@Deprecated
// TODO currently cannot specify type more precisely in case of multi-select
public abstract class AbstractSelect extends AbstractField<Object> implements
Container, Container.Viewer, Container.PropertySetChangeListener,
Container.PropertySetChangeNotifier, Container.ItemSetChangeNotifier,
Container.ItemSetChangeListener, LegacyComponent {
+ @Deprecated
public enum ItemCaptionMode {
/**
* Item caption mode: Item's ID converted to a String using
* caption. <code>FilteringMode.CONTAINS</code> (1) matches anywhere in the
* caption.
*/
+ @Deprecated
public interface Filtering extends Serializable {
/**
/**
* Keymapper used to map key values.
*/
- protected KeyMapper<Object> itemIdMapper = new KeyMapper<Object>();
+ protected KeyMapper<Object> itemIdMapper = new KeyMapper<>();
/**
* Item icons.
*/
- private final HashMap<Object, Resource> itemIcons = new HashMap<Object, Resource>();
+ private final HashMap<Object, Resource> itemIcons = new HashMap<>();
/**
* Item captions.
*/
- private final HashMap<Object, String> itemCaptions = new HashMap<Object, String>();
+ private final HashMap<Object, String> itemCaptions = new HashMap<>();
/**
* Item caption mode.
// TODO Optimize by adding repaintNotNeeded when applicable
// Converts the key-array to id-set
- final LinkedList<Object> acceptedSelections = new LinkedList<Object>();
+ final LinkedList<Object> acceptedSelections = new LinkedList<>();
for (int i = 0; i < clientSideSelectedKeys.length; i++) {
final Object id = itemIdMapper
.get(clientSideSelectedKeys[i]);
@SuppressWarnings("unchecked")
Set<Object> newsel = (Set<Object>) getValue();
if (newsel == null) {
- newsel = new LinkedHashSet<Object>();
+ newsel = new LinkedHashSet<>();
} else {
- newsel = new LinkedHashSet<Object>(newsel);
+ newsel = new LinkedHashSet<>(newsel);
}
newsel.removeAll(visibleNotSelected);
newsel.addAll(acceptedSelections);
return newItemHandler;
}
+ @Deprecated
public interface NewItemHandler extends Serializable {
void addNewItem(String newItemCaption);
}
* like database inserts.
*
*/
+ @Deprecated
public class DefaultNewItemHandler implements NewItemHandler {
@Override
public void addNewItem(String newItemCaption) {
// If the return value is not a set
if (retValue == null) {
- return new HashSet<Object>();
+ return new HashSet<>();
}
if (retValue instanceof Set) {
return Collections.unmodifiableSet((Set<?>) retValue);
} else if (retValue instanceof Collection) {
return new HashSet<Object>((Collection<?>) retValue);
} else {
- final Set<Object> s = new HashSet<Object>();
+ final Set<Object> s = new HashSet<>();
if (items.containsId(retValue)) {
s.add(retValue);
}
ConversionException, InvalidValueException {
if (isMultiSelect()) {
if (newFieldValue == null) {
- super.setValue(new LinkedHashSet<Object>(), repaintIsNotNeeded,
+ super.setValue(new LinkedHashSet<>(), repaintIsNotNeeded,
ignoreReadOnly);
} else if (Collection.class
.isAssignableFrom(newFieldValue.getClass())) {
if (isMultiSelect()) {
Collection<Object> valueAsCollection = (Collection<Object>) value;
- List<Object> newSelection = new ArrayList<Object>(
+ List<Object> newSelection = new ArrayList<>(
valueAsCollection.size());
for (Object subValue : valueAsCollection) {
if (containsId(subValue)) {
// Convert the value type
if (multiSelect) {
- final Set<Object> s = new HashSet<Object>();
+ final Set<Object> s = new HashSet<>();
if (oldValue != null) {
s.add(oldValue);
}
setValue(itemId);
} else if (!isSelected(itemId) && itemId != null
&& items.containsId(itemId)) {
- final Set<Object> s = new HashSet<Object>((Set<?>) getValue());
+ final Set<Object> s = new HashSet<>((Set<?>) getValue());
s.add(itemId);
setValue(s);
}
public void unselect(Object itemId) {
if (isSelected(itemId)) {
if (isMultiSelect()) {
- final Set<Object> s = new HashSet<Object>((Set<?>) getValue());
+ final Set<Object> s = new HashSet<>((Set<?>) getValue());
s.remove(itemId);
setValue(s);
} else {
public void addPropertySetChangeListener(
Container.PropertySetChangeListener listener) {
if (propertySetEventListeners == null) {
- propertySetEventListeners = new LinkedHashSet<Container.PropertySetChangeListener>();
+ propertySetEventListeners = new LinkedHashSet<>();
}
propertySetEventListeners.add(listener);
}
public void addItemSetChangeListener(
Container.ItemSetChangeListener listener) {
if (itemSetEventListeners == null) {
- itemSetEventListeners = new LinkedHashSet<Container.ItemSetChangeListener>();
+ itemSetEventListeners = new LinkedHashSet<>();
}
itemSetEventListeners.add(listener);
}
* NOTE: singleton, use getCaptionChangeListener().
*
*/
+ @Deprecated
protected class CaptionChangeListener implements
Item.PropertySetChangeListener, Property.ValueChangeListener {
// TODO clean this up - type is either Item.PropertySetChangeNotifier or
// Property.ValueChangeNotifier
- HashSet<Object> captionChangeNotifiers = new HashSet<Object>();
+ HashSet<Object> captionChangeNotifiers = new HashSet<>();
public void addNotifierForItem(Object itemId) {
switch (getItemCaptionMode()) {
*
* @since 6.3
*/
+ @Deprecated
public static class TargetItemIs extends AbstractItemSetCriterion {
/**
*/
private static abstract class AbstractItemSetCriterion
extends ClientSideCriterion {
- protected final Collection<Object> itemIds = new HashSet<Object>();
+ protected final Collection<Object> itemIds = new HashSet<>();
protected AbstractSelect select;
public AbstractItemSetCriterion(AbstractSelect select,
*
* @since 6.3
*/
+ @Deprecated
public static class AcceptItem extends AbstractItemSetCriterion {
/**
*
* @since 6.3
*/
+ @Deprecated
public class AbstractSelectTargetDetails extends TargetDetailsImpl {
/**
* This accept criterion is currently usable in Tree and Table
* implementations.
*/
+ @Deprecated
public static class VerticalLocationIs extends TargetDetailIs {
public static VerticalLocationIs TOP = new VerticalLocationIs(
VerticalDropLocation.TOP);
* or Table.setItemDescriptionGenerator to generate mouse over descriptions
* ("tooltips") for the rows and cells in Table or for the items in Tree.
*/
+ @Deprecated
public interface ItemDescriptionGenerator extends Serializable {
/**
}
protected void readItems(Element design, DesignContext context) {
- Set<String> selected = new HashSet<String>();
+ Set<String> selected = new HashSet<>();
for (Element child : design.children()) {
readItem(child, selected, context);
}
/**
* Different modes how the TextField can trigger {@link TextChangeEvent}s.
*/
+ @Deprecated
public enum TextChangeEventMode {
/**
return textChangeEventTimeout;
}
+ @Deprecated
public static class TextChangeEventImpl extends TextChangeEvent {
private String curText;
private int cursorPosition;
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class Calendar extends AbstractComponent
implements CalendarComponentEvents.NavigationNotifier,
CalendarComponentEvents.EventMoveNotifier,
/**
* Calendar can use either 12 hours clock or 24 hours clock.
*/
+ @Deprecated
public enum TimeFormat {
Format12H(), Format24H();
public Calendar(String caption, CalendarEventProvider eventProvider) {
registerRpc(rpc);
setCaption(caption);
- handlers = new HashMap<String, EventListener>();
+ handlers = new HashMap<>();
setDefaultHandlers();
currentCalendar.setTime(new Date());
setEventProvider(eventProvider);
currentCalendar.setTime(firstDateToShow);
events = getEventProvider().getEvents(firstDateToShow, lastDateToShow);
- List<CalendarState.Event> calendarStateEvents = new ArrayList<CalendarState.Event>();
+ List<CalendarState.Event> calendarStateEvents = new ArrayList<>();
if (events != null) {
for (int i = 0; i < events.size(); i++) {
CalendarEvent e = events.get(i);
DateFormat weeklyCaptionFormatter = getWeeklyCaptionFormatter();
weeklyCaptionFormatter.setTimeZone(currentCalendar.getTimeZone());
- Map<CalendarDateRange, Set<Action>> actionMap = new HashMap<CalendarDateRange, Set<Action>>();
+ Map<CalendarDateRange, Set<Action>> actionMap = new HashMap<>();
- List<CalendarState.Day> days = new ArrayList<CalendarState.Day>();
+ List<CalendarState.Day> days = new ArrayList<>();
// Send all dates to client from server. This
// approach was taken because gwt doesn't
getTimeZone());
Action[] actions = actionHandler.getActions(range, this);
if (actions != null) {
- Set<Action> actionSet = new LinkedHashSet<Action>(
+ Set<Action> actionSet = new LinkedHashSet<>(
Arrays.asList(actions));
actionMap.put(range, actionSet);
}
getTimeZone());
Action[] actions = actionHandler.getActions(range, this);
if (actions != null) {
- Set<Action> actionSet = new LinkedHashSet<Action>(
- Arrays.asList(actions));
+ Set<Action> actionSet = new LinkedHashSet<>(Arrays.asList(actions));
actionMap.put(range, actionSet);
}
}
return null;
}
- List<CalendarState.Action> calendarActions = new ArrayList<CalendarState.Action>();
+ List<CalendarState.Action> calendarActions = new ArrayList<>();
SimpleDateFormat formatter = new SimpleDateFormat(
DateConstants.ACTION_DATE_FORMAT_PATTERN);
@Override
public TargetDetails translateDropTargetDetails(
Map<String, Object> clientVariables) {
- Map<String, Object> serverVariables = new HashMap<String, Object>();
+ Map<String, Object> serverVariables = new HashMap<>();
if (clientVariables.containsKey("dropSlotIndex")) {
int slotIndex = (Integer) clientVariables.get("dropSlotIndex");
public void addActionHandler(Handler actionHandler) {
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<Action.Handler>();
- actionMapper = new KeyMapper<Action>();
+ actionHandlers = new LinkedList<>();
+ actionMapper = new KeyMapper<>();
}
if (!actionHandlers.contains(actionHandler)) {
actionHandlers.add(actionHandler);
import com.vaadin.v7.shared.ui.checkbox.CheckBoxServerRpc;
import com.vaadin.v7.shared.ui.checkbox.CheckBoxState;
+@Deprecated
public class CheckBox extends AbstractField<Boolean> {
private CheckBoxServerRpc rpc = new CheckBoxServerRpc() {
*
*/
@SuppressWarnings("serial")
+@Deprecated
public class ComboBox extends AbstractSelect
implements AbstractSelect.Filtering, FieldEvents.BlurNotifier,
FieldEvents.FocusNotifier {
* @since 7.5.6
* @see ComboBox#setItemStyleGenerator(ItemStyleGenerator)
*/
+ @Deprecated
public interface ItemStyleGenerator extends Serializable {
/**
final boolean paintNullSelection = needNullSelectOption
&& currentPage == 0 && !nullFilteredOut;
- List<ComboBoxItem> items = new ArrayList<ComboBoxItem>();
+ List<ComboBoxItem> items = new ArrayList<>();
if (paintNullSelection) {
ComboBoxItem item = new ComboBoxItem();
protected List<?> getFilteredOptions() {
if (!isFilteringNeeded()) {
prevfilterstring = null;
- filteredOptions = new LinkedList<Object>(getItemIds());
+ filteredOptions = new LinkedList<>(getItemIds());
return filteredOptions;
}
}
prevfilterstring = filterstring;
- filteredOptions = new LinkedList<Object>();
+ filteredOptions = new LinkedList<>();
for (final Iterator<?> it = items.iterator(); it.hasNext();) {
final Object itemId = it.next();
String caption = getItemCaption(itemId);
*
* @since 7.0
*/
+@Deprecated
public abstract class CustomField<T> extends AbstractField<T>
implements HasComponents {
* @since 3.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class DateField extends AbstractField<Date> implements
FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, LegacyComponent {
return timeZone;
}
+ @Deprecated
public static class UnparsableDateString
extends Validator.InvalidValueException {
* factories.
*
*/
+@Deprecated
public class DefaultFieldFactory
implements FormFieldFactory, TableFieldFactory {
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class Grid extends AbstractFocusable implements SelectionNotifier,
SortNotifier, SelectiveRenderer, ItemClickNotifier {
*
* @since 7.5.0
*/
+ @Deprecated
public interface ColumnVisibilityChangeListener extends Serializable {
/**
* Called when a column has become hidden or unhidden.
*
* @since 7.5.0
*/
+ @Deprecated
public static class ColumnVisibilityChangeEvent extends Component.Event {
private final Column column;
* @author Vaadin Ltd
* @see DetailsGenerator#NULL
*/
+ @Deprecated
public interface DetailsGenerator extends Serializable {
/** A details generator that provides no details */
*
* @since 7.6.1
*/
+ @Deprecated
public final static class DetailComponentManager
extends AbstractGridExtension implements DataGenerator {
* Aims to fields of suitable type and with suitable size for use in the
* editor row.
*/
+ @Deprecated
public static class EditorFieldFactory
extends DefaultFieldGroupFieldFactory {
private static final EditorFieldFactory INSTANCE = new EditorFieldFactory();
/**
* Error handler for the editor
*/
+ @Deprecated
public interface EditorErrorHandler extends Serializable {
/**
*
* @since 7.6
*/
+ @Deprecated
public static class GridContextClickEvent extends ContextClickEvent {
private final Object itemId;
/**
* An event which is fired when saving the editor fails
*/
+ @Deprecated
public static class CommitErrorEvent extends Component.Event {
private CommitException cause;
*
* @since 7.5.0
*/
+ @Deprecated
public interface ColumnReorderListener extends Serializable {
/**
*
* @since 7.5.0
*/
+ @Deprecated
public static class ColumnReorderEvent extends Component.Event {
private final boolean userOriginated;
*
* @since 7.6
*/
+ @Deprecated
public interface ColumnResizeListener extends Serializable {
/**
*
* @since 7.6
*/
+ @Deprecated
public static class ColumnResizeEvent extends Component.Event {
private final Column column;
/**
* Interface for an editor event listener
*/
+ @Deprecated
public interface EditorListener extends Serializable {
public static final Method EDITOR_OPEN_METHOD = ReflectTools.findMethod(
/**
* Base class for editor related events
*/
+ @Deprecated
public static abstract class EditorEvent extends Component.Event {
private Object itemID;
/**
* This event gets fired when an editor is opened
*/
+ @Deprecated
public static class EditorOpenEvent extends EditorEvent {
public EditorOpenEvent(Grid source, Object itemID) {
* This event gets fired when an editor is opened while another row is being
* edited (i.e. editor focus moves elsewhere)
*/
+ @Deprecated
public static class EditorMoveEvent extends EditorEvent {
public EditorMoveEvent(Grid source, Object itemID) {
* This event gets fired when an editor is dismissed or closed by other
* means.
*/
+ @Deprecated
public static class EditorCloseEvent extends EditorEvent {
public EditorCloseEvent(Grid source, Object itemID) {
* Default error handler for the editor
*
*/
+ @Deprecated
public class DefaultEditorErrorHandler implements EditorErrorHandler {
@Override
* @see Grid#setSelectionMode(SelectionMode)
* @see Grid#setSelectionModel(SelectionModel)
*/
+ @Deprecated
public enum SelectionMode {
/** A SelectionMode that maps to {@link SingleSelectionModel} */
SINGLE {
* The server-side interface that controls Grid's selection state.
* SelectionModel should extend {@link AbstractGridExtension}.
*/
+ @Deprecated
public interface SelectionModel extends Serializable, Extension {
/**
* Checks whether an item is selected or not.
* something is forbidden to do in e.g. the user interface, it must also
* be forbidden to do in the server-side and client-side APIs.
*/
+ @Deprecated
public interface Multi extends SelectionModel {
/**
* something is forbidden to do in e.g. the user interface, it must also
* be forbidden to do in the server-side and client-side APIs.
*/
+ @Deprecated
public interface Single extends SelectionModel {
/**
* developer is unable to select something programmatically, it is not
* allowed for the end-user to select anything, either.
*/
+ @Deprecated
public interface None extends SelectionModel {
/**
* A base class for SelectionModels that contains some of the logic that is
* reusable.
*/
+ @Deprecated
public static abstract class AbstractSelectionModel extends
AbstractGridExtension implements SelectionModel, DataGenerator {
protected final LinkedHashSet<Object> selection = new LinkedHashSet<>();
/**
* A default implementation of a {@link SelectionModel.Single}
*/
+ @Deprecated
public static class SingleSelectionModel extends AbstractSelectionModel
implements SelectionModel.Single {
/**
* A default implementation for a {@link SelectionModel.None}
*/
+ @Deprecated
public static class NoSelectionModel extends AbstractSelectionModel
implements SelectionModel.None {
/**
* A default implementation of a {@link SelectionModel.Multi}
*/
+ @Deprecated
public static class MultiSelectionModel extends AbstractSelectionModel
implements SelectionModel.Multi {
* should not be stored anywhere outside of the method providing these
* instances.
*/
+ @Deprecated
public static class RowReference implements Serializable {
private final Grid grid;
* should not be stored anywhere outside of the method providing these
* instances.
*/
+ @Deprecated
public static class CellReference implements Serializable {
private final RowReference rowReference;
*
* @see Grid#setRowStyleGenerator(RowStyleGenerator)
*/
+ @Deprecated
public interface RowStyleGenerator extends Serializable {
/**
*
* @see Grid#setCellStyleGenerator(CellStyleGenerator)
*/
+ @Deprecated
public interface CellStyleGenerator extends Serializable {
/**
*
* @since 7.6
*/
+ @Deprecated
public interface RowDescriptionGenerator extends Serializable {
/**
*
* @since 7.6
*/
+ @Deprecated
public interface CellDescriptionGenerator extends Serializable {
/**
* @param <ROWTYPE>
* the type of the rows in the section
*/
+ @Deprecated
public abstract static class StaticSection<ROWTYPE extends StaticSection.StaticRow<?>>
implements Serializable {
* @param <CELLTYPE>
* the type of the cells in the row
*/
+ @Deprecated
public abstract static class StaticRow<CELLTYPE extends StaticCell>
implements Serializable {
/**
* A header or footer cell. Has a simple textual caption.
*/
+ @Deprecated
abstract static class StaticCell implements Serializable {
private CellState cellState = new CellState();
/**
* Represents the header section of a Grid.
*/
+ @Deprecated
protected static class Header extends StaticSection<HeaderRow> {
private HeaderRow defaultRow = null;
/**
* Represents a header row in Grid.
*/
+ @Deprecated
public static class HeaderRow extends StaticSection.StaticRow<HeaderCell> {
protected HeaderRow(StaticSection<?> section) {
* Represents a header cell in Grid. Can be a merged cell for multiple
* columns.
*/
+ @Deprecated
public static class HeaderCell extends StaticSection.StaticCell {
protected HeaderCell(HeaderRow row) {
* Represents the footer section of a Grid. By default Footer is not
* visible.
*/
+ @Deprecated
protected static class Footer extends StaticSection<FooterRow> {
private final GridStaticSectionState footerState = new GridStaticSectionState();
/**
* Represents a footer row in Grid.
*/
+ @Deprecated
public static class FooterRow extends StaticSection.StaticRow<FooterCell> {
protected FooterRow(StaticSection<?> section) {
/**
* Represents a footer cell in Grid.
*/
+ @Deprecated
public static class FooterCell extends StaticSection.StaticCell {
protected FooterCell(FooterRow row) {
* A column in the grid. Can be obtained by calling
* {@link Grid#getColumn(Object propertyId)}.
*/
+ @Deprecated
public static class Column implements Serializable {
/**
* @param <T>
* the type this renderer knows how to present
*/
+ @Deprecated
public static abstract class AbstractRenderer<T>
extends AbstractGridExtension implements Renderer<T> {
*
* @since 7.5
*/
+ @Deprecated
public static abstract class AbstractGridExtension
extends AbstractExtension {
* @author Vaadin Ltd.
* @since 5.0
*/
+@Deprecated
public class InlineDateField extends DateField {
public InlineDateField() {
* @since 3.0
*/
@SuppressWarnings("serial")
+@Deprecated
public class Label extends AbstractComponent implements Property<String>,
Property.Viewer, Property.ValueChangeListener,
Property.ValueChangeNotifier, Comparable<Label> {
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public static class ValueChangeEvent extends Component.Event
implements Property.ValueChangeEvent {
* lazyloading, and other advanced features.
*/
@SuppressWarnings("serial")
+@Deprecated
public class ListSelect extends AbstractSelect {
private int rows = 0;
* better choice.
*/
@SuppressWarnings("serial")
+@Deprecated
public class NativeSelect extends AbstractSelect
implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
* Configures select to be used as an option group.
*/
@SuppressWarnings("serial")
+@Deprecated
public class OptionGroup extends AbstractSelect
implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
- private Set<Object> disabledItemIds = new HashSet<Object>();
+ private Set<Object> disabledItemIds = new HashSet<>();
public OptionGroup() {
super();
* @author Vaadin Ltd.
* @since 5.0
*/
+@Deprecated
public class PopupDateField extends DateField {
private String inputPrompt = null;
* @since 7.1
* @author Vaadin Ltd
*/
+@Deprecated
public class ProgressBar extends AbstractField<Float>
implements Property.Viewer, Property.ValueChangeListener {
* {@link RichTextArea} may produce unexpected results as formatting is counted
* into length of field.
*/
+@Deprecated
public class RichTextArea extends AbstractField<String>
implements LegacyComponent {
* @author Vaadin Ltd.
*
*/
+ @Deprecated
public class ValueOutOfBoundsException extends RuntimeException {
private final Double value;
* @author Vaadin Ltd.
* @since 3.0
*/
+@Deprecated
@SuppressWarnings({ "deprecation" })
public class Table extends AbstractSelect implements Action.Container,
Container.Ordered, Container.Sortable, ItemClickNotifier, DragSource,
/**
* Modes that Table support as drag sourse.
*/
+ @Deprecated
public enum TableDragMode {
/**
* Table does not start drag and drop events. HTM5 style events started
protected static final int CELL_FIRSTCOL = 5;
+ @Deprecated
public enum Align {
/**
* Left column alignment. <b>This is the default behaviour. </b>
@Deprecated
public static final Align ALIGN_RIGHT = Align.RIGHT;
+ @Deprecated
public enum ColumnHeaderMode {
/**
* Column headers are hidden.
@Deprecated
public static final ColumnHeaderMode COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID = ColumnHeaderMode.EXPLICIT_DEFAULTS_ID;
+ @Deprecated
public enum RowHeaderMode {
/**
* Row caption mode: The row headers are hidden. <b>This is the default
/**
* Keymapper for column ids.
*/
- private final KeyMapper<Object> columnIdMap = new KeyMapper<Object>();
+ private final KeyMapper<Object> columnIdMap = new KeyMapper<>();
/**
* Holds visible column propertyIds - in order.
*/
- private LinkedList<Object> visibleColumns = new LinkedList<Object>();
+ private LinkedList<Object> visibleColumns = new LinkedList<>();
/**
* Holds noncollapsible columns.
*/
- private HashSet<Object> noncollapsibleColumns = new HashSet<Object>();
+ private HashSet<Object> noncollapsibleColumns = new HashSet<>();
/**
* Holds propertyIds of currently collapsed columns.
*/
- private final HashSet<Object> collapsedColumns = new HashSet<Object>();
+ private final HashSet<Object> collapsedColumns = new HashSet<>();
/**
* Holds headers for visible columns (by propertyId).
*/
- private final HashMap<Object, String> columnHeaders = new HashMap<Object, String>();
+ private final HashMap<Object, String> columnHeaders = new HashMap<>();
/**
* Holds footers for visible columns (by propertyId).
*/
- private final HashMap<Object, String> columnFooters = new HashMap<Object, String>();
+ private final HashMap<Object, String> columnFooters = new HashMap<>();
/**
* Holds icons for visible columns (by propertyId).
*/
- private final HashMap<Object, Resource> columnIcons = new HashMap<Object, Resource>();
+ private final HashMap<Object, Resource> columnIcons = new HashMap<>();
/**
* Holds alignments for visible columns (by propertyId).
*/
- private HashMap<Object, Align> columnAlignments = new HashMap<Object, Align>();
+ private HashMap<Object, Align> columnAlignments = new HashMap<>();
/**
* Holds column widths in pixels for visible columns (by propertyId).
*/
- private final HashMap<Object, Integer> columnWidths = new HashMap<Object, Integer>();
+ private final HashMap<Object, Integer> columnWidths = new HashMap<>();
/**
* Holds column expand rations for visible columns (by propertyId).
*/
- private final HashMap<Object, Float> columnExpandRatios = new HashMap<Object, Float>();
+ private final HashMap<Object, Float> columnExpandRatios = new HashMap<>();
/**
* Holds column generators
*/
- private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<Object, ColumnGenerator>();
+ private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<>();
/**
* Holds value of property pageLength. 0 disables paging.
private RowGenerator rowGenerator = null;
- private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<Field<?>, Property<?>>();
+ private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<>();
private boolean painted = false;
- private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<Object, Converter<String, Object>>();
+ private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<>();
/**
* Set to true if the client-side should be informed that the key mapper has
*/
private boolean keyMapperReset;
- private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<Throwable>();
+ private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<>();
private boolean isBeingPainted;
"Can not set visible columns to null value");
}
- final LinkedList<Object> newVC = new LinkedList<Object>();
+ final LinkedList<Object> newVC = new LinkedList<>();
// Checks that the new visible columns contains no nulls, properties
// exist and that there are no duplicates before adding them to newVC.
}
// Resets the alignments
- final HashMap<Object, Align> newCA = new HashMap<Object, Align>();
+ final HashMap<Object, Align> newCA = new HashMap<>();
int i = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it.hasNext()
&& i < columnAlignments.length; i++) {
if (columnOrder == null || !isColumnReorderingAllowed()) {
return;
}
- final LinkedList<Object> newOrder = new LinkedList<Object>();
+ final LinkedList<Object> newOrder = new LinkedList<>();
for (int i = 0; i < columnOrder.length; i++) {
if (columnOrder[i] != null
&& visibleColumns.contains(columnOrder[i])) {
* </p>
*
*/
+ @Deprecated
public static class CacheUpdateException extends RuntimeException {
private Throwable[] causes;
private Table table;
if (replaceListeners) {
// initialize the listener collections, this should only be done if
// the entire cache is refreshed (through refreshRenderedCells)
- listenedProperties = new HashSet<Property<?>>();
- visibleComponents = new HashSet<Component>();
+ listenedProperties = new HashSet<>();
+ visibleComponents = new HashSet<>();
}
Object[][] cells = new Object[cols + CELL_FIRSTCOL][rows];
throws UnsupportedOperationException {
// remove generated columns from the list of columns being assigned
- final LinkedList<Object> availableCols = new LinkedList<Object>();
+ final LinkedList<Object> availableCols = new LinkedList<>();
for (Iterator<Object> it = visibleColumns.iterator(); it.hasNext();) {
Object id = it.next();
if (!columnGenerators.containsKey(id)) {
} else {
generated = Collections.emptyList();
}
- List<Object> visibleIds = new ArrayList<Object>();
+ List<Object> visibleIds = new ArrayList<>();
if (generated.isEmpty()) {
visibleIds.addAll(newDataSource.getContainerPropertyIds());
} else {
newDataSource = new IndexedContainer();
}
if (visibleIds == null) {
- visibleIds = new ArrayList<Object>();
+ visibleIds = new ArrayList<>();
}
// Retain propertyValueConverters if their corresponding ids are
if (propertyValueConverters != null) {
Collection<?> newPropertyIds = newDataSource
.getContainerPropertyIds();
- LinkedList<Object> retainableValueConverters = new LinkedList<Object>();
+ LinkedList<Object> retainableValueConverters = new LinkedList<>();
for (Object propertyId : newPropertyIds) {
Converter<String, ?> converter = getConverter(propertyId);
if (converter != null) {
}
// don't add the same id twice
- Collection<Object> col = new LinkedList<Object>();
+ Collection<Object> col = new LinkedList<>();
for (Iterator<?> it = visibleIds.iterator(); it.hasNext();) {
Object id = it.next();
if (!col.contains(id)) {
*/
private LinkedHashSet<Object> getItemIdsInRange(Object itemId,
final int length) {
- LinkedHashSet<Object> ids = new LinkedHashSet<Object>();
+ LinkedHashSet<Object> ids = new LinkedHashSet<>();
for (int i = 0; i < length; i++) {
assert itemId != null; // should not be null unless client-server
// are out of sync
Set<Object> renderedButNotSelectedItemIds = getCurrentlyRenderedItemIds();
@SuppressWarnings("unchecked")
- HashSet<Object> newValue = new LinkedHashSet<Object>(
+ HashSet<Object> newValue = new LinkedHashSet<>(
(Collection<Object>) getValue());
if (variables.containsKey("clearSelections")) {
}
private Set<Object> getCurrentlyRenderedItemIds() {
- HashSet<Object> ids = new HashSet<Object>();
+ HashSet<Object> ids = new HashSet<>();
if (pageBuffer != null) {
for (int i = 0; i < pageBuffer[CELL_ITEMID].length; i++) {
ids.add(pageBuffer[CELL_ITEMID][i]);
if (!isSelectable() && variables.containsKey("selected")) {
// Not-selectable is a special case, AbstractSelect does not support
// TODO could be optimized.
- variables = new HashMap<String, Object>(variables);
+ variables = new HashMap<>(variables);
variables.remove("selected");
}
&& variables.containsKey("selected")
&& multiSelectMode == MultiSelectMode.DEFAULT) {
handleSelectedItems(variables);
- variables = new HashMap<String, Object>(variables);
+ variables = new HashMap<>(variables);
variables.remove("selected");
}
try {
final Object[] ids = (Object[]) variables
.get("collapsedcolumns");
- Set<Object> idSet = new HashSet<Object>();
+ Set<Object> idSet = new HashSet<>();
for (Object id : ids) {
idSet.add(columnIdMap.get(id.toString()));
}
private void paintAvailableColumns(PaintTarget target)
throws PaintException {
if (columnCollapsingAllowed) {
- final HashSet<Object> collapsedCols = new HashSet<Object>();
+ final HashSet<Object> collapsedCols = new HashSet<>();
for (Object colId : visibleColumns) {
if (isColumnCollapsed(colId)) {
collapsedCols.add(colId);
private void paintVisibleColumnOrder(PaintTarget target) {
// Visible column order
- final ArrayList<String> visibleColOrder = new ArrayList<String>();
+ final ArrayList<String> visibleColOrder = new ArrayList<>();
for (Object columnId : visibleColumns) {
if (!isColumnCollapsed(columnId)) {
visibleColOrder.add(columnIdMap.key(columnId));
}
private Set<Action> findAndPaintBodyActions(PaintTarget target) {
- Set<Action> actionSet = new LinkedHashSet<Action>();
+ Set<Action> actionSet = new LinkedHashSet<>();
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<String>();
+ final ArrayList<String> keys = new ArrayList<>();
for (Handler ah : actionHandlers) {
// Getting actions for the null item, which in this case means
// the body item
}
private String[] findSelectedKeys() {
- LinkedList<String> selectedKeys = new LinkedList<String>();
+ LinkedList<String> selectedKeys = new LinkedList<>();
if (isMultiSelect()) {
HashSet<?> sel = new HashSet<Object>((Set<?>) getValue());
Collection<?> vids = getVisibleItemIds();
// Actions
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<String>();
+ final ArrayList<String> keys = new ArrayList<>();
for (Handler ah : actionHandlers) {
final Action[] aa = ah.getActions(itemId, this);
if (aa != null) {
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<Handler>();
- actionMapper = new KeyMapper<Action>();
+ actionHandlers = new LinkedList<>();
+ actionMapper = new KeyMapper<>();
}
if (!actionHandlers.contains(actionHandler)) {
@Override
public Collection<?> getVisibleItemIds() {
- final LinkedList<Object> visible = new LinkedList<Object>();
+ final LinkedList<Object> visible = new LinkedList<>();
final Object[][] cells = getVisibleCells();
// may be null if the table has not been rendered yet (e.g. not attached
Collection<?> containerPropertyIds = getContainerDataSource()
.getContainerPropertyIds();
- LinkedList<Object> newVisibleColumns = new LinkedList<Object>(
- visibleColumns);
+ LinkedList<Object> newVisibleColumns = new LinkedList<>(visibleColumns);
for (Iterator<Object> iterator = newVisibleColumns.iterator(); iterator
.hasNext();) {
Object id = iterator.next();
* Table.addGeneratedColumn along with an id for the column to be generated.
*
*/
+ @Deprecated
public interface ColumnGenerator extends Serializable {
/**
* to the cell content is <tt>v-table-cell-content-[style name]</tt>, and
* the row style will be <tt>v-table-row-[style name]</tt>.
*/
+ @Deprecated
public interface CellStyleGenerator extends Serializable {
/**
*
* @since 6.3
*/
+ @Deprecated
public class TableTransferable extends DataBoundTransferable {
protected TableTransferable(Map<String, Object> rawVariables) {
* initialized from server and no subsequent requests requests are needed
* during that drag and drop operation.
*/
+ @Deprecated
public static abstract class TableDropCriterion
extends ServerSideCriterion {
* the column which header was pressed and details about the mouse event
* itself.
*/
+ @Deprecated
public static class HeaderClickEvent extends ClickEvent {
public static final Method HEADER_CLICK_METHOD;
* the column which header was pressed and details about the mouse event
* itself.
*/
+ @Deprecated
public static class FooterClickEvent extends ClickEvent {
public static final Method FOOTER_CLICK_METHOD;
* Interface for the listener for column header mouse click events. The
* headerClick method is called when the user presses a header column cell.
*/
+ @Deprecated
public interface HeaderClickListener extends Serializable {
/**
* Interface for the listener for column footer mouse click events. The
* footerClick method is called when the user presses a footer column cell.
*/
+ @Deprecated
public interface FooterClickListener extends Serializable {
/**
* columns property id which was fired, the previous width of the column and
* the width of the column after the resize.
*/
+ @Deprecated
public static class ColumnResizeEvent extends Component.Event {
public static final Method COLUMN_RESIZE_METHOD;
/**
* Interface for listening to column resize events.
*/
+ @Deprecated
public interface ColumnResizeListener extends Serializable {
/**
/**
* This event is fired when a columns are reordered by the end user user.
*/
+ @Deprecated
public static class ColumnReorderEvent extends Component.Event {
public static final Method METHOD;
/**
* Interface for listening to column reorder events.
*/
+ @Deprecated
public interface ColumnReorderListener extends Serializable {
/**
*
* @since 7.6
*/
+ @Deprecated
public static class ColumnCollapseEvent extends Component.Event {
public static final Method METHOD = ReflectTools.findMethod(
*
* @since 7.6
*/
+ @Deprecated
public interface ColumnCollapseListener extends Serializable {
/**
*
* Row generators can be used for e.g. summary rows or grouping of items.
*/
+ @Deprecated
public interface RowGenerator extends Serializable {
/**
* Called for every row that is painted in the Table. Returning a
public GeneratedRow generateRow(Table table, Object itemId);
}
+ @Deprecated
public static class GeneratedRow implements Serializable {
private boolean htmlContentAllowed = false;
private boolean spanColumns = false;
if (colgroup != null) {
int i = 0;
- List<Object> pIds = new ArrayList<Object>();
+ List<Object> pIds = new ArrayList<>();
for (Element col : colgroup.children()) {
if (!col.tagName().equals("col")) {
throw new DesignException("invalid column");
return;
}
- Set<String> selected = new HashSet<String>();
+ Set<String> selected = new HashSet<>();
for (Element tr : tbody.children()) {
readItem(tr, selected, context);
}
*
* @since 7.6
*/
+ @Deprecated
public static class TableContextClickEvent extends ContextClickEvent {
private final Object itemId;
* @since 6.0
* @see FormFieldFactory
*/
+@Deprecated
public interface TableFieldFactory extends Serializable {
/**
* Creates a field based on the Container, item id, property id and the
/**
* A text field that supports multi line editing.
*/
+@Deprecated
public class TextArea extends AbstractTextField {
/**
* @since 3.0
*/
@SuppressWarnings({ "serial", "deprecation" })
+@Deprecated
public class Tree extends AbstractSelect implements Container.Hierarchical,
Action.Container, ItemClickNotifier, DragSource, DropTarget {
*
* @since 7.6
*/
+ @Deprecated
public static class TreeContextClickEvent extends ContextClickEvent {
private final Object itemId;
/**
* Item icons alt texts.
*/
- private final HashMap<Object, String> itemIconAlts = new HashMap<Object, String>();
+ private final HashMap<Object, String> itemIconAlts = new HashMap<>();
/**
* Set of expanded nodes.
*/
- private HashSet<Object> expanded = new HashSet<Object>();
+ private HashSet<Object> expanded = new HashSet<>();
/**
* List of action handlers.
/**
* Supported drag modes for Tree.
*/
+ @Deprecated
public enum TreeDragMode {
/**
* When drag mode is NONE, dragging from Tree is not supported. Browsers
boolean result = true;
// Initial stack
- final Stack<Object> todo = new Stack<Object>();
+ final Stack<Object> todo = new Stack<>();
todo.add(startItemId);
// Expands recursively
boolean result = true;
// Initial stack
- final Stack<Object> todo = new Stack<Object>();
+ final Stack<Object> todo = new Stack<>();
todo.add(startItemId);
// Collapse recursively
if (!isSelectable() && variables.containsKey("selected")) {
// Not-selectable is a special case, AbstractSelect does not support
// TODO could be optimized.
- variables = new HashMap<String, Object>(variables);
+ variables = new HashMap<>(variables);
variables.remove("selected");
}
if (variables.containsKey("selected") && isMultiSelect()
&& multiSelectMode == MultiSelectMode.DEFAULT) {
handleSelectedItems(variables);
- variables = new HashMap<String, Object>(variables);
+ variables = new HashMap<>(variables);
variables.remove("selected");
}
final String[] ka = (String[]) variables.get("selected");
// Converts the key-array to id-set
- final LinkedList<Object> s = new LinkedList<Object>();
+ final LinkedList<Object> s = new LinkedList<>();
for (int i = 0; i < ka.length; i++) {
final Object id = itemIdMapper.get(ka[i]);
if (!isNullSelectionAllowed()
}
// Initialize variables
- final Set<Action> actionSet = new LinkedHashSet<Action>();
+ final Set<Action> actionSet = new LinkedHashSet<>();
// rendered selectedKeys
- LinkedList<String> selectedKeys = new LinkedList<String>();
+ LinkedList<String> selectedKeys = new LinkedList<>();
- final LinkedList<String> expandedKeys = new LinkedList<String>();
+ final LinkedList<String> expandedKeys = new LinkedList<>();
// Iterates through hierarchical tree using a stack of iterators
- final Stack<Iterator<?>> iteratorStack = new Stack<Iterator<?>>();
+ final Stack<Iterator<?>> iteratorStack = new Stack<>();
Collection<?> ids;
if (partialUpdate) {
ids = getChildren(expandedItemId);
* by right clicking on the Tree body
*/
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<String>();
+ final ArrayList<String> keys = new ArrayList<>();
for (Handler ah : actionHandlers) {
// Getting action for the null item, which in this case
// Actions
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<String>();
+ final ArrayList<String> keys = new ArrayList<>();
final Iterator<Action.Handler> ahi = actionHandlers
.iterator();
while (ahi.hasNext()) {
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public static class ExpandEvent extends Component.Event {
private final Object expandedItemId;
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface ExpandListener extends Serializable {
public static final Method EXPAND_METHOD = ReflectTools.findMethod(
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public static class CollapseEvent extends Component.Event {
private final Object collapsedItemId;
* @author Vaadin Ltd.
* @since 3.0
*/
+ @Deprecated
public interface CollapseListener extends Serializable {
public static final Method COLLAPSE_METHOD = ReflectTools.findMethod(
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<Action.Handler>();
- actionMapper = new KeyMapper<Action>();
+ actionHandlers = new LinkedList<>();
+ actionMapper = new KeyMapper<>();
}
if (!actionHandlers.contains(actionHandler)) {
@Override
public Collection<?> getVisibleItemIds() {
- final LinkedList<Object> visible = new LinkedList<Object>();
+ final LinkedList<Object> visible = new LinkedList<>();
// Iterates trough hierarchical tree using a stack of iterators
- final Stack<Iterator<?>> iteratorStack = new Stack<Iterator<?>>();
+ final Stack<Iterator<?>> iteratorStack = new Stack<>();
final Collection<?> ids = rootItemIds();
if (ids != null) {
iteratorStack.push(ids.iterator());
* CSS class name that will be added to the item content is
* <tt>v-tree-node-[style name]</tt>.
*/
+ @Deprecated
public interface ItemStyleGenerator extends Serializable {
/**
*
* @since 6.3
*/
+ @Deprecated
public class TreeTargetDetails extends AbstractSelectTargetDetails {
TreeTargetDetails(Map<String, Object> rawVariables) {
*
* @since 6.3
*/
+ @Deprecated
protected class TreeTransferable extends DataBoundTransferable {
public TreeTransferable(Component sourceComponent,
* initialized from server and no subsequent requests requests are needed
* during that drag and drop operation.
*/
+ @Deprecated
public static abstract class TreeDropCriterion extends ServerSideCriterion {
private Tree tree;
*
* @since 6.3
*/
+ @Deprecated
public static class TargetItemAllowsChildren extends TargetDetailIs {
private static TargetItemAllowsChildren instance = new TargetItemAllowsChildren();
* <p>
* The root items is also consider to be valid target.
*/
+ @Deprecated
public class TargetInSubtree extends ClientSideCriterion {
private Object rootId;
}
private void cleanupExpandedItems() {
- Set<Object> removedItemIds = new HashSet<Object>();
+ Set<Object> removedItemIds = new HashSet<>();
for (Object expandedItemId : expanded) {
if (getItem(expandedItemId) == null) {
removedItemIds.add(expandedItemId);
* share UI state in the container.
*/
@SuppressWarnings({ "serial" })
+@Deprecated
public class TreeTable extends Table implements Hierarchical {
private interface ContainerStrategy extends Serializable {
*/
private class HierarchicalStrategy extends AbstractStrategy {
- private final HashSet<Object> openItems = new HashSet<Object>();
+ private final HashSet<Object> openItems = new HashSet<>();
@Override
public boolean isNodeOpen(Object itemId) {
*/
private List<Object> getPreOrder() {
if (preOrder == null) {
- preOrder = new ArrayList<Object>();
+ preOrder = new ArrayList<>();
Collection<?> rootItemIds = getContainerDataSource()
.rootItemIds();
for (Object id : rootItemIds) {
@Override
protected List<Object> getItemIds(int firstIndex, int rows) {
- List<Object> itemIds = new ArrayList<Object>();
+ List<Object> itemIds = new ArrayList<>();
for (int i = firstIndex; i < firstIndex + rows; i++) {
itemIds.add(getIdByIndex(i));
}
return;
}
- Set<String> selected = new HashSet<String>();
- Stack<Object> parents = new Stack<Object>();
+ Set<String> selected = new HashSet<>();
+ Stack<Object> parents = new Stack<>();
int lastDepth = -1;
for (Element tr : tbody.children()) {
* side for selected items.
*/
@SuppressWarnings("serial")
+@Deprecated
public class TwinColSelect extends AbstractSelect {
private int rows = 0;
*
*/
@SuppressWarnings("serial")
+@Deprecated
public class CalendarComponentEvent extends Component.Event {
/**
* @since 7.1.0
* @author Vaadin Ltd.
*/
+@Deprecated
public interface CalendarComponentEvents extends Serializable {
/**
* Notifier interface for notifying listener of calendar events
*/
+ @Deprecated
public interface CalendarEventNotifier extends Serializable {
/**
* Get the assigned event handler for the given eventId.
/**
* Notifier interface for event drag & drops.
*/
+ @Deprecated
public interface EventMoveNotifier extends CalendarEventNotifier {
/**
* MoveEvent is sent when existing event is dragged to a new position.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class MoveEvent extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.EVENTMOVE;
* Handler interface for when events are being dragged on the calendar
*
*/
+ @Deprecated
public interface EventMoveHandler extends EventListener, Serializable {
/** Trigger method for the MoveEvent. */
/**
* Handler interface for day or time cell drag-marking with mouse.
*/
+ @Deprecated
public interface RangeSelectNotifier
extends Serializable, CalendarEventNotifier {
* mouse.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class RangeSelectEvent extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.RANGESELECT;
}
/** RangeSelectHandler handles RangeSelectEvent. */
+ @Deprecated
public interface RangeSelectHandler extends EventListener, Serializable {
/** Trigger method for the RangeSelectEvent. */
}
/** Notifier interface for navigation listening. */
+ @Deprecated
public interface NavigationNotifier extends Serializable {
/**
* Add a forward navigation listener.
* ForwardEvent is sent when forward navigation button is clicked.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class ForwardEvent extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.FORWARD;
}
/** ForwardHandler handles ForwardEvent. */
+ @Deprecated
public interface ForwardHandler extends EventListener, Serializable {
/** Trigger method for the ForwardEvent. */
* BackwardEvent is sent when backward navigation button is clicked.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class BackwardEvent extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.BACKWARD;
}
/** BackwardHandler handles BackwardEvent. */
+ @Deprecated
public interface BackwardHandler extends EventListener, Serializable {
/** Trigger method for the BackwardEvent. */
* DateClickEvent is sent when a date is clicked.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class DateClickEvent extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.DATECLICK;
}
/** DateClickHandler handles DateClickEvent. */
+ @Deprecated
public interface DateClickHandler extends EventListener, Serializable {
/** Trigger method for the DateClickEvent. */
* EventClick is sent when an event is clicked.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class EventClick extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.EVENTCLICK;
}
/** EventClickHandler handles EventClick. */
+ @Deprecated
public interface EventClickHandler extends EventListener, Serializable {
/** Trigger method for the EventClick. */
* WeekClick is sent when week is clicked.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class WeekClick extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.WEEKCLICK;
}
/** WeekClickHandler handles WeekClicks. */
+ @Deprecated
public interface WeekClickHandler extends EventListener, Serializable {
/** Trigger method for the WeekClick. */
* EventResize is sent when an event is resized
*/
@SuppressWarnings("serial")
+ @Deprecated
public class EventResize extends CalendarComponentEvent {
public static final String EVENT_ID = CalendarEventId.EVENTRESIZE;
/**
* Notifier interface for event resizing.
*/
+ @Deprecated
public interface EventResizeNotifier extends Serializable {
/**
/**
* Handler for EventResize event.
*/
+ @Deprecated
public interface EventResizeHandler extends EventListener, Serializable {
/** Trigger method for the EventResize. */
*
*/
@SuppressWarnings("serial")
+@Deprecated
public class CalendarDateRange implements Serializable {
private Date start;
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class CalendarTargetDetails extends TargetDetailsImpl {
private boolean hasDropTime;
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class ContainerEventProvider
implements CalendarEditableEventProvider, EventSetChangeNotifier,
EventChangeNotifier, EventMoveHandler, EventResizeHandler,
/**
* Listeners attached to the container
*/
- private final List<EventSetChangeListener> eventSetChangeListeners = new LinkedList<CalendarEventProvider.EventSetChangeListener>();
- private final List<EventChangeListener> eventChangeListeners = new LinkedList<CalendarEvent.EventChangeListener>();
+ private final List<EventSetChangeListener> eventSetChangeListeners = new LinkedList<>();
+ private final List<EventChangeListener> eventChangeListeners = new LinkedList<>();
/**
* The event cache contains the events previously created by
* {@link #getEvents(Date, Date)}
*/
- private final List<CalendarEvent> eventCache = new LinkedList<CalendarEvent>();
+ private final List<CalendarEvent> eventCache = new LinkedList<>();
/**
* The container used as datasource
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier {
private String caption;
private Date end;
private Date start;
private String styleName;
- private transient List<EventChangeListener> listeners = new ArrayList<EventChangeListener>();
+ private transient List<EventChangeListener> listeners = new ArrayList<>();
private boolean isAllDay;
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicEventProvider implements CalendarEditableEventProvider,
EventSetChangeNotifier, CalendarEvent.EventChangeListener {
- protected List<CalendarEvent> eventList = new ArrayList<CalendarEvent>();
+ protected List<CalendarEvent> eventList = new ArrayList<>();
- private List<EventSetChangeListener> listeners = new ArrayList<EventSetChangeListener>();
+ private List<EventSetChangeListener> listeners = new ArrayList<>();
/*
* (non-Javadoc)
*/
@Override
public List<CalendarEvent> getEvents(Date startDate, Date endDate) {
- ArrayList<CalendarEvent> activeEvents = new ArrayList<CalendarEvent>();
+ ArrayList<CalendarEvent> activeEvents = new ArrayList<>();
for (CalendarEvent ev : eventList) {
long from = startDate.getTime();
* @since 7.1.0
* @author Vaadin Ltd.
*/
+@Deprecated
public interface CalendarEditableEventProvider extends CalendarEventProvider {
/**
* @author Vaadin Ltd.
*
*/
+@Deprecated
public interface CalendarEvent extends Serializable {
/**
* Event to signal that an event has changed.
*/
@SuppressWarnings("serial")
+ @Deprecated
public class EventChangeEvent implements Serializable {
private CalendarEvent source;
/**
* Listener for EventSetChange events.
*/
+ @Deprecated
public interface EventChangeListener extends Serializable {
/**
/**
* Notifier interface for EventChange events.
*/
+ @Deprecated
public interface EventChangeNotifier extends Serializable {
/**
* @since 7.1.0
* @author Vaadin Ltd.
*/
+@Deprecated
public interface CalendarEventProvider extends Serializable {
/**
* <p>
*
*/
@SuppressWarnings("serial")
+ @Deprecated
public class EventSetChangeEvent implements Serializable {
private CalendarEventProvider source;
/**
* Listener for EventSetChange events.
*/
+ @Deprecated
public interface EventSetChangeListener extends Serializable {
/**
/**
* Notifier interface for EventSetChange events.
*/
+ @Deprecated
public interface EventSetChangeNotifier extends Serializable {
/**
* @since 7.1
* @author Vaadin Ltd.
*/
+@Deprecated
public interface EditableCalendarEvent extends CalendarEvent {
/**
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicBackwardHandler implements BackwardHandler {
/*
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicDateClickHandler implements DateClickHandler {
/*
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicEventMoveHandler implements EventMoveHandler {
/*
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicEventResizeHandler implements EventResizeHandler {
/*
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicForwardHandler implements ForwardHandler {
/*
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
+@Deprecated
public class BasicWeekClickHandler implements WeekClickHandler {
/*
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public abstract class AbstractJavaScriptRenderer<T>
extends AbstractRenderer<T> {
private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class ButtonRenderer extends ClickableRenderer<String> {
/**
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class ClickableRenderer<T> extends AbstractRenderer<T> {
/**
*
* @see {@link ButtonRenderer#addClickListener(RendererClickListener)}
*/
+ @Deprecated
public interface RendererClickListener extends ConnectorEventListener {
static final Method CLICK_METHOD = ReflectTools.findMethod(
/**
* An event fired when a button rendered by a ButtonRenderer is clicked.
*/
+ @Deprecated
public static class RendererClickEvent extends ClickEvent {
private Object itemId;
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class DateRenderer extends AbstractRenderer<Date> {
private final Locale locale;
private final String formatString;
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public class HtmlRenderer extends AbstractRenderer<String> {
/**
* Creates a new HTML renderer.
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class ImageRenderer extends ClickableRenderer<Resource> {
/**
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class NumberRenderer extends AbstractRenderer<Number> {
private final Locale locale;
private final NumberFormat numberFormat;
* @author Vaadin Ltd
* @since 7.4
*/
+@Deprecated
public class ProgressBarRenderer extends AbstractRenderer<Double> {
/**
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public interface Renderer<T> extends Extension {
/**
* @since 7.4
* @author Vaadin Ltd
*/
+@Deprecated
public class TextRenderer extends AbstractRenderer<String> {
/**
--- /dev/null
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.server;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Modifier;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.stream.Collectors;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Vaadin Ltd
+ *
+ */
+public class DeprecatedTest {
+
+ private static String CLASS_SUFFIX = ".class";
+
+ @Test
+ public void allTypesAreDeprecated() throws URISyntaxException {
+ URL url = DeprecatedTest.class.getResource("/");
+ File file = new File(url.toURI());
+ List<File> classpath = getRawClasspathEntries().stream()
+ .filter(entry -> entry.contains("compatibility-server"))
+ .map(File::new).filter(fileEntry -> !fileEntry.equals(file))
+ .collect(Collectors.toList());
+ Assert.assertFalse(classpath.isEmpty());
+ classpath.forEach(this::checkDeprecatedClasses);
+ }
+
+ private void checkDeprecatedClasses(File classesRoot) {
+ try {
+ if (classesRoot.isDirectory()) {
+ Files.walk(classesRoot.toPath()).filter(Files::isRegularFile)
+ .filter(path -> path.toFile().getName()
+ .endsWith(CLASS_SUFFIX))
+ .forEach(path -> checkDeprecatedClass(path,
+ classesRoot.toPath()));
+ } else if (classesRoot.getName().toLowerCase(Locale.ENGLISH)
+ .endsWith(".jar")) {
+ URI uri = URI.create("jar:file:" + classesRoot.getPath());
+ Path root = FileSystems
+ .newFileSystem(uri, Collections.emptyMap())
+ .getPath("/");
+ Files.walk(root).filter(Files::isRegularFile)
+ .filter(path -> path.toUri().getSchemeSpecificPart()
+ .endsWith(CLASS_SUFFIX))
+ .forEach(path -> checkDeprecatedClass(path, root));
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void checkDeprecatedClass(Path path, Path root) {
+ Path relative = root.relativize(path);
+ String name = relative.toString();
+ name = name.substring(0, name.length() - CLASS_SUFFIX.length());
+ name = name.replace('/', '.');
+ try {
+ Class<?> clazz = Class.forName(name);
+ if (clazz.isSynthetic() || clazz.isAnonymousClass()) {
+ return;
+ }
+ if (Modifier.isPrivate(clazz.getModifiers())) {
+ return;
+ }
+ Assert.assertNotNull(
+ "Class " + clazz
+ + " is in compatability package and it's not deprecated",
+ clazz.getAnnotation(Deprecated.class));
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private final static List<String> getRawClasspathEntries() {
+ // try to keep the order of the classpath
+ List<String> locations = new ArrayList<>();
+
+ String pathSep = System.getProperty("path.separator");
+ String classpath = System.getProperty("java.class.path");
+
+ if (classpath.startsWith("\"")) {
+ classpath = classpath.substring(1);
+ }
+ if (classpath.endsWith("\"")) {
+ classpath = classpath.substring(0, classpath.length() - 1);
+ }
+
+ String[] split = classpath.split(pathSep);
+ for (int i = 0; i < split.length; i++) {
+ String classpathEntry = split[i];
+ locations.add(classpathEntry);
+ }
+
+ return locations;
+ }
+}