} else {
Collection<Column<?, JsonObject>> errorColumns;
if (errorColumnsIds != null) {
- errorColumns = new ArrayList<>();
+ errorColumns = new ArrayList<Column<?, JsonObject>>();
for (String colId : errorColumnsIds) {
errorColumns.add(columnIdToColumn.get(colId));
}
public void onColumnReorder(ColumnReorderEvent<JsonObject> event) {
if (!columnsUpdatedFromState) {
List<Column<?, JsonObject>> columns = getWidget().getColumns();
- final List<String> newColumnOrder = new ArrayList<>();
+ final List<String> newColumnOrder = new ArrayList<String>();
for (Column<?, JsonObject> column : columns) {
if (column instanceof CustomGridColumn) {
newColumnOrder.add(((CustomGridColumn) column).id);
private class CustomDetailsGenerator
implements HeightAwareDetailsGenerator {
- private final Map<String, ComponentConnector> idToDetailsMap = new HashMap<>();
- private final Map<String, Integer> idToRowIndex = new HashMap<>();
+ private final Map<String, ComponentConnector> idToDetailsMap = new HashMap<String, ComponentConnector>();
+ private final Map<String, Integer> idToRowIndex = new HashMap<String, Integer>();
@Override
public Widget getDetails(int rowIndex) {
}
public void updateConnectorHierarchy(List<ServerConnector> children) {
- Set<String> connectorIds = new HashSet<>();
+ Set<String> connectorIds = new HashSet<String>();
for (ServerConnector child : children) {
if (child instanceof ComponentConnector) {
connectorIds.add(child.getConnectorId());
}
}
- Set<String> removedDetails = new HashSet<>();
+ Set<String> removedDetails = new HashSet<String>();
for (Entry<String, ComponentConnector> entry : idToDetailsMap
.entrySet()) {
ComponentConnector connector = entry.getValue();
/**
* Maps a generated column id to a grid column instance
*/
- private Map<String, CustomGridColumn> columnIdToColumn = new HashMap<>();
+ private Map<String, CustomGridColumn> columnIdToColumn = new HashMap<String, CustomGridColumn>();
- private List<String> columnOrder = new ArrayList<>();
+ private List<String> columnOrder = new ArrayList<String>();
/**
* {@link #columnsUpdatedFromState} is set to true when
private RpcDataSource dataSource;
/* Used to track Grid editor columns with validation errors */
- private final Map<Column<?, JsonObject>, String> columnToErrorMessage = new HashMap<>();
+ private final Map<Column<?, JsonObject>, String> columnToErrorMessage = new HashMap<Column<?, JsonObject>, String>();
private ItemClickHandler itemClickHandler = new ItemClickHandler();
private void purgeRemovedColumns() {
// Get columns still registered in the state
- Set<String> columnsInState = new HashSet<>();
+ Set<String> columnsInState = new HashSet<String>();
for (GridColumnState columnState : getState().columns) {
columnsInState.add(columnState.id);
}
}
private void onSortStateChange() {
- List<SortOrder> sortOrder = new ArrayList<>();
+ List<SortOrder> sortOrder = new ArrayList<SortOrder>();
String[] sortColumns = getState().sortColumns;
SortDirection[] sortDirs = getState().sortDirs;
* @return displayed error string
*/
private String getColumnErrors() {
- List<String> errors = new ArrayList<>();
+ List<String> errors = new ArrayList<String>();
for (Grid.Column<?, JsonObject> c : getWidget().getColumns()) {
if (!(c instanceof CustomGridColumn)) {
registerRpc(DataProviderRpc.class, new DataProviderRpc() {
@Override
public void setRowData(int firstRow, JsonArray rowArray) {
- ArrayList<JsonObject> rows = new ArrayList<>(
+ ArrayList<JsonObject> rows = new ArrayList<JsonObject>(
rowArray.length());
for (int i = 0; i < rowArray.length(); i++) {
JsonObject rowObject = rowArray.getObject(i);
e.onselectstart = function() {
return false;
}
-
+
e.ondragstart = function() {
return false;
}
}-*/;
private void updateEventsToWeekGrid(CalendarEvent[] events) {
- List<CalendarEvent> allDayLong = new ArrayList<>();
- List<CalendarEvent> belowDayLong = new ArrayList<>();
+ List<CalendarEvent> allDayLong = new ArrayList<CalendarEvent>();
+ List<CalendarEvent> belowDayLong = new ArrayList<CalendarEvent>();
for (CalendarEvent e : events) {
if (e.isAllDay()) {
boolean eventAdded = false;
boolean inProgress = false; // Event adding has started
boolean eventMoving = false;
- List<SimpleDayCell> dayCells = new ArrayList<>();
- List<SimpleDayCell> timeCells = new ArrayList<>();
+ List<SimpleDayCell> dayCells = new ArrayList<SimpleDayCell>();
+ List<SimpleDayCell> timeCells = new ArrayList<SimpleDayCell>();
for (int row = 0; row < monthGrid.getRowCount(); row++) {
if (eventAdded) {
break;
/**
* Sort the events by current sort order
- *
+ *
* @param events
* The events to sort
* @return An array where the events has been sorted
/**
* Sort the event by how long they are
- *
+ *
* @param events
* The events to sort
* @return An array where the events has been sorted
/**
* Returns the default comparator which can compare calendar events by
* duration.
- *
+ *
* @deprecated this returns just one default comparator, but there are
* number of comparators that are used to sort events depending
* on order.
- *
+ *
* @return
*/
@Deprecated
/**
* Set sort strategy for events.
- *
+ *
* @param order
* sort order
*/
/**
* Return currently active sort order.
- *
+ *
* @return current sort order
*/
public EventSortOrder getSortOrder() {
return $entry(function(e) {
var deltaX = e.deltaX ? e.deltaX : -0.5*e.wheelDeltaX;
var deltaY = e.deltaY ? e.deltaY : -0.5*e.wheelDeltaY;
-
+
// IE8 has only delta y
if (isNaN(deltaY)) {
deltaY = -0.5*e.wheelDelta;
}
-
+
@com.vaadin.v7.client.ui.VFilterSelect.JsniUtil::moveScrollFromEvent(*)(widget, deltaX, deltaY, e, e.deltaMode);
});
}-*/;
* <p>
* For internal use only. May be removed or replaced in the future.
*/
- public final List<FilterSelectSuggestion> currentSuggestions = new ArrayList<>();
+ public final List<FilterSelectSuggestion> currentSuggestions = new ArrayList<FilterSelectSuggestion>();
/** For internal use only. May be removed or replaced in the future. */
public boolean immediate;
Unit.PX);
}
- private static Set<Integer> navigationKeyCodes = new HashSet<>();
+ private static Set<Integer> navigationKeyCodes = new HashSet<Integer>();
static {
navigationKeyCodes.add(KeyCodes.KEY_DOWN);
navigationKeyCodes.add(KeyCodes.KEY_UP);
public VOptionGroup() {
super(CLASSNAME);
panel = (Panel) optionsContainer;
- optionsToKeys = new HashMap<>();
- optionsEnabled = new HashMap<>();
+ optionsToKeys = new HashMap<CheckBox, String>();
+ optionsEnabled = new HashMap<CheckBox, Boolean>();
wasMultiselect = isMultiselect();
}
* rebuilt (losing focus) if number of elements or their order is
* changed.
*/
- HashMap<String, CheckBox> keysToOptions = new HashMap<>();
+ HashMap<String, CheckBox> keysToOptions = new HashMap<String, CheckBox>();
for (Map.Entry<CheckBox, String> entry : optionsToKeys.entrySet()) {
keysToOptions.put(entry.getValue(), entry.getKey());
}
- ArrayList<Widget> existingwidgets = new ArrayList<>();
- ArrayList<Widget> newwidgets = new ArrayList<>();
+ ArrayList<Widget> existingwidgets = new ArrayList<Widget>();
+ ArrayList<Widget> newwidgets = new ArrayList<Widget>();
// Get current order of elements
for (Widget wid : panel) {
private CalendarServerRpc rpc = RpcProxy.create(CalendarServerRpc.class,
this);
- private final HashMap<String, String> actionMap = new HashMap<>();
- private HashMap<Object, String> tooltips = new HashMap<>();
+ private final HashMap<String, String> actionMap = new HashMap<String, String>();
+ private HashMap<Object, String> tooltips = new HashMap<Object, String>();
private static final String DROPHANDLER_ACCEPT_CRITERIA_PAINT_TAG = "-ac";
}
private Action[] getActionsBetween(Date start, Date end) {
- List<Action> actions = new ArrayList<>();
- List<String> ids = new ArrayList<>();
+ List<Action> actions = new ArrayList<Action>();
+ List<String> ids = new ArrayList<String>();
for (int i = 0; i < actionKeys.size(); i++) {
String actionKey = actionKeys.get(i);
return actions.toArray(new Action[actions.size()]);
}
- private List<String> actionKeys = new ArrayList<>();
+ private List<String> actionKeys = new ArrayList<String>();
private void updateActionMap(List<CalendarState.Action> actions) {
actionMap.clear();
*/
@Override
public Action[] getActions() {
- List<Action> actions = new ArrayList<>();
+ List<Action> actions = new ArrayList<Action>();
for (int i = 0; i < actionKeys.size(); i++) {
final String actionKey = actionKeys.get(i);
final VCalendarAction a = new VCalendarAction(this, rpc, actionKey);
private List<CalendarEvent> calendarEventListOf(
List<CalendarState.Event> events, boolean format24h) {
- List<CalendarEvent> list = new ArrayList<>(events.size());
+ List<CalendarEvent> list = new ArrayList<CalendarEvent>(events.size());
for (CalendarState.Event event : events) {
final String dateFrom = event.dateFrom;
final String dateTo = event.dateTo;
}
private List<CalendarDay> calendarDayListOf(List<CalendarState.Day> days) {
- List<CalendarDay> list = new ArrayList<>(days.size());
+ List<CalendarDay> list = new ArrayList<CalendarDay>(days.size());
for (CalendarState.Day day : days) {
CalendarDay d = new CalendarDay(day.date, day.localizedDateFormat,
day.dayOfWeek, day.week, day.yearOfWeek);
private boolean disabled = false;
private int height;
private final Element[] slotElements;
- private final List<DateCellSlot> slots = new ArrayList<>();
+ private final List<DateCellSlot> slots = new ArrayList<DateCellSlot>();
private int[] slotElementHeights;
private int startingSlotHeight;
private Date today;
addStyleName("v-calendar-day-times");
- handlers = new LinkedList<>();
+ handlers = new LinkedList<HandlerRegistration>();
// 2 slots / hour
firstHour = weekgrid.getFirstHour();
}
public void recalculateEventWidths() {
- List<DateCellGroup> groups = new ArrayList<>();
+ List<DateCellGroup> groups = new ArrayList<DateCellGroup>();
int count = getWidgetCount();
- List<Integer> handled = new ArrayList<>();
+ List<Integer> handled = new ArrayList<Integer>();
// Iterate through all events and group them. Events that overlaps
// with each other, are added to the same group.
for (DateCellGroup g : groups) {
int col = 0;
int colCount = 0;
- List<Integer> order = new ArrayList<>();
- Map<Integer, Integer> columns = new HashMap<>();
+ List<Integer> order = new ArrayList<Integer>();
+ Map<Integer, Integer> columns = new HashMap<Integer, Integer>();
for (Integer eventIndex : g.getItems()) {
DateCellDayEvent d = (DateCellDayEvent) getWidget(eventIndex);
d.setMoveWidth(width);
public void addEvent(DateCellDayEvent dayEvent) {
Element main = getElement();
int index = 0;
- List<CalendarEvent> events = new ArrayList<>();
+ List<CalendarEvent> events = new ArrayList<CalendarEvent>();
// events are the only widgets in this panel
// slots are just elements
getWidget().totalMatches = 0;
}
- List<FilterSelectSuggestion> newSuggestions = new ArrayList<>();
+ List<FilterSelectSuggestion> newSuggestions = new ArrayList<FilterSelectSuggestion>();
for (final Iterator<?> i = options.getChildIterator(); i.hasNext();) {
final UIDL optionUidl = (UIDL) i.next();
/**
* Handler for listening to changes in the underlying list.
*/
- private Set<DataChangeHandler> changeHandlers = new LinkedHashSet<>();
+ private Set<DataChangeHandler> changeHandlers = new LinkedHashSet<DataChangeHandler>();
/**
* Constructs a new list data source.
if (datasource == null) {
throw new IllegalArgumentException("datasource cannot be null");
}
- ds = new ArrayList<>(datasource);
+ ds = new ArrayList<T>(datasource);
wrapper = new ListWrapper();
}
*/
public ListDataSource(T... rows) {
if (rows == null) {
- ds = new ArrayList<>();
+ ds = new ArrayList<T>();
} else {
- ds = new ArrayList<>(Arrays.asList(rows));
+ ds = new ArrayList<T>(Arrays.asList(rows));
}
wrapper = new ListWrapper();
}
}
private Stream<DataChangeHandler> getHandlers() {
- Set<DataChangeHandler> copy = new LinkedHashSet<>(changeHandlers);
+ Set<DataChangeHandler> copy = new LinkedHashSet<DataChangeHandler>(
+ changeHandlers);
return copy.stream();
}
getLogger().log(Level.INFO,
"Vaadin cleanup deleting {0} expired Vaadin sessions.",
entities.size());
- List<Key> keys = new ArrayList<>();
+ List<Key> keys = new ArrayList<Key>();
for (Entity e : entities) {
keys.add(e.getKey());
}
getLogger().log(Level.INFO,
"Vaadin cleanup deleting {0} expired appengine sessions.",
entities.size());
- List<Key> keys = new ArrayList<>();
+ List<Key> keys = new ArrayList<Key>();
for (Entity e : entities) {
keys.add(e.getKey());
}
endIndex = container.size();
}
- ArrayList<Object> rangeOfIds = new ArrayList<>();
+ ArrayList<Object> rangeOfIds = new ArrayList<Object>();
for (int i = startIndex; i < endIndex; i++) {
Object idByIndex = container.getIdByIndex(i);
if (idByIndex == null) {
public BeanFieldGroup(Class<T> beanType) {
this.beanType = beanType;
- this.defaultValidators = new HashMap<>();
+ this.defaultValidators = new HashMap<Field<?>, BeanValidator>();
}
@Override
if (bean == null) {
setItemDataSource((Item) null);
} else {
- setItemDataSource(new BeanItem<>(bean, beanType));
+ setItemDataSource(new BeanItem<T>(bean, beanType));
}
}
private static <T> BeanFieldGroup<T> createAndBindFields(T bean,
Object objectWithMemberFields, boolean buffered) {
@SuppressWarnings("unchecked")
- BeanFieldGroup<T> beanFieldGroup = new BeanFieldGroup<>(
+ BeanFieldGroup<T> beanFieldGroup = new BeanFieldGroup<T>(
(Class<T>) bean.getClass());
beanFieldGroup.setItemDataSource(bean);
beanFieldGroup.setBuffered(buffered);
private boolean enabled = true;
private boolean readOnly = false;
- private HashMap<Object, Field<?>> propertyIdToField = new HashMap<>();
- private LinkedHashMap<Field<?>, Object> fieldToPropertyId = new LinkedHashMap<>();
- private List<CommitHandler> commitHandlers = new ArrayList<>();
+ 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>();
/**
* The field factory used by builder methods.
/**
* Binds all fields to the properties in the item in use.
- *
+ *
* @since 7.7.5
*/
protected void bindFields() {
*/
protected <T> Property.Transactional<T> wrapInTransactionalProperty(
Property<T> itemProperty) {
- return new TransactionalPropertyWrapper<>(itemProperty);
+ return new TransactionalPropertyWrapper<T>(itemProperty);
}
private void throwIfFieldIsNull(Field<?> field, Object propertyId) {
*/
public Collection<Object> getUnboundPropertyIds() {
if (getItemDataSource() == null) {
- return new ArrayList<>();
+ return new ArrayList<Object>();
}
- List<Object> unboundPropertyIds = new ArrayList<>();
+ List<Object> unboundPropertyIds = new ArrayList<Object>();
unboundPropertyIds.addAll(getItemDataSource().getItemPropertyIds());
unboundPropertyIds.removeAll(propertyIdToField.keySet());
return unboundPropertyIds;
* commits succeeded
*/
private Map<Field<?>, InvalidValueException> commitFields() {
- Map<Field<?>, InvalidValueException> invalidValueExceptions = new HashMap<>();
+ Map<Field<?>, InvalidValueException> invalidValueExceptions = new HashMap<Field<?>, InvalidValueException>();
for (Field<?> f : fieldToPropertyId.keySet()) {
try {
return ((FieldGroupInvalidValueException) getCause())
.getInvalidFields();
}
- return new HashMap<>();
+ return new HashMap<Field<?>, InvalidValueException>();
}
/**
*/
protected static List<java.lang.reflect.Field> getFieldsInDeclareOrder(
Class searchClass) {
- ArrayList<java.lang.reflect.Field> memberFieldInOrder = new ArrayList<>();
+ ArrayList<java.lang.reflect.Field> memberFieldInOrder = new ArrayList<java.lang.reflect.Field>();
while (searchClass != null) {
for (java.lang.reflect.Field memberField : searchClass
++count;
}
- List<SortOrder> order = new ArrayList<>(count);
+ List<SortOrder> order = new ArrayList<SortOrder>(count);
s = this;
do {
* Maps all item ids in the container (including filtered) to their
* corresponding BeanItem.
*/
- private final Map<IDTYPE, BeanItem<BEANTYPE>> itemIdToItem = new HashMap<>();
+ private final Map<IDTYPE, BeanItem<BEANTYPE>> itemIdToItem = new HashMap<IDTYPE, BeanItem<BEANTYPE>>();
/**
* 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<>(bean, model);
+ return bean == null ? null : new BeanItem<BEANTYPE>(bean, model);
}
/**
.getPropertyDescriptors((Class<Object>) propertyType);
for (String subPropertyId : pds.keySet()) {
String qualifiedPropertyId = propertyId + "." + subPropertyId;
- NestedPropertyDescriptor<BEANTYPE> pd = new NestedPropertyDescriptor<>(
+ NestedPropertyDescriptor<BEANTYPE> pd = new NestedPropertyDescriptor<BEANTYPE>(
qualifiedPropertyId, (Class<BEANTYPE>) type);
model.put(qualifiedPropertyId, pd);
model.remove(propertyId);
* Filters that are applied to the container to limit the items visible in
* it
*/
- private Set<Filter> filters = new HashSet<>();
+ private Set<Filter> filters = new HashSet<Filter>();
/**
* The item sorter which is used for sorting the container.
if (getFilters().isEmpty() || propertyId == null) {
return Collections.emptyList();
}
- List<Filter> removedFilters = new LinkedList<>();
+ List<Filter> removedFilters = new LinkedList<Filter>();
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<>();
+ LinkedList<Object> sortables = new LinkedList<Object>();
for (Object propertyId : getContainerPropertyIds()) {
Class<?> propertyType = getType(propertyId);
if (Comparable.class.isAssignableFrom(propertyType)
public void addReadOnlyStatusChangeListener(
Property.ReadOnlyStatusChangeListener listener) {
if (readOnlyStatusChangeListeners == null) {
- readOnlyStatusChangeListeners = new LinkedList<>();
+ readOnlyStatusChangeListeners = new LinkedList<ReadOnlyStatusChangeListener>();
}
readOnlyStatusChangeListeners.add(listener);
}
@Override
public void addValueChangeListener(ValueChangeListener listener) {
if (valueChangeListeners == null) {
- valueChangeListeners = new LinkedList<>();
+ valueChangeListeners = new LinkedList<ValueChangeListener>();
}
valueChangeListeners.add(listener);
*/
static <BT> LinkedHashMap<String, VaadinPropertyDescriptor<BT>> getPropertyDescriptors(
final Class<BT> beanClass) {
- final LinkedHashMap<String, VaadinPropertyDescriptor<BT>> pdMap = new LinkedHashMap<>();
+ final LinkedHashMap<String, VaadinPropertyDescriptor<BT>> pdMap = new LinkedHashMap<String, VaadinPropertyDescriptor<BT>>();
// 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<>(
+ VaadinPropertyDescriptor<BT> vaadinPropertyDescriptor = new MethodPropertyDescriptor<BT>(
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<>(
+ Set<String> subPropertySet = new HashSet<String>(
Arrays.asList(subPropertyIds));
if (0 == subPropertyIds.length) {
*/
public void addNestedProperty(String nestedPropertyId) {
addItemProperty(nestedPropertyId,
- new NestedMethodProperty<>(getBean(), nestedPropertyId));
+ new NestedMethodProperty<BT>(getBean(), nestedPropertyId));
}
/**
* <p>
* Changing the bean will fire value change events for all properties of
* type {@link MethodProperty} or {@link NestedMethodProperty}.
- *
+ *
* @param bean
* The new bean to use for this item, not <code>null</code>
*/
// Create initial order if needed
if (!hierarchical) {
- noChildrenAllowed = new HashSet<>();
- parent = new Hashtable<>();
- children = new Hashtable<>();
- roots = new LinkedHashSet<>(container.getItemIds());
+ noChildrenAllowed = new HashSet<Object>();
+ parent = new Hashtable<Object, Object>();
+ children = new Hashtable<Object, LinkedList<Object>>();
+ roots = new LinkedHashSet<Object>(container.getItemIds());
}
updateHierarchicalWrapper();
// Recreate hierarchy and data structures if missing
if (noChildrenAllowed == null || parent == null || children == null
|| roots == null) {
- noChildrenAllowed = new HashSet<>();
- parent = new Hashtable<>();
- children = new Hashtable<>();
- roots = new LinkedHashSet<>(container.getItemIds());
+ noChildrenAllowed = new HashSet<Object>();
+ parent = new Hashtable<Object, Object>();
+ children = new Hashtable<Object, LinkedList<Object>>();
+ roots = new LinkedHashSet<Object>(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<>();
+ final HashSet<Object> s = new HashSet<Object>();
s.addAll(parent.keySet());
s.addAll(children.keySet());
s.addAll(roots);
Object[] array = roots.toArray();
Arrays.sort(array, basedOnOrderFromWrappedContainer);
- roots = new LinkedHashSet<>();
+ roots = new LinkedHashSet<Object>();
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<>();
+ pcl = new LinkedList<Object>();
children.put(newParentId, pcl);
}
pcl.add(itemId);
if (next == null || first == null || last == null || prev == null) {
first = null;
last = null;
- next = new Hashtable<>();
- prev = new Hashtable<>();
+ next = new Hashtable<Object, Object>();
+ prev = new Hashtable<Object, Object>();
}
// Filter out all the missing items
- final LinkedList<?> l = new LinkedList<>(next.keySet());
+ final LinkedList<?> l = new LinkedList<Object>(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<>();
+ return new ArrayList<Object>();
} else {
- List<Object> itemIds = new ArrayList<>();
+ List<Object> itemIds = new ArrayList<Object>();
itemIds.add(first);
Object current = first;
while (next.containsKey(current)) {
this.container = container;
// Removes any non-sortable property ids
- final List<Object> ids = new ArrayList<>();
- final List<Boolean> orders = new ArrayList<>();
+ final List<Object> ids = new ArrayList<Object>();
+ final List<Boolean> orders = new ArrayList<Boolean>();
final Collection<?> sortable = container
.getSortableContainerPropertyIds();
for (int i = 0; i < propertyId.length; i++) {
static {
- FILE_PROPERTIES = new ArrayList<>();
+ FILE_PROPERTIES = new ArrayList<String>();
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<>();
+ final Collection<File> col = new ArrayList<File>();
for (int i = 0; i < roots.length; i++) {
addItemIds(col, roots[i]);
}
private Filterable filterableContainer = null;
/* Removed properties which are hidden but not actually removed */
- private final Set<Object> removedProperties = new HashSet<>();
+ private final Set<Object> removedProperties = new HashSet<Object>();
/**
* Property implementation for generated properties
@Override
public Collection<?> getItemPropertyIds() {
- Set<Object> wrappedProperties = new LinkedHashSet<>(
+ Set<Object> wrappedProperties = new LinkedHashSet<Object>(
wrappedItem.getItemPropertyIds());
wrappedProperties.removeAll(removedProperties);
wrappedProperties.addAll(propertyGenerators.keySet());
@Deprecated
public GeneratedPropertyContainer(Container.Indexed container) {
wrappedContainer = container;
- propertyGenerators = new HashMap<>();
+ propertyGenerators = new HashMap<Object, PropertyValueGenerator<?>>();
if (wrappedContainer instanceof Sortable) {
sortableContainer = (Sortable) wrappedContainer;
}
if (wrappedContainer instanceof Filterable) {
- activeFilters = new HashMap<>();
+ activeFilters = new HashMap<Filter, List<Filter>>();
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<>(item, propertyId, itemId, generator);
+ return new GeneratedProperty<T>(item, propertyId, itemId, generator);
}
/* Listener functionality */
"Wrapped container is not filterable");
}
- List<Filter> addedFilters = new ArrayList<>();
+ List<Filter> addedFilters = new ArrayList<Filter>();
for (Entry<?, PropertyValueGenerator<?>> entry : propertyGenerators
.entrySet()) {
Object property = entry.getKey();
return;
}
- List<Object> actualSortProperties = new ArrayList<>();
- List<Boolean> actualSortDirections = new ArrayList<>();
+ List<Object> actualSortProperties = new ArrayList<Object>();
+ List<Boolean> actualSortDirections = new ArrayList<Boolean>();
for (int i = 0; i < propertyId.length; ++i) {
Object property = propertyId[i];
return Collections.emptySet();
}
- Set<Object> sortablePropertySet = new HashSet<>(
+ Set<Object> sortablePropertySet = new HashSet<Object>(
sortableContainer.getSortableContainerPropertyIds());
for (Entry<?, PropertyValueGenerator<?>> entry : propertyGenerators
.entrySet()) {
*/
@Override
public Collection<?> getContainerPropertyIds() {
- Set<Object> wrappedProperties = new LinkedHashSet<>(
+ Set<Object> wrappedProperties = new LinkedHashSet<Object>(
wrappedContainer.getContainerPropertyIds());
wrappedProperties.removeAll(removedProperties);
wrappedProperties.addAll(propertyGenerators.keySet());
/**
* Set of IDs of those contained Items that can't have children.
*/
- private final HashSet<Object> noChildrenAllowed = new HashSet<>();
+ private final HashSet<Object> noChildrenAllowed = new HashSet<Object>();
/**
* Mapping from Item ID to parent Item ID.
*/
- private final HashMap<Object, Object> parent = new HashMap<>();
+ private final HashMap<Object, Object> parent = new HashMap<Object, Object>();
/**
* 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<>();
+ private final HashMap<Object, LinkedList<Object>> children = new HashMap<Object, LinkedList<Object>>();
/**
* 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<>();
+ private final LinkedList<Object> roots = new LinkedList<Object>();
/**
* 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<>();
+ pcl = new LinkedList<Object>();
children.put(newParentId, pcl);
}
pcl.add(itemId);
}
// Reset data structures
- filteredRoots = new LinkedList<>();
- filteredChildren = new HashMap<>();
- filteredParent = new HashMap<>();
+ filteredRoots = new LinkedList<Object>();
+ filteredChildren = new HashMap<Object, LinkedList<Object>>();
+ filteredParent = new HashMap<Object, Object>();
if (includeParentsWhenFiltering) {
// Filter so that parents for items that match the filter are also
// included
- HashSet<Object> includedItems = new HashSet<>();
+ HashSet<Object> includedItems = new HashSet<Object>();
for (Object rootId : roots) {
if (filterIncludingParents(rootId, includedItems)) {
filteredRoots.add(rootId);
// match
super.doFilterContainer(hasFilters);
- LinkedHashSet<Object> filteredItemIds = new LinkedHashSet<>(
+ LinkedHashSet<Object> filteredItemIds = new LinkedHashSet<Object>(
getItemIds());
for (Object itemId : filteredItemIds) {
LinkedList<Object> parentToChildrenList = filteredChildren
.get(parentItemId);
if (parentToChildrenList == null) {
- parentToChildrenList = new LinkedList<>();
+ parentToChildrenList = new LinkedList<Object>();
filteredChildren.put(parentItemId, parentToChildrenList);
}
filteredParent.put(childItemId, parentItemId);
/**
* Linked list of ordered Property IDs.
*/
- private ArrayList<Object> propertyIds = new ArrayList<>();
+ private ArrayList<Object> propertyIds = new ArrayList<Object>();
/**
* Property ID to type mapping.
*/
- private Hashtable<Object, Class<?>> types = new Hashtable<>();
+ private Hashtable<Object, Class<?>> types = new Hashtable<Object, Class<?>>();
/**
* 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<>();
+ private Hashtable<Object, Map<Object, Object>> items = new Hashtable<Object, Map<Object, Object>>();
/**
* Set of properties that are read-only.
*/
- private HashSet<Property<?>> readOnlyProperties = new HashSet<>();
+ private HashSet<Property<?>> readOnlyProperties = new HashSet<Property<?>>();
/**
* List of all Property value change event listeners listening all the
}
// store for next rows
if (defaultPropertyValues == null) {
- defaultPropertyValues = new HashMap<>();
+ defaultPropertyValues = new HashMap<Object, Object>();
}
defaultPropertyValues.put(propertyId, defaultValue);
}
@Override
protected void registerNewItem(int index, Object newItemId, Item item) {
- Hashtable<Object, Object> t = new Hashtable<>();
+ Hashtable<Object, Object> t = new Hashtable<Object, Object>();
items.put(newItemId, t);
addDefaultValues(t);
}
@Override
public void addValueChangeListener(Property.ValueChangeListener listener) {
if (propertyValueChangeListeners == null) {
- propertyValueChangeListeners = new LinkedList<>();
+ propertyValueChangeListeners = new LinkedList<Property.ValueChangeListener>();
}
propertyValueChangeListeners.add(listener);
}
Object itemId, Property.ValueChangeListener listener) {
if (listener != null) {
if (singlePropertyValueChangeListeners == null) {
- singlePropertyValueChangeListeners = new Hashtable<>();
+ singlePropertyValueChangeListeners = new Hashtable<Object, Map<Object, List<Property.ValueChangeListener>>>();
}
Map<Object, List<Property.ValueChangeListener>> propertySetToListenerListMap = singlePropertyValueChangeListeners
.get(propertyId);
if (propertySetToListenerListMap == null) {
- propertySetToListenerListMap = new Hashtable<>();
+ propertySetToListenerListMap = new Hashtable<Object, List<Property.ValueChangeListener>>();
singlePropertyValueChangeListeners.put(propertyId,
propertySetToListenerListMap);
}
List<Property.ValueChangeListener> listenerList = propertySetToListenerListMap
.get(itemId);
if (listenerList == null) {
- listenerList = new LinkedList<>();
+ listenerList = new LinkedList<Property.ValueChangeListener>();
propertySetToListenerListMap.put(itemId, listenerList);
}
listenerList.add(listener);
? (ListSet<Object>) ((ListSet<Object>) getAllItemIds()).clone()
: null);
nc.setItemSetChangeListeners(getItemSetChangeListeners() != null
- ? new LinkedList<>(getItemSetChangeListeners()) : null);
+ ? new LinkedList<ItemSetChangeListener>(
+ getItemSetChangeListeners())
+ : null);
nc.propertyIds = propertyIds != null
? (ArrayList<Object>) propertyIds.clone() : null;
nc.setPropertySetChangeListeners(getPropertySetChangeListeners() != null
- ? new LinkedList<>(getPropertySetChangeListeners()) : null);
+ ? new LinkedList<PropertySetChangeListener>(
+ getPropertySetChangeListeners())
+ : null);
nc.propertyValueChangeListeners = propertyValueChangeListeners != null
? (LinkedList<Property.ValueChangeListener>) propertyValueChangeListeners
.clone()
if (items == null) {
nc.items = null;
} else {
- nc.items = new Hashtable<>();
+ nc.items = new Hashtable<Object, Map<Object, Object>>();
for (final Iterator<?> i = items.keySet().iterator(); i
.hasNext();) {
final Object id = i.next();
* 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<>();
+ private HashMap<E, Integer> duplicates = new HashMap<E, Integer>();
public ListSet() {
super();
- itemSet = new HashSet<>();
+ itemSet = new HashSet<E>();
}
public ListSet(Collection<? extends E> c) {
super(c);
- itemSet = new HashSet<>(c.size());
+ itemSet = new HashSet<E>(c.size());
itemSet.addAll(c);
}
public ListSet(int initialCapacity) {
super(initialCapacity);
- itemSet = new HashSet<>(initialCapacity);
+ itemSet = new HashSet<E>(initialCapacity);
}
// Delegate contains operations to the set
@Override
protected void removeRange(int fromIndex, int toIndex) {
- HashSet<E> toRemove = new HashSet<>();
+ HashSet<E> toRemove = new HashSet<E>();
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<>(itemSet);
+ v.itemSet = new HashSet<E>(itemSet);
return v;
}
private void initialize(Class<?> beanClass, String propertyName)
throws IllegalArgumentException {
- List<Method> getMethods = new ArrayList<>();
+ List<Method> getMethods = new ArrayList<Method>();
String lastSimplePropertyName = propertyName;
Class<?> lastClass = beanClass;
/**
* The instance used by this property
- *
+ *
* @return the instance used for fetching the property value
*/
public Object getInstance() {
* <p>
* To be consistent with {@link #setValue(Object)}, this method will fire a
* value change event even if the value stays the same
- *
+ *
* @param instance
* the instance to use
*/
public NestedPropertyDescriptor(String name, Class<BT> beanType)
throws IllegalArgumentException {
this.name = name;
- NestedMethodProperty<?> property = new NestedMethodProperty<>(
+ NestedMethodProperty<?> property = new NestedMethodProperty<BT>(
beanType, name);
this.propertyType = property.getType();
}
@Override
public Property<?> createProperty(BT bean) {
- return new NestedMethodProperty<>(bean, name);
+ return new NestedMethodProperty<BT>(bean, name);
}
}
/**
* Mapping from property id to property.
*/
- private HashMap<Object, Property<?>> map = new HashMap<>();
+ private HashMap<Object, Property<?>> map = new HashMap<Object, Property<?>>();
/**
* List of all property ids to maintain the order.
*/
- private LinkedList<Object> list = new LinkedList<>();
+ private LinkedList<Object> list = new LinkedList<Object>();
/**
* List of property set modification listeners.
public void addPropertySetChangeListener(
Item.PropertySetChangeListener listener) {
if (propertySetChangeListeners == null) {
- propertySetChangeListeners = new LinkedList<>();
+ propertySetChangeListeners = new LinkedList<Item.PropertySetChangeListener>();
}
propertySetChangeListeners.add(listener);
}
if (reverseConverter != null) {
log.finest(getClass().getName() + " created a reverse "
+ reverseConverter.getClass());
- return new ReverseConverter<>(reverseConverter);
+ return new ReverseConverter<PRESENTATION, MODEL>(reverseConverter);
}
log.finest(getClass().getName() + " could not find a converter for "
* SQLContainer instance reference list and dead reference queue. Used for
* the cache flush notification feature.
*/
- private static List<WeakReference<SQLContainer>> allInstances = new ArrayList<>();
- private static ReferenceQueue<SQLContainer> deadInstances = new ReferenceQueue<>();
+ private static List<WeakReference<SQLContainer>> allInstances = new ArrayList<WeakReference<SQLContainer>>();
+ private static ReferenceQueue<SQLContainer> deadInstances = new ReferenceQueue<SQLContainer>();
/**
* 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<>(c, deadInstances));
+ allInstances.add(new WeakReference<SQLContainer>(c, deadInstances));
}
}
@Override
public Collection<?> getItemPropertyIds() {
- Collection<String> ids = new ArrayList<>(properties.size());
+ Collection<String> ids = new ArrayList<String>(properties.size());
for (ColumnProperty cp : properties) {
ids.add(cp.getPropertyId());
}
private int cacheOverlap = pageLength;
/** Item and index caches */
- private final Map<Integer, RowId> itemIndexes = new HashMap<>();
- private final CacheMap<RowId, RowItem> cachedItems = new CacheMap<>();
+ private final Map<Integer, RowId> itemIndexes = new HashMap<Integer, RowId>();
+ private final CacheMap<RowId, RowItem> cachedItems = new CacheMap<RowId, RowItem>();
/** Container properties = column names, data types and statuses */
- 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<>();
+ 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>();
/** Filters (WHERE) and sorters (ORDER BY) */
- private final List<Filter> filters = new ArrayList<>();
- private final List<OrderBy> sorters = new ArrayList<>();
+ private final List<Filter> filters = new ArrayList<Filter>();
+ private final List<OrderBy> sorters = new ArrayList<OrderBy>();
/**
* 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<>();
- private final List<RowItem> addedItems = new ArrayList<>();
- private final List<RowItem> modifiedItems = new ArrayList<>();
+ 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>();
/** List of references to other SQLContainers */
- private final Map<SQLContainer, Reference> references = new HashMap<>();
+ private final Map<SQLContainer, Reference> references = new HashMap<SQLContainer, Reference>();
/** 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<>();
+ List<ColumnProperty> itemProperties = new ArrayList<ColumnProperty>();
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<>();
+ ArrayList<RowId> ids = new ArrayList<RowId>();
ResultSet rs = null;
try {
// Load ALL rows :(
* {@inheritDoc}
*/
public void removeContainerFilters(Object propertyId) {
- ArrayList<Filter> toRemove = new ArrayList<>();
+ ArrayList<Filter> toRemove = new ArrayList<Filter>();
for (Filter f : filters) {
if (f.appliesToProperty(propertyId)) {
toRemove.add(f);
setPageLengthInternal(size);
}
while (rs.next()) {
- List<ColumnProperty> itemProperties = new ArrayList<>();
+ List<ColumnProperty> itemProperties = new ArrayList<ColumnProperty>();
/* 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<>(propertyIds);
+ List<String> propertiesToAdd = new ArrayList<String>(
+ propertyIds);
if (!removedItems.containsKey(id)) {
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
if (!isColumnIdentifierValid(rsmd.getColumnLabel(i))) {
}
private List<RowItem> getFilteredAddedItems() {
- ArrayList<RowItem> filtered = new ArrayList<>(addedItems);
+ ArrayList<RowItem> filtered = new ArrayList<RowItem>(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<>();
+ itemSetChangeListeners = new LinkedList<ItemSetChangeListener>();
}
itemSetChangeListeners.add(listener);
}
}
private void initializeConnections() throws SQLException {
- availableConnections = new HashSet<>(initialConnections);
- reservedConnections = new HashSet<>(initialConnections);
+ availableConnections = new HashSet<Connection>(initialConnections);
+ reservedConnections = new HashSet<Connection>(initialConnections);
for (int i = 0; i < initialConnections; i++) {
availableConnections.add(createConnection());
}
JDBCConnectionPool connectionPool) {
super(connectionPool);
if (primaryKeyColumns == null) {
- primaryKeyColumns = new ArrayList<>();
+ primaryKeyColumns = new ArrayList<String>();
}
if (primaryKeyColumns.contains("")) {
throw new IllegalArgumentException(
/** Row ID change listeners */
private LinkedList<RowIdChangeListener> rowIdChangeListeners;
/** Row ID change events, stored until commit() is called */
- private final List<RowIdChangeEvent> bufferedEvents = new ArrayList<>();
+ private final List<RowIdChangeEvent> bufferedEvents = new ArrayList<RowIdChangeEvent>();
/** 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<>();
+ List<OrderBy> ob = new ArrayList<OrderBy>();
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<>();
+ List<String> names = new ArrayList<String>();
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<>();
+ Map<String, Object> values = new HashMap<String, Object>();
ResultSetMetaData rsmd = genKeys.getMetaData();
int colCount = rsmd.getColumnCount();
if (genKeys.next()) {
}
}
/* Generate new RowId */
- List<Object> newRowId = new ArrayList<>();
+ List<Object> newRowId = new ArrayList<Object>();
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<>();
+ ArrayList<Filter> filtersAndKeys = new ArrayList<Filter>();
if (filters != null) {
filtersAndKeys.addAll(filters);
}
@Override
public void addRowIdChangeListener(RowIdChangeListener listener) {
if (rowIdChangeListeners == null) {
- rowIdChangeListeners = new LinkedList<>();
+ rowIdChangeListeners = new LinkedList<RowIdChangeListener>();
}
rowIdChangeListeners.add(listener);
}
}
protected Map<String, Object> generateColumnToValueMap(RowItem item) {
- Map<String, Object> columnToValueMap = new HashMap<>();
+ Map<String, Object> columnToValueMap = new HashMap<String, Object>();
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<>();
+ Map<String, Object> rowIdentifiers = new HashMap<String, Object>();
for (Object id : item.getItemPropertyIds()) {
ColumnProperty cp = (ColumnProperty) item.getItemProperty(id);
/* Prevent "rownum" usage as a column name if MSSQL or ORACLE */
private String queryString;
- private List<Object> parameters = new ArrayList<>();
- private Map<Integer, Class<?>> dataTypes = new HashMap<>();
+ private List<Object> parameters = new ArrayList<Object>();
+ private Map<Integer, Class<?>> dataTypes = new HashMap<Integer, Class<?>>();
public StatementHelper() {
}
@Deprecated
public class QueryBuilder implements Serializable {
- private static ArrayList<FilterTranslator> filterTranslators = new ArrayList<>();
+ private static ArrayList<FilterTranslator> filterTranslators = new ArrayList<FilterTranslator>();
private static StringDecorator stringDecorator = new StringDecorator("\"",
"\"");
/**
* List of contained validators.
*/
- private final List<Validator> validators = new LinkedList<>();
+ private final List<Validator> validators = new LinkedList<Validator>();
/**
* Construct a composite validator in <code>AND</code> mode without error
return null;
}
- final HashSet<Validator> found = new HashSet<>();
+ final HashSet<Validator> found = new HashSet<Validator>();
for (Validator v : validators) {
if (validatorType.isAssignableFrom(v.getClass())) {
found.add(v);
public SelectionEvent(Object source, Collection<Object> oldSelection,
Collection<Object> newSelection) {
super(source);
- this.oldSelection = new LinkedHashSet<>(oldSelection);
- this.newSelection = new LinkedHashSet<>(newSelection);
+ this.oldSelection = new LinkedHashSet<Object>(oldSelection);
+ this.newSelection = new LinkedHashSet<Object>(newSelection);
}
/**
if (set2.isEmpty()) {
return set1;
} else {
- LinkedHashSet<T> set = new LinkedHashSet<>(set1);
+ LinkedHashSet<T> set = new LinkedHashSet<T>(set1);
set.removeAll(set2);
return set;
}
*/
private class ActiveItemHandler implements Serializable, DataGenerator {
- private final Map<Object, GridValueChangeListener> activeItemMap = new HashMap<>();
- private final KeyMapper<Object> keyMapper = new KeyMapper<>();
- private final Set<Object> droppedItems = new HashSet<>();
+ 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>();
/**
* Registers ValueChangeListeners for given item ids.
* @return collection of item ids
*/
public Collection<Object> getActiveItemIds() {
- return new HashSet<>(activeItemMap.keySet());
+ return new HashSet<Object>(activeItemMap.keySet());
}
/**
* @return collection of value change listeners
*/
public Collection<GridValueChangeListener> getValueChangeListeners() {
- return new HashSet<>(activeItemMap.values());
+ return new HashSet<GridValueChangeListener>(activeItemMap.values());
}
@Override
else {
// Remove obsolete value change listeners.
- Set<Object> keySet = new HashSet<>(
+ Set<Object> keySet = new HashSet<Object>(
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<>();
+ private final Set<DataGenerator> dataGenerators = new LinkedHashSet<DataGenerator>();
private final ActiveItemHandler activeItemHandler = new ActiveItemHandler();
*/
private void insertRowData(final int index, final int count) {
if (rowChanges == null) {
- rowChanges = new ArrayList<>();
+ rowChanges = new ArrayList<Runnable>();
}
if (rowChanges.isEmpty()) {
*/
private void removeRowData(final int index, final int count) {
if (rowChanges == null) {
- rowChanges = new ArrayList<>();
+ rowChanges = new ArrayList<Runnable>();
}
if (rowChanges.isEmpty()) {
*/
public void updateRowData(Object itemId) {
if (updatedItemIds == null) {
- updatedItemIds = new LinkedHashSet<>();
+ updatedItemIds = new LinkedHashSet<Object>();
}
if (updatedItemIds.isEmpty()) {
@Override
public void addValidator(Validator validator) {
if (validators == null) {
- validators = new LinkedList<>();
+ validators = new LinkedList<Validator>();
}
validators.add(validator);
markAsDirty();
}
}
- List<InvalidValueException> validationExceptions = new ArrayList<>();
+ List<InvalidValueException> validationExceptions = new ArrayList<InvalidValueException>();
if (validators != null) {
// Gets all the validation errors
for (Validator v : validators) {
/**
* Keymapper used to map key values.
*/
- protected KeyMapper<Object> itemIdMapper = new KeyMapper<>();
+ protected KeyMapper<Object> itemIdMapper = new KeyMapper<Object>();
/**
* Item icons.
*/
- private final HashMap<Object, Resource> itemIcons = new HashMap<>();
+ private final HashMap<Object, Resource> itemIcons = new HashMap<Object, Resource>();
/**
* Item captions.
*/
- private final HashMap<Object, String> itemCaptions = new HashMap<>();
+ private final HashMap<Object, String> itemCaptions = new HashMap<Object, String>();
/**
* Item caption mode.
// TODO Optimize by adding repaintNotNeeded when applicable
// Converts the key-array to id-set
- final LinkedList<Object> acceptedSelections = new LinkedList<>();
+ final LinkedList<Object> acceptedSelections = new LinkedList<Object>();
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<>();
+ newsel = new LinkedHashSet<Object>();
} else {
- newsel = new LinkedHashSet<>(newsel);
+ newsel = new LinkedHashSet<Object>(newsel);
}
newsel.removeAll(visibleNotSelected);
newsel.addAll(acceptedSelections);
// If the return value is not a set
if (retValue == null) {
- return new HashSet<>();
+ return new HashSet<Object>();
}
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<>();
+ final Set<Object> s = new HashSet<Object>();
if (items.containsId(retValue)) {
s.add(retValue);
}
ConversionException, InvalidValueException {
if (isMultiSelect()) {
if (newFieldValue == null) {
- super.setValue(new LinkedHashSet<>(), repaintIsNotNeeded,
+ super.setValue(new LinkedHashSet<Object>(), repaintIsNotNeeded,
ignoreReadOnly);
} else if (Collection.class
.isAssignableFrom(newFieldValue.getClass())) {
if (isMultiSelect()) {
Collection<Object> valueAsCollection = (Collection<Object>) value;
- List<Object> newSelection = new ArrayList<>(
+ List<Object> newSelection = new ArrayList<Object>(
valueAsCollection.size());
for (Object subValue : valueAsCollection) {
if (containsId(subValue)) {
// Convert the value type
if (multiSelect) {
- final Set<Object> s = new HashSet<>();
+ final Set<Object> s = new HashSet<Object>();
if (oldValue != null) {
s.add(oldValue);
}
setValue(itemId);
} else if (!isSelected(itemId) && itemId != null
&& items.containsId(itemId)) {
- final Set<Object> s = new HashSet<>((Set<?>) getValue());
+ final Set<Object> s = new HashSet<Object>((Set<?>) getValue());
s.add(itemId);
setValue(s);
}
public void unselect(Object itemId) {
if (isSelected(itemId)) {
if (isMultiSelect()) {
- final Set<Object> s = new HashSet<>((Set<?>) getValue());
+ final Set<Object> s = new HashSet<Object>((Set<?>) getValue());
s.remove(itemId);
setValue(s);
} else {
public void addPropertySetChangeListener(
Container.PropertySetChangeListener listener) {
if (propertySetEventListeners == null) {
- propertySetEventListeners = new LinkedHashSet<>();
+ propertySetEventListeners = new LinkedHashSet<PropertySetChangeListener>();
}
propertySetEventListeners.add(listener);
}
public void addItemSetChangeListener(
Container.ItemSetChangeListener listener) {
if (itemSetEventListeners == null) {
- itemSetEventListeners = new LinkedHashSet<>();
+ itemSetEventListeners = new LinkedHashSet<ItemSetChangeListener>();
}
itemSetEventListeners.add(listener);
}
// TODO clean this up - type is either Item.PropertySetChangeNotifier or
// Property.ValueChangeNotifier
- HashSet<Object> captionChangeNotifiers = new HashSet<>();
+ HashSet<Object> captionChangeNotifiers = new HashSet<Object>();
public void addNotifierForItem(Object itemId) {
switch (getItemCaptionMode()) {
*/
private static abstract class AbstractItemSetCriterion
extends ClientSideCriterion {
- protected final Collection<Object> itemIds = new HashSet<>();
+ protected final Collection<Object> itemIds = new HashSet<Object>();
protected AbstractSelect select;
public AbstractItemSetCriterion(AbstractSelect select,
}
protected void readItems(Element design, DesignContext context) {
- Set<String> selected = new HashSet<>();
+ Set<String> selected = new HashSet<String>();
for (Element child : design.children()) {
readItem(child, selected, context);
}
public Calendar(String caption, CalendarEventProvider eventProvider) {
registerRpc(rpc);
setCaption(caption);
- handlers = new HashMap<>();
+ handlers = new HashMap<String, EventListener>();
setDefaultHandlers();
currentCalendar.setTime(new Date());
setEventProvider(eventProvider);
events = getEventProvider().getEvents(firstDateToShow, lastDateToShow);
cacheMinMaxTimeOfDay(events);
- List<CalendarState.Event> calendarStateEvents = new ArrayList<>();
+ List<CalendarState.Event> calendarStateEvents = new ArrayList<CalendarState.Event>();
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<>();
+ Map<CalendarDateRange, Set<Action>> actionMap = new HashMap<CalendarDateRange, Set<Action>>();
- List<CalendarState.Day> days = new ArrayList<>();
+ List<CalendarState.Day> days = new ArrayList<CalendarState.Day>();
// 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<>(
+ Set<Action> actionSet = new LinkedHashSet<Action>(
Arrays.asList(actions));
actionMap.put(range, actionSet);
}
getTimeZone());
Action[] actions = actionHandler.getActions(range, this);
if (actions != null) {
- Set<Action> actionSet = new LinkedHashSet<>(Arrays.asList(actions));
+ Set<Action> actionSet = new LinkedHashSet<Action>(
+ Arrays.asList(actions));
actionMap.put(range, actionSet);
}
}
return null;
}
- List<CalendarState.Action> calendarActions = new ArrayList<>();
+ List<CalendarState.Action> calendarActions = new ArrayList<CalendarState.Action>();
SimpleDateFormat formatter = new SimpleDateFormat(
DateConstants.ACTION_DATE_FORMAT_PATTERN);
@Override
public TargetDetails translateDropTargetDetails(
Map<String, Object> clientVariables) {
- Map<String, Object> serverVariables = new HashMap<>();
+ Map<String, Object> serverVariables = new HashMap<String, Object>();
if (clientVariables.containsKey("dropSlotIndex")) {
int slotIndex = (Integer) clientVariables.get("dropSlotIndex");
public void addActionHandler(Handler actionHandler) {
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<>();
- actionMapper = new KeyMapper<>();
+ actionHandlers = new LinkedList<Handler>();
+ actionMapper = new KeyMapper<Action>();
}
if (!actionHandlers.contains(actionHandler)) {
actionHandlers.add(actionHandler);
protected List<?> getFilteredOptions() {
if (!isFilteringNeeded()) {
prevfilterstring = null;
- filteredOptions = new LinkedList<>(getItemIds());
+ filteredOptions = new LinkedList<Object>(getItemIds());
return filteredOptions;
}
}
prevfilterstring = filterstring;
- filteredOptions = new LinkedList<>();
+ filteredOptions = new LinkedList<Object>();
for (final Iterator<?> it = items.iterator(); it.hasNext();) {
final Object itemId = it.next();
String caption = getItemCaption(itemId);
private TimeZone timeZone = null;
- private static Map<Resolution, String> variableNameForResolution = new HashMap<>();
+ private static Map<Resolution, String> variableNameForResolution = new HashMap<Resolution, String>();
private String dateOutOfRangeMessage = "Date is out of allowed range";
// Gets the new date in parts
boolean hasChanges = false;
- Map<Resolution, Integer> calendarFieldChanges = new HashMap<>();
+ Map<Resolution, Integer> calendarFieldChanges = new HashMap<Resolution, Integer>();
for (Resolution r : Resolution
.getResolutionsHigherOrEqualTo(resolution)) {
/**
* Ordered list of property ids in this editor.
*/
- private final LinkedList<Object> propertyIds = new LinkedList<>();
+ private final LinkedList<Object> propertyIds = new LinkedList<Object>();
/**
* Current buffered source exception.
/**
* Mapping from propertyName to corresponding field.
*/
- private final HashMap<Object, Field<?>> fields = new HashMap<>();
+ private final HashMap<Object, Field<?>> fields = new HashMap<Object, Field<?>>();
/**
* Form may act as an Item, its own properties are stored here.
*/
- private final HashMap<Object, Property<?>> ownProperties = new HashMap<>();
+ private final HashMap<Object, Property<?>> ownProperties = new HashMap<Object, Property<?>>();
/**
* Field factory for this form.
}
} catch (final Buffered.SourceException e) {
if (problems == null) {
- problems = new LinkedList<>();
+ problems = new LinkedList<SourceException>();
}
problems.add(e);
}
fields.get(i.next()).discard();
} catch (final Buffered.SourceException e) {
if (problems == null) {
- problems = new LinkedList<>();
+ problems = new LinkedList<SourceException>();
}
problems.add(e);
}
if (data instanceof Item) {
item = (Item) data;
} else if (data != null) {
- item = new BeanItem<>(data);
+ item = new BeanItem<Object>(data);
}
// Sets the datasource to form
* the visibleProperties to set.
*/
public void setVisibleItemProperties(Object... visibleProperties) {
- LinkedList<Object> v = new LinkedList<>();
+ LinkedList<Object> v = new LinkedList<Object>();
for (int i = 0; i < visibleProperties.length; i++) {
v.add(visibleProperties[i]);
}
* client. Details components get destroyed once they scroll out of
* view.
*/
- private final Map<Object, Component> itemIdToDetailsComponent = new HashMap<>();
+ private final Map<Object, Component> itemIdToDetailsComponent = new HashMap<Object, Component>();
/**
* Set of item ids that got <code>null</code> from DetailsGenerator when
* {@link DetailsGenerator#getDetails(RowReference)} was called.
*/
- private final Set<Object> emptyDetails = new HashSet<>();
+ private final Set<Object> emptyDetails = new HashSet<Object>();
/**
* Set of item IDs for all open details rows. Contains even the ones
* that are not currently visible on the client.
*/
- private final Set<Object> openDetails = new HashSet<>();
+ private final Set<Object> openDetails = new HashSet<Object>();
public DetailComponentManager(Grid grid) {
this(grid, DetailsGenerator.NULL);
* Recreates all visible details components.
*/
public void refreshDetails() {
- Set<Object> visibleItemIds = new HashSet<>(
+ Set<Object> visibleItemIds = new HashSet<Object>(
itemIdToDetailsComponent.keySet());
for (Object itemId : visibleItemIds) {
destroyDetails(itemId);
@Override
protected void bindFields() {
- List<Field<?>> fields = new ArrayList<>(getFields());
+ List<Field<?>> fields = new ArrayList<Field<?>>(getFields());
Item itemDataSource = getItemDataSource();
if (itemDataSource == null) {
private CommitException cause;
- private Set<Column> errorColumns = new HashSet<>();
+ private Set<Column> errorColumns = new HashSet<Column>();
private String userErrorMessage;
@Deprecated
public static abstract class AbstractSelectionModel extends
AbstractGridExtension implements SelectionModel, DataGenerator {
- protected final LinkedHashSet<Object> selection = new LinkedHashSet<>();
+ protected final LinkedHashSet<Object> selection = new LinkedHashSet<Object>();
@Override
public boolean isSelected(final Object itemId) {
@Override
public Collection<Object> getSelectedRows() {
- return new ArrayList<>(selection);
+ return new ArrayList<Object>(selection);
}
@Override
@Override
public void select(List<String> rowKeys) {
- List<Object> items = new ArrayList<>();
+ List<Object> items = new ArrayList<Object>();
for (String rowKey : rowKeys) {
items.add(getItemId(rowKey));
}
@Override
public void deselect(List<String> rowKeys) {
- List<Object> items = new ArrayList<>();
+ List<Object> items = new ArrayList<Object>();
for (String rowKey : rowKeys) {
items.add(getItemId(rowKey));
}
final boolean selectionWillChange = !selection.containsAll(itemIds)
&& selection.size() < selectionLimit;
if (selectionWillChange) {
- final HashSet<Object> oldSelection = new HashSet<>(selection);
+ final HashSet<Object> oldSelection = new HashSet<Object>(
+ selection);
if (selection.size() + itemIds.size() >= selectionLimit) {
// Add one at a time if there's a risk of overflow
Iterator<?> iterator = itemIds.iterator();
final boolean hasCommonElements = !Collections.disjoint(itemIds,
selection);
if (hasCommonElements) {
- final HashSet<Object> oldSelection = new HashSet<>(selection);
+ final HashSet<Object> oldSelection = new HashSet<Object>(
+ selection);
selection.removeAll(itemIds);
fireSelectionEvent(oldSelection, selection);
}
checkItemIdsExist(itemIds);
boolean changed = false;
- Set<Object> selectedRows = new HashSet<>(itemIds);
+ Set<Object> selectedRows = new HashSet<Object>(itemIds);
final Collection<Object> oldSelection = getSelectedRows();
Set<Object> added = getDifference(selectedRows, selection);
if (!added.isEmpty()) {
*/
private static Set<Object> getDifference(Set<Object> set1,
Set<Object> set2) {
- Set<Object> diff = new HashSet<>(set1);
+ Set<Object> diff = new HashSet<Object>(set1);
diff.removeAll(set2);
return diff;
}
private RowState rowState = new RowState();
protected StaticSection<?> section;
- private Map<Object, CELLTYPE> cells = new LinkedHashMap<>();
- private Map<Set<CELLTYPE>, CELLTYPE> cellGroups = new HashMap<>();
+ private Map<Object, CELLTYPE> cells = new LinkedHashMap<Object, CELLTYPE>();
+ private Map<Set<CELLTYPE>, CELLTYPE> cellGroups = new HashMap<Set<CELLTYPE>, CELLTYPE>();
protected StaticRow(StaticSection<?> section) {
this.section = section;
public CELLTYPE join(Object... propertyIds) {
assert propertyIds.length > 1 : "You need to merge at least 2 properties";
- Set<CELLTYPE> cells = new HashSet<>();
+ Set<CELLTYPE> cells = new HashSet<CELLTYPE>();
for (int i = 0; i < propertyIds.length; ++i) {
cells.add(getCell(propertyIds[i]));
}
public CELLTYPE join(CELLTYPE... cells) {
assert cells.length > 1 : "You need to merge at least 2 cells";
- return join(new HashSet<>(Arrays.asList(cells)));
+ return join(new HashSet<CELLTYPE>(Arrays.asList(cells)));
}
protected CELLTYPE join(Set<CELLTYPE> cells) {
// Create new cell data for the group
CELLTYPE newCell = createCell();
- Set<String> columnGroup = new HashSet<>();
+ Set<String> columnGroup = new HashSet<String>();
for (CELLTYPE cell : cells) {
columnGroup.add(cell.getColumnId());
}
*/
protected void writeDesign(Element trElement,
DesignContext designContext) {
- Set<CELLTYPE> visited = new HashSet<>();
+ Set<CELLTYPE> visited = new HashSet<CELLTYPE>();
for (Grid.Column column : section.grid.getColumns()) {
CELLTYPE cell = getCell(column.getPropertyId());
if (visited.contains(cell)) {
int colspan = DesignAttributeHandler.readAttribute(
"colspan", element.attributes(), 1, int.class);
- Set<CELLTYPE> cells = new HashSet<>();
+ Set<CELLTYPE> cells = new HashSet<CELLTYPE>();
for (int c = 0; c < colspan; ++c) {
cells.add(getCell(section.grid.getColumns()
.get(columnIndex + c).getPropertyId()));
}
protected Grid grid;
- protected List<ROWTYPE> rows = new ArrayList<>();
+ protected List<ROWTYPE> rows = new ArrayList<ROWTYPE>();
/**
* Sets the visibility of the whole section.
/**
* Property id to column instance mapping
*/
- private final Map<Object, Column> columns = new HashMap<>();
+ private final Map<Object, Column> columns = new HashMap<Object, Column>();
/**
* Key generator for column server-to-client communication
*/
- private final KeyMapper<Object> columnKeys = new KeyMapper<>();
+ private final KeyMapper<Object> columnKeys = new KeyMapper<Object>();
/**
* The current sort order
*/
- private final List<SortOrder> sortOrder = new ArrayList<>();
+ private final List<SortOrder> sortOrder = new ArrayList<SortOrder>();
/**
* Property listener for listening to changes in data source properties.
event.getContainer().getContainerPropertyIds());
// Find columns that need to be removed.
- List<Column> removedColumns = new LinkedList<>();
+ List<Column> removedColumns = new LinkedList<Column>();
for (Object propertyId : columns.keySet()) {
if (!properties.contains(propertyId)) {
removedColumns.add(getColumn(propertyId));
datasourceExtension.columnsRemoved(removedColumns);
// Add new columns
- List<Column> addedColumns = new LinkedList<>();
+ List<Column> addedColumns = new LinkedList<Column>();
for (Object propertyId : properties) {
if (!columns.containsKey(propertyId)) {
addedColumns.add(appendColumn(propertyId));
* Poperty ID to Field mapping that stores editor fields set by
* {@link #setEditorField(Object, Field)}.
*/
- private Map<Object, Field<?>> editorFields = new HashMap<>();
+ private Map<Object, Field<?>> editorFields = new HashMap<Object, Field<?>>();
private CellStyleGenerator cellStyleGenerator;
private RowStyleGenerator rowStyleGenerator;
private DetailComponentManager detailComponentManager = null;
- private Set<Component> extensionComponents = new HashSet<>();
+ private Set<Component> extensionComponents = new HashSet<Component>();
private static final Method SELECTION_CHANGE_METHOD = ReflectTools
.findMethod(SelectionListener.class, "select",
boolean userOriginated) {
assert columnIds.length == directions.length;
- List<SortOrder> order = new ArrayList<>(columnIds.length);
+ List<SortOrder> order = new ArrayList<SortOrder>(
+ columnIds.length);
for (int i = 0; i < columnIds.length; i++) {
Object propertyId = getPropertyIdByColumnId(columnIds[i]);
order.add(new SortOrder(propertyId, directions[i]));
errorMessage = event.getUserErrorMessage();
- errorColumnIds = new ArrayList<>();
+ errorColumnIds = new ArrayList<String>();
for (Column column : event.getErrorColumns()) {
errorColumnIds.add(column.state.id);
}
* @return unmodifiable copy of current columns in visual order
*/
public List<Column> getColumns() {
- List<Column> columns = new ArrayList<>();
+ List<Column> columns = new ArrayList<Column>();
for (String columnId : getState(false).columnOrder) {
columns.add(getColumnByColumnId(columnId));
}
// Inform the data provider of this new column.
Column column = getColumn(propertyId);
- List<Column> addedColumns = new ArrayList<>();
+ List<Column> addedColumns = new ArrayList<Column>();
addedColumns.add(column);
datasourceExtension.columnsAdded(addedColumns);
* Removes all columns from this Grid.
*/
public void removeAllColumns() {
- List<Column> removed = new ArrayList<>(columns.values());
- Set<Object> properties = new HashSet<>(columns.keySet());
+ List<Column> removed = new ArrayList<Column>(columns.values());
+ Set<Object> properties = new HashSet<Object>(columns.keySet());
for (Object propertyId : properties) {
removeColumn(propertyId);
}
"There is no column for given property id " + propertyId);
}
- List<Column> removed = new ArrayList<>();
+ List<Column> removed = new ArrayList<Column>();
removed.add(getColumn(propertyId));
internalRemoveColumn(propertyId);
datasourceExtension.columnsRemoved(removed);
"The propertyIds array contains duplicates: "
+ SharedUtil.getDuplicates(propertyIds));
}
- Set<?> removePids = new HashSet<>(columns.keySet());
+ Set<?> removePids = new HashSet<Object>(columns.keySet());
removePids.removeAll(Arrays.asList(propertyIds));
for (Object removePid : removePids) {
removeColumn(removePid);
}
- Set<?> addPids = new HashSet<>(Arrays.asList(propertyIds));
+ Set<?> addPids = new HashSet<Object>(Arrays.asList(propertyIds));
addPids.removeAll(columns.keySet());
for (Object propertyId : addPids) {
addColumn(propertyId);
"The propertyIds array contains duplicates: "
+ SharedUtil.getDuplicates(propertyIds));
}
- List<String> columnOrder = new ArrayList<>();
+ List<String> columnOrder = new ArrayList<String>();
for (Object propertyId : propertyIds) {
if (columns.containsKey(propertyId)) {
columnOrder.add(columnKeys.key(propertyId));
getState().sortColumns = new String[] {};
getState(false).sortDirs = new SortDirection[] {};
}
- fireEvent(new SortEvent(this, new ArrayList<>(sortOrder),
+ fireEvent(new SortEvent(this, new ArrayList<SortOrder>(sortOrder),
userOriginated));
} else {
throw new IllegalStateException(
public Iterator<Component> iterator() {
// This is a hash set to avoid adding header/footer components inside
// merged cells multiple times
- LinkedHashSet<Component> componentList = new LinkedHashSet<>();
+ LinkedHashSet<Component> componentList = new LinkedHashSet<Component>();
Header header = getHeader();
for (int i = 0; i < header.getRowCount(); ++i) {
public class OptionGroup extends AbstractSelect
implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
- private Set<Object> disabledItemIds = new HashSet<>();
+ private Set<Object> disabledItemIds = new HashSet<Object>();
public OptionGroup() {
super();
/**
* Keymapper for column ids.
*/
- private final KeyMapper<Object> columnIdMap = new KeyMapper<>();
+ private final KeyMapper<Object> columnIdMap = new KeyMapper<Object>();
/**
* Holds visible column propertyIds - in order.
*/
- private LinkedList<Object> visibleColumns = new LinkedList<>();
+ private LinkedList<Object> visibleColumns = new LinkedList<Object>();
/**
* Holds noncollapsible columns.
*/
- private HashSet<Object> noncollapsibleColumns = new HashSet<>();
+ private HashSet<Object> noncollapsibleColumns = new HashSet<Object>();
/**
* Holds propertyIds of currently collapsed columns.
*/
- private final HashSet<Object> collapsedColumns = new HashSet<>();
+ private final HashSet<Object> collapsedColumns = new HashSet<Object>();
/**
* Holds headers for visible columns (by propertyId).
*/
- private final HashMap<Object, String> columnHeaders = new HashMap<>();
+ private final HashMap<Object, String> columnHeaders = new HashMap<Object, String>();
/**
* Holds footers for visible columns (by propertyId).
*/
- private final HashMap<Object, String> columnFooters = new HashMap<>();
+ private final HashMap<Object, String> columnFooters = new HashMap<Object, String>();
/**
* Holds icons for visible columns (by propertyId).
*/
- private final HashMap<Object, Resource> columnIcons = new HashMap<>();
+ private final HashMap<Object, Resource> columnIcons = new HashMap<Object, Resource>();
/**
* Holds alignments for visible columns (by propertyId).
*/
- private HashMap<Object, Align> columnAlignments = new HashMap<>();
+ private HashMap<Object, Align> columnAlignments = new HashMap<Object, Align>();
/**
* Holds column widths in pixels for visible columns (by propertyId).
*/
- private final HashMap<Object, Integer> columnWidths = new HashMap<>();
+ private final HashMap<Object, Integer> columnWidths = new HashMap<Object, Integer>();
/**
* Holds column expand rations for visible columns (by propertyId).
*/
- private final HashMap<Object, Float> columnExpandRatios = new HashMap<>();
+ private final HashMap<Object, Float> columnExpandRatios = new HashMap<Object, Float>();
/**
* Holds column generators
*/
- private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<>();
+ private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<Object, ColumnGenerator>();
/**
* Holds value of property pageLength. 0 disables paging.
private RowGenerator rowGenerator = null;
- private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<>();
+ private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<Field<?>, Property<?>>();
private boolean painted = false;
- private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<>();
+ private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<Object, Converter<String, Object>>();
/**
* Set to true if the client-side should be informed that the key mapper has
*/
private boolean keyMapperReset;
- private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<>();
+ private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<Throwable>();
private boolean isBeingPainted;
"Can not set visible columns to null value");
}
- final LinkedList<Object> newVC = new LinkedList<>();
+ final LinkedList<Object> newVC = new LinkedList<Object>();
// 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<>();
+ final HashMap<Object, Align> newCA = new HashMap<Object, Align>();
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<>();
+ final LinkedList<Object> newOrder = new LinkedList<Object>();
for (int i = 0; i < columnOrder.length; i++) {
if (columnOrder[i] != null
&& visibleColumns.contains(columnOrder[i])) {
if (replaceListeners) {
// initialize the listener collections, this should only be done if
// the entire cache is refreshed (through refreshRenderedCells)
- listenedProperties = new HashSet<>();
- visibleComponents = new HashSet<>();
+ listenedProperties = new HashSet<Property<?>>();
+ visibleComponents = new HashSet<Component>();
}
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<>();
+ final LinkedList<Object> availableCols = new LinkedList<Object>();
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<>();
+ List<Object> visibleIds = new ArrayList<Object>();
if (generated.isEmpty()) {
visibleIds.addAll(newDataSource.getContainerPropertyIds());
} else {
newDataSource = new IndexedContainer();
}
if (visibleIds == null) {
- visibleIds = new ArrayList<>();
+ visibleIds = new ArrayList<Object>();
}
// Retain propertyValueConverters if their corresponding ids are
if (propertyValueConverters != null) {
Collection<?> newPropertyIds = newDataSource
.getContainerPropertyIds();
- LinkedList<Object> retainableValueConverters = new LinkedList<>();
+ LinkedList<Object> retainableValueConverters = new LinkedList<Object>();
for (Object propertyId : newPropertyIds) {
Converter<String, ?> converter = getConverter(propertyId);
if (converter != null) {
}
// don't add the same id twice
- Collection<Object> col = new LinkedList<>();
+ Collection<Object> col = new LinkedList<Object>();
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<>();
+ LinkedHashSet<Object> ids = new LinkedHashSet<Object>();
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<>(
+ HashSet<Object> newValue = new LinkedHashSet<Object>(
(Collection<Object>) getValue());
if (variables.containsKey("clearSelections")) {
}
private Set<Object> getCurrentlyRenderedItemIds() {
- HashSet<Object> ids = new HashSet<>();
+ HashSet<Object> ids = new HashSet<Object>();
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<>(variables);
+ variables = new HashMap<String, Object>(variables);
variables.remove("selected");
}
&& variables.containsKey("selected")
&& multiSelectMode == MultiSelectMode.DEFAULT) {
handleSelectedItems(variables);
- variables = new HashMap<>(variables);
+ variables = new HashMap<String, Object>(variables);
variables.remove("selected");
}
try {
final Object[] ids = (Object[]) variables
.get("collapsedcolumns");
- Set<Object> idSet = new HashSet<>();
+ Set<Object> idSet = new HashSet<Object>();
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<>();
+ final HashSet<Object> collapsedCols = new HashSet<Object>();
for (Object colId : visibleColumns) {
if (isColumnCollapsed(colId)) {
collapsedCols.add(colId);
private void paintVisibleColumnOrder(PaintTarget target) {
// Visible column order
- final ArrayList<String> visibleColOrder = new ArrayList<>();
+ final ArrayList<String> visibleColOrder = new ArrayList<String>();
for (Object columnId : visibleColumns) {
if (!isColumnCollapsed(columnId)) {
visibleColOrder.add(columnIdMap.key(columnId));
}
private Set<Action> findAndPaintBodyActions(PaintTarget target) {
- Set<Action> actionSet = new LinkedHashSet<>();
+ Set<Action> actionSet = new LinkedHashSet<Action>();
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<>();
+ final ArrayList<String> keys = new ArrayList<String>();
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<>();
+ LinkedList<String> selectedKeys = new LinkedList<String>();
if (isMultiSelect()) {
HashSet<?> sel = new HashSet<Object>((Set<?>) getValue());
Collection<?> vids = getVisibleItemIds();
// Actions
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<>();
+ final ArrayList<String> keys = new ArrayList<String>();
for (Handler ah : actionHandlers) {
final Action[] aa = ah.getActions(itemId, this);
if (aa != null) {
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<>();
- actionMapper = new KeyMapper<>();
+ actionHandlers = new LinkedList<Handler>();
+ actionMapper = new KeyMapper<Action>();
}
if (!actionHandlers.contains(actionHandler)) {
@Override
public Collection<?> getVisibleItemIds() {
- final LinkedList<Object> visible = new LinkedList<>();
+ final LinkedList<Object> visible = new LinkedList<Object>();
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<>(visibleColumns);
+ LinkedList<Object> newVisibleColumns = new LinkedList<Object>(
+ visibleColumns);
for (Iterator<Object> iterator = newVisibleColumns.iterator(); iterator
.hasNext();) {
Object id = iterator.next();
if (colgroup != null) {
int i = 0;
- List<Object> pIds = new ArrayList<>();
+ List<Object> pIds = new ArrayList<Object>();
for (Element col : colgroup.children()) {
if (!col.tagName().equals("col")) {
throw new DesignException("invalid column");
return;
}
- Set<String> selected = new HashSet<>();
+ Set<String> selected = new HashSet<String>();
for (Element tr : tbody.children()) {
readItem(tr, selected, context);
}
/**
* Item icons alt texts.
*/
- private final HashMap<Object, String> itemIconAlts = new HashMap<>();
+ private final HashMap<Object, String> itemIconAlts = new HashMap<Object, String>();
/**
* Set of expanded nodes.
*/
- private HashSet<Object> expanded = new HashSet<>();
+ private HashSet<Object> expanded = new HashSet<Object>();
/**
* List of action handlers.
boolean result = true;
// Initial stack
- final Stack<Object> todo = new Stack<>();
+ final Stack<Object> todo = new Stack<Object>();
todo.add(startItemId);
// Expands recursively
boolean result = true;
// Initial stack
- final Stack<Object> todo = new Stack<>();
+ final Stack<Object> todo = new Stack<Object>();
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<>(variables);
+ variables = new HashMap<String, Object>(variables);
variables.remove("selected");
}
if (variables.containsKey("selected") && isMultiSelect()
&& multiSelectMode == MultiSelectMode.DEFAULT) {
handleSelectedItems(variables);
- variables = new HashMap<>(variables);
+ variables = new HashMap<String, Object>(variables);
variables.remove("selected");
}
final String[] ka = (String[]) variables.get("selected");
// Converts the key-array to id-set
- final LinkedList<Object> s = new LinkedList<>();
+ final LinkedList<Object> s = new LinkedList<Object>();
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<>();
+ final Set<Action> actionSet = new LinkedHashSet<Action>();
// rendered selectedKeys
- LinkedList<String> selectedKeys = new LinkedList<>();
+ LinkedList<String> selectedKeys = new LinkedList<String>();
- final LinkedList<String> expandedKeys = new LinkedList<>();
+ final LinkedList<String> expandedKeys = new LinkedList<String>();
// Iterates through hierarchical tree using a stack of iterators
- final Stack<Iterator<?>> iteratorStack = new Stack<>();
+ final Stack<Iterator<?>> iteratorStack = new Stack<Iterator<?>>();
Collection<?> ids;
if (partialUpdate) {
ids = getChildren(expandedItemId);
* by right clicking on the Tree body
*/
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<>();
+ final ArrayList<String> keys = new ArrayList<String>();
for (Handler ah : actionHandlers) {
// Getting action for the null item, which in this case
// Actions
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<>();
+ final ArrayList<String> keys = new ArrayList<String>();
final Iterator<Action.Handler> ahi = actionHandlers
.iterator();
while (ahi.hasNext()) {
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<>();
- actionMapper = new KeyMapper<>();
+ actionHandlers = new LinkedList<Handler>();
+ actionMapper = new KeyMapper<Action>();
}
if (!actionHandlers.contains(actionHandler)) {
@Override
public Collection<?> getVisibleItemIds() {
- final LinkedList<Object> visible = new LinkedList<>();
+ final LinkedList<Object> visible = new LinkedList<Object>();
// Iterates trough hierarchical tree using a stack of iterators
- final Stack<Iterator<?>> iteratorStack = new Stack<>();
+ final Stack<Iterator<?>> iteratorStack = new Stack<Iterator<?>>();
final Collection<?> ids = rootItemIds();
if (ids != null) {
iteratorStack.push(ids.iterator());
}
private void cleanupExpandedItems() {
- Set<Object> removedItemIds = new HashSet<>();
+ Set<Object> removedItemIds = new HashSet<Object>();
for (Object expandedItemId : expanded) {
if (getItem(expandedItemId) == null) {
removedItemIds.add(expandedItemId);
*/
private class HierarchicalStrategy extends AbstractStrategy {
- private final HashSet<Object> openItems = new HashSet<>();
+ private final HashSet<Object> openItems = new HashSet<Object>();
@Override
public boolean isNodeOpen(Object itemId) {
*/
private List<Object> getPreOrder() {
if (preOrder == null) {
- preOrder = new ArrayList<>();
+ preOrder = new ArrayList<Object>();
Collection<?> rootItemIds = getContainerDataSource()
.rootItemIds();
for (Object id : rootItemIds) {
@Override
protected List<Object> getItemIds(int firstIndex, int rows) {
- List<Object> itemIds = new ArrayList<>();
+ List<Object> itemIds = new ArrayList<Object>();
for (int i = firstIndex; i < firstIndex + rows; i++) {
itemIds.add(getIdByIndex(i));
}
return;
}
- Set<String> selected = new HashSet<>();
- Stack<Object> parents = new Stack<>();
+ Set<String> selected = new HashSet<String>();
+ Stack<Object> parents = new Stack<Object>();
int lastDepth = -1;
for (Element tr : tbody.children()) {
*/
public void addProgressListener(ProgressListener listener) {
if (progressListeners == null) {
- progressListeners = new LinkedHashSet<>();
+ progressListeners = new LinkedHashSet<ProgressListener>();
}
progressListeners.add(listener);
}
import com.vaadin.v7.ui.components.calendar.event.CalendarEvent;
import com.vaadin.v7.ui.components.calendar.event.CalendarEvent.EventChangeListener;
import com.vaadin.v7.ui.components.calendar.event.CalendarEvent.EventChangeNotifier;
-import com.vaadin.v7.ui.components.calendar.event.CalendarEventProvider;
import com.vaadin.v7.ui.components.calendar.event.CalendarEventProvider.EventSetChangeNotifier;
/**
/**
* Listeners attached to the container
*/
- private final List<EventSetChangeListener> eventSetChangeListeners = new LinkedList<>();
- private final List<EventChangeListener> eventChangeListeners = new LinkedList<>();
+ private final List<EventSetChangeListener> eventSetChangeListeners = new LinkedList<EventSetChangeListener>();
+ private final List<EventChangeListener> eventChangeListeners = new LinkedList<EventChangeListener>();
/**
* The event cache contains the events previously created by
* {@link #getEvents(Date, Date)}
*/
- private final List<CalendarEvent> eventCache = new LinkedList<>();
+ private final List<CalendarEvent> eventCache = new LinkedList<CalendarEvent>();
/**
* The container used as datasource
private Date end;
private Date start;
private String styleName;
- private transient List<EventChangeListener> listeners = new ArrayList<>();
+ private transient List<EventChangeListener> listeners = new ArrayList<EventChangeListener>();
private boolean isAllDay;
public class BasicEventProvider implements CalendarEditableEventProvider,
EventSetChangeNotifier, CalendarEvent.EventChangeListener {
- protected List<CalendarEvent> eventList = new ArrayList<>();
+ protected List<CalendarEvent> eventList = new ArrayList<CalendarEvent>();
- private List<EventSetChangeListener> listeners = new ArrayList<>();
+ private List<EventSetChangeListener> listeners = new ArrayList<EventSetChangeListener>();
/*
* (non-Javadoc)
*/
@Override
public List<CalendarEvent> getEvents(Date startDate, Date endDate) {
- ArrayList<CalendarEvent> activeEvents = new ArrayList<>();
+ ArrayList<CalendarEvent> activeEvents = new ArrayList<CalendarEvent>();
for (CalendarEvent ev : eventList) {
long from = startDate.getTime();
/*
* 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
/**
* A component that represents a color selection grid within a color picker.
- *
+ *
* @since 7.0.0
*/
@Deprecated
-public class ColorPickerGrid extends AbstractComponent implements
- ColorSelector {
+public class ColorPickerGrid extends AbstractComponent
+ implements ColorSelector {
private static final String STYLENAME = "v-colorpicker-grid";
private Color[][] colorGrid = new Color[1][1];
/** The changed colors. */
- private final Map<Point, Color> changedColors = new HashMap<>();
+ private final Map<Point, Color> changedColors = new HashMap<Point, Color>();
/**
* Instantiates a new color picker grid.
/**
* Instantiates a new color picker grid.
- *
+ *
* @param rows
* the rows
* @param columns
/**
* Instantiates a new color picker grid.
- *
+ *
* @param colors
* the colors
*/
/**
* Sets the color grid.
- *
+ *
* @param colors
* the new color grid
*/
/**
* Adds a color change listener
- *
+ *
* @param listener
* The color change listener
*/
/**
* Removes a color change listener
- *
+ *
* @param listener
* The listener
*/
/**
* Sets the position.
- *
+ *
* @param x
* the x
* @param y
/**
* Gets the position.
- *
+ *
* @return the position
*/
public int[] getPosition() {
/**
* Notifies the listeners that a color change has occurred
- *
+ *
* @param color
* The color which it changed to
*/
/*
* 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
/**
* A component that represents color selection history within a color picker.
- *
+ *
* @since 7.0.0
*/
@Deprecated
-public class ColorPickerHistory extends CustomComponent implements
- ColorSelector, ColorChangeListener {
+public class ColorPickerHistory extends CustomComponent
+ implements ColorSelector, ColorChangeListener {
private static final String STYLENAME = "v-colorpicker-history";
private static final int columns = 15;
/** Temporary color history for when the component is detached. */
- private ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<>(
+ private ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<Color>(
rows * columns);
/** The grid. */
}
private void createColorHistoryIfNecessary() {
- List<Color> tempColors = new ArrayList<>(tempHistory);
+ List<Color> tempColors = new ArrayList<Color>(tempHistory);
if (getSession().getAttribute("colorPickerHistory") == null) {
getSession().setAttribute("colorPickerHistory",
new ArrayBlockingQueue<Color>(rows * columns));
@SuppressWarnings("unchecked")
private ArrayBlockingQueue<Color> getColorHistory() {
if (isAttached()) {
- Object colorHistory = getSession().getAttribute(
- "colorPickerHistory");
+ Object colorHistory = getSession()
+ .getAttribute("colorPickerHistory");
if (colorHistory instanceof ArrayBlockingQueue<?>) {
return (ArrayBlockingQueue<Color>) colorHistory;
}
}
}
- List<Color> colorList = new ArrayList<>(colorHistory);
+ List<Color> colorList = new ArrayList<Color>(colorHistory);
// Invert order of colors
Collections.reverse(colorList);
/**
* Gets the history.
- *
+ *
* @return the history
*/
public List<Color> getHistory() {
/**
* Checks if the history contains given color.
- *
+ *
* @param c
* the color
- *
+ *
* @return true, if successful
*/
public boolean hasColor(Color c) {
/**
* Adds a color change listener
- *
+ *
* @param listener
* The listener
*/
/**
* Removes a color change listener
- *
+ *
* @param listener
* The listener
*/
private ColorPickerSelect colorSelect;
/** The selectors. */
- private final Set<ColorSelector> selectors = new HashSet<>();
+ private final Set<ColorSelector> selectors = new HashSet<ColorSelector>();
/**
* Set true while the slider values are updated after colorChange. When
history.setHeight("22px");
// Create the default colors
- List<Color> defaultColors = new ArrayList<>();
+ List<Color> defaultColors = new ArrayList<Color>();
defaultColors.add(Color.BLACK);
defaultColors.add(Color.WHITE);
}
private static void findAllListenerMethods() {
- Set<Class<?>> classes = new HashSet<>();
+ Set<Class<?>> classes = new HashSet<Class<?>>();
for (Class<?> c : VaadinClasses.getAllServerSideClasses()) {
while (c != null && c.getName().startsWith("com.vaadin.")) {
classes.add(c);
@SuppressWarnings("deprecation")
public class VaadinClasses {
- private static final Set<String> WHITE_LIST_FQNS = new HashSet<>();
+ private static final Set<String> WHITE_LIST_FQNS = new HashSet<String>();
public static List<Class<? extends Field>> getFields() {
return getServerClasses(Field.class::isAssignableFrom)
Form f = new Form();
String propertyId = "My property";
f.addItemProperty(propertyId,
- new MethodProperty<>(new Data(), "dummyGetterAndSetter"));
+ new MethodProperty<Object>(new Data(), "dummyGetterAndSetter"));
f.replaceWithSelect(propertyId, new Object[] { "a", "b", null },
new String[] { "Item a", "ITem b", "Null item" });
@Test
public void testMethodPropertyGetter() throws Exception {
- MethodProperty<?> mp = new MethodProperty<>(new Data(), "dummyGetter");
+ MethodProperty<?> mp = new MethodProperty<Object>(new Data(),
+ "dummyGetter");
serializeAndDeserialize(mp);
}
@Test
public void testMethodPropertyGetterAndSetter() throws Exception {
- MethodProperty<?> mp = new MethodProperty<>(new Data(),
+ MethodProperty<?> mp = new MethodProperty<Object>(new Data(),
"dummyGetterAndSetter");
serializeAndDeserialize(mp);
}
@Test
public void testMethodPropertyInt() throws Exception {
- MethodProperty<?> mp = new MethodProperty<>(new Data(), "dummyInt");
+ MethodProperty<?> mp = new MethodProperty<Object>(new Data(),
+ "dummyInt");
serializeAndDeserialize(mp);
}
// Use a container data source
calendar.setEventProvider(new ContainerEventProvider(
- new BeanItemContainer<>(BasicEvent.class)));
+ new BeanItemContainer<BasicEvent>(BasicEvent.class)));
// Start and end dates to query for
java.util.Calendar cal = java.util.Calendar.getInstance();
// Use a container data source
calendar.setEventProvider(new ContainerEventProvider(
- new BeanItemContainer<>(BasicEvent.class)));
+ new BeanItemContainer<BasicEvent>(BasicEvent.class)));
// Start and end dates to query for
java.util.Calendar cal = java.util.Calendar.getInstance();
@Test
public void testAutomaticScaleVisibleHoursOfDay() {
- BeanItemContainer<CalendarEvent> container = new BeanItemContainer<>(
+ BeanItemContainer<CalendarEvent> container = new BeanItemContainer<CalendarEvent>(
CalendarEvent.class);
java.util.Calendar start = java.util.Calendar.getInstance();
java.util.Calendar end = java.util.Calendar.getInstance();
}
private static Indexed createTestBeanItemContainer() {
- BeanItemContainer<CalendarEvent> eventContainer = new BeanItemContainer<>(
+ BeanItemContainer<CalendarEvent> eventContainer = new BeanItemContainer<CalendarEvent>(
CalendarEvent.class);
java.util.Calendar cal = java.util.Calendar.getInstance();
for (int i = 1; i <= 10; i++) {
@Before
public void setUp() {
- date = new ObjectProperty<>(0L);
+ date = new ObjectProperty<Long>(0L);
datefield = new DateField();
datefield.setBuffered(false);
datefield.setConverter(new Converter<Date, Long>() {
field2.setRequired(true);
fieldGroup.bind(field2, "prop2");
- Set<TextField> set = new HashSet<>(Arrays.asList(field1, field2));
+ Set<TextField> set = new HashSet<TextField>(
+ Arrays.asList(field1, field2));
try {
fieldGroup.commit();
/*
* 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
@Before
public void setup() throws SecurityException, NoSuchMethodException {
- final BeanItem<Entry> folderItem = new BeanItem<>(folder);
- final BeanItem<Entry> childItem = new BeanItem<>(file);
+ final BeanItem<Entry> folderItem = new BeanItem<Entry>(folder);
+ final BeanItem<Entry> childItem = new BeanItem<Entry>(file);
@SuppressWarnings("unchecked")
TestContainer container = new TestContainer(
@Override
protected List<Object> getAllItemIds() {
- List<Object> ids = new ArrayList<>();
+ List<Object> ids = new ArrayList<Object>();
for (BeanItem<Entry> item : items) {
ids.add(item.getBean());
}
@Override
protected void setValue(AbstractField<Object> field) {
- Map<String, Object> variables = new HashMap<>();
+ Map<String, Object> variables = new HashMap<String, Object>();
variables.put("selected", new String[] { "myvalue" });
((ComboBox) field).changeVariables(field, variables);
}
private static void setFilterAndCurrentPage(ComboBox comboBox,
String filterString, int currentPage) {
- Map<String, Object> variables = new HashMap<>();
+ Map<String, Object> variables = new HashMap<String, Object>();
variables.put("filter", filterString);
variables.put("page", currentPage);
comboBox.changeVariables(null, variables);
*/
public static Iterable<Resolution> getResolutionsHigherOrEqualTo(
Resolution r) {
- List<Resolution> resolutions = new ArrayList<>();
+ List<Resolution> resolutions = new ArrayList<Resolution>();
Resolution[] values = Resolution.values();
for (int i = r.ordinal(); i < values.length; i++) {
resolutions.add(values[i]);
* @return An iterable for the resolutions lower than r
*/
public static List<Resolution> getResolutionsLowerThan(Resolution r) {
- List<Resolution> resolutions = new ArrayList<>();
+ List<Resolution> resolutions = new ArrayList<Resolution>();
Resolution[] values = Resolution.values();
for (int i = r.ordinal() - 1; i >= 0; i--) {
resolutions.add(values[i]);
/**
* Column resize mode in grid.
- *
+ *
* @since 7.7.5
*/
public ColumnResizeMode columnResizeMode = ColumnResizeMode.ANIMATED;
/**
* Columns in grid.
*/
- public List<GridColumnState> columns = new ArrayList<>();
+ public List<GridColumnState> columns = new ArrayList<GridColumnState>();
/**
* Column order in grid.
*/
- public List<String> columnOrder = new ArrayList<>();
+ public List<String> columnOrder = new ArrayList<String>();
public GridStaticSectionState header = new GridStaticSectionState();