update from development
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/.gitignore b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/.gitignore
index 5076645..631a395 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/.gitignore
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/.gitignore
@@ -1,4 +1,3 @@
/target/
**git.properties
-**/VAADIN/
**/WEB-INF/
\ No newline at end of file
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/META-INF/MANIFEST.MF b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/META-INF/MANIFEST.MF
index e5cb790..1fd5d35 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/META-INF/MANIFEST.MF
@@ -22,6 +22,8 @@
org.tepi.filtertable.numberfilter,
org.tepi.filtertable.paged
Bundle-Vendor: Eclipse OSBP
-Import-Package: com.vaadin.client;version="[7.7.6,7.8.0)"
+Import-Package: com.vaadin.client;version="[7.7.6,7.8.0)",
+ com.vaadin.client.ui;version="7.7.6",
+ com.vaadin.client.ui.dd;version="7.7.6"
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTable.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTable.java
index 5456948..e02830f 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTable.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTable.java
@@ -90,7 +90,12 @@
Container.Ordered, Container.Sortable, ItemClickNotifier, DragSource,
DropTarget, HasComponents {
- /** The logger. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6393600859108457264L;
+
+ /** The logger. */
private transient Logger logger = null;
/**
@@ -399,6 +404,11 @@
/** The Constant ROW_HEADER_FAKE_PROPERTY_ID. */
private static final Object ROW_HEADER_FAKE_PROPERTY_ID = new UniqueSerializable() {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5428814178809766481L;
};
/* Private table extensions to Select */
@@ -416,55 +426,55 @@
/**
* Keymapper for column ids.
*/
- protected final KeyMapper<Object> columnIdMap = new KeyMapper<Object>();
+ protected final KeyMapper<Object> columnIdMap = new KeyMapper<>();
/**
* Holds visible column propertyIds - in order.
*/
- private LinkedList<Object> visibleColumns = new LinkedList<Object>();
+ private LinkedList<Object> visibleColumns = new LinkedList<>();
/**
* Holds noncollapsible columns.
*/
- private HashSet<Object> noncollapsibleColumns = new HashSet<Object>();
+ private HashSet<Object> noncollapsibleColumns = new HashSet<>();
/**
* Holds propertyIds of currently collapsed columns.
*/
- private final HashSet<Object> collapsedColumns = new HashSet<Object>();
+ private final HashSet<Object> collapsedColumns = new HashSet<>();
/**
* Holds headers for visible columns (by propertyId).
*/
- private final HashMap<Object, String> columnHeaders = new HashMap<Object, String>();
+ private final HashMap<Object, String> columnHeaders = new HashMap<>();
/**
* Holds footers for visible columns (by propertyId).
*/
- private final HashMap<Object, String> columnFooters = new HashMap<Object, String>();
+ private final HashMap<Object, String> columnFooters = new HashMap<>();
/**
* Holds icons for visible columns (by propertyId).
*/
- private final HashMap<Object, Resource> columnIcons = new HashMap<Object, Resource>();
+ private final HashMap<Object, Resource> columnIcons = new HashMap<>();
/**
* Holds alignments for visible columns (by propertyId).
*/
- private HashMap<Object, Align> columnAlignments = new HashMap<Object, Align>();
+ private HashMap<Object, Align> columnAlignments = new HashMap<>();
/**
* Holds column widths in pixels for visible columns (by propertyId).
*/
- private final HashMap<Object, Integer> columnWidths = new HashMap<Object, Integer>();
+ private final HashMap<Object, Integer> columnWidths = new HashMap<>();
/**
* Holds column expand rations for visible columns (by propertyId).
*/
- private final HashMap<Object, Float> columnExpandRatios = new HashMap<Object, Float>();
+ private final HashMap<Object, Float> columnExpandRatios = new HashMap<>();
/** Holds column generators. */
- private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<Object, ColumnGenerator>();
+ private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<>();
/**
* Holds value of property pageLength. 0 disables paging.
@@ -617,13 +627,13 @@
private RowGenerator rowGenerator = null;
/** The associated properties. */
- private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<Field<?>, Property<?>>();
+ private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<>();
/** The painted. */
private boolean painted = false;
/** The property value converters. */
- private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<Object, Converter<String, Object>>();
+ private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<>();
/**
* Set to true if the client-side should be informed that the key mapper has
@@ -633,7 +643,7 @@
private boolean keyMapperReset;
/** The exceptions during cache population. */
- private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<Throwable>();
+ private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<>();
/** The is being painted. */
private boolean isBeingPainted;
@@ -707,7 +717,7 @@
"Can not set visible columns to null value");
}
- final LinkedList<Object> newVC = new LinkedList<Object>();
+ final LinkedList<Object> newVC = new LinkedList<>();
// Checks that the new visible columns contains no nulls, properties
// exist and that there are no duplicates before adding them to newVC.
@@ -932,7 +942,7 @@
}
// Resets the alignments
- final HashMap<Object, Align> newCA = new HashMap<Object, Align>();
+ final HashMap<Object, Align> newCA = new HashMap<>();
int i = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext() && i < columnAlignments.length; i++) {
@@ -1508,7 +1518,7 @@
if (columnOrder == null || !isColumnReorderingAllowed()) {
return;
}
- final LinkedList<Object> newOrder = new LinkedList<Object>();
+ final LinkedList<Object> newOrder = new LinkedList<>();
for (int i = 0; i < columnOrder.length; i++) {
if (columnOrder[i] != null
&& visibleColumns.contains(columnOrder[i])) {
@@ -1833,7 +1843,12 @@
*/
public static class CacheUpdateException extends RuntimeException {
- /** The causes. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1890917091988174455L;
+
+ /** The causes. */
private Throwable[] causes;
/** The table. */
@@ -1867,9 +1882,8 @@
int causeCount) {
if (causeCount > 1) {
return message + " Additional causes not shown.";
- } else {
- return message;
}
+ return message;
}
/** Returns the cause(s) for this exception.
@@ -2289,8 +2303,8 @@
if (replaceListeners) {
// initialize the listener collections, this should only be done if
// the entire cache is refreshed (through refreshRenderedCells)
- listenedProperties = new HashSet<Property<?>>();
- visibleComponents = new HashSet<Component>();
+ listenedProperties = new HashSet<>();
+ visibleComponents = new HashSet<>();
}
Object[][] cells = new Object[cols + CELL_FIRSTCOL][rows];
@@ -2772,7 +2786,7 @@
throws UnsupportedOperationException {
// remove generated columns from the list of columns being assigned
- final LinkedList<Object> availableCols = new LinkedList<Object>();
+ final LinkedList<Object> availableCols = new LinkedList<>();
for (Iterator<Object> it = visibleColumns.iterator(); it.hasNext();) {
Object id = it.next();
if (!columnGenerators.containsKey(id)) {
@@ -2863,7 +2877,7 @@
} else {
generated = Collections.emptyList();
}
- List<Object> visibleIds = new ArrayList<Object>();
+ List<Object> visibleIds = new ArrayList<>();
if (generated.isEmpty()) {
visibleIds.addAll(newDataSource.getContainerPropertyIds());
} else {
@@ -2902,7 +2916,7 @@
newDataSource = new IndexedContainer();
}
if (visibleIds == null) {
- visibleIds = new ArrayList<Object>();
+ visibleIds = new ArrayList<>();
}
// Retain propertyValueConverters if their corresponding ids are
@@ -2911,7 +2925,7 @@
if (propertyValueConverters != null) {
Collection<?> newPropertyIds = newDataSource
.getContainerPropertyIds();
- LinkedList<Object> retainableValueConverters = new LinkedList<Object>();
+ LinkedList<Object> retainableValueConverters = new LinkedList<>();
for (Object propertyId : newPropertyIds) {
Converter<String, ?> converter = getConverter(propertyId);
if (converter != null) {
@@ -2944,7 +2958,7 @@
}
// don't add the same id twice
- Collection<Object> col = new LinkedList<Object>();
+ Collection<Object> col = new LinkedList<>();
for (Iterator<?> it = visibleIds.iterator(); it.hasNext();) {
Object id = it.next();
if (!col.contains(id)) {
@@ -2985,7 +2999,7 @@
*/
private LinkedHashSet<Object> getItemIdsInRange(Object itemId,
final int length) {
- LinkedHashSet<Object> ids = new LinkedHashSet<Object>();
+ LinkedHashSet<Object> ids = new LinkedHashSet<>();
for (int i = 0; i < length; i++) {
assert itemId != null; // should not be null unless client-server
// are out of sync
@@ -3007,7 +3021,7 @@
Set<Object> renderedButNotSelectedItemIds = getCurrentlyRenderedItemIds();
@SuppressWarnings("unchecked")
- HashSet<Object> newValue = new LinkedHashSet<Object>(
+ HashSet<Object> newValue = new LinkedHashSet<>(
(Collection<Object>) getValue());
if (variables.containsKey("clearSelections")) {
@@ -3066,7 +3080,7 @@
* @return the currently rendered item ids
*/
private Set<Object> getCurrentlyRenderedItemIds() {
- HashSet<Object> ids = new HashSet<Object>();
+ HashSet<Object> ids = new HashSet<>();
if (pageBuffer != null) {
for (int i = 0; i < pageBuffer[CELL_ITEMID].length; i++) {
ids.add(pageBuffer[CELL_ITEMID][i]);
@@ -3103,7 +3117,7 @@
if (!isSelectable() && variables.containsKey("selected")) {
// Not-selectable is a special case, AbstractSelect does not support
// TODO could be optimized.
- variables = new HashMap<String, Object>(variables);
+ variables = new HashMap<>(variables);
variables.remove("selected");
}
@@ -3115,7 +3129,7 @@
&& variables.containsKey("selected")
&& multiSelectMode == MultiSelectMode.DEFAULT) {
handleSelectedItems(variables);
- variables = new HashMap<String, Object>(variables);
+ variables = new HashMap<>(variables);
variables.remove("selected");
}
@@ -3215,7 +3229,7 @@
try {
final Object[] ids = (Object[]) variables
.get("collapsedcolumns");
- Set<Object> idSet = new HashSet<Object>();
+ Set<Object> idSet = new HashSet<>();
for (Object id : ids) {
idSet.add(columnIdMap.get(id.toString()));
}
@@ -3877,7 +3891,7 @@
private void paintAvailableColumns(PaintTarget target)
throws PaintException {
if (columnCollapsingAllowed) {
- final HashSet<Object> collapsedCols = new HashSet<Object>();
+ final HashSet<Object> collapsedCols = new HashSet<>();
for (Object colId : visibleColumns) {
if (isColumnCollapsed(colId)) {
collapsedCols.add(colId);
@@ -4044,7 +4058,7 @@
*/
private void paintVisibleColumnOrder(PaintTarget target) {
// Visible column order
- final ArrayList<String> visibleColOrder = new ArrayList<String>();
+ final ArrayList<String> visibleColOrder = new ArrayList<>();
for (Object columnId : visibleColumns) {
if (!isColumnCollapsed(columnId)) {
visibleColOrder.add(columnIdMap.key(columnId));
@@ -4060,9 +4074,9 @@
* @return the sets the
*/
private Set<Action> findAndPaintBodyActions(PaintTarget target) {
- Set<Action> actionSet = new LinkedHashSet<Action>();
+ Set<Action> actionSet = new LinkedHashSet<>();
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<String>();
+ final ArrayList<String> keys = new ArrayList<>();
for (Handler ah : actionHandlers) {
// Getting actions for the null item, which in this case means
// the body item
@@ -4149,7 +4163,7 @@
* @return the string[]
*/
private String[] findSelectedKeys() {
- LinkedList<String> selectedKeys = new LinkedList<String>();
+ LinkedList<String> selectedKeys = new LinkedList<>();
if (isMultiSelect()) {
HashSet<?> sel = new HashSet<Object>((Set<?>) getValue());
Collection<?> vids = getVisibleItemIds();
@@ -4383,7 +4397,7 @@
// Actions
if (actionHandlers != null) {
- final ArrayList<String> keys = new ArrayList<String>();
+ final ArrayList<String> keys = new ArrayList<>();
for (Handler ah : actionHandlers) {
final Action[] aa = ah.getActions(itemId, this);
if (aa != null) {
@@ -4617,8 +4631,8 @@
if (actionHandler != null) {
if (actionHandlers == null) {
- actionHandlers = new LinkedList<Handler>();
- actionMapper = new KeyMapper<Action>();
+ actionHandlers = new LinkedList<>();
+ actionMapper = new KeyMapper<>();
}
if (!actionHandlers.contains(actionHandler)) {
@@ -4943,9 +4957,8 @@
}
refreshRowCache();
return true;
- } else {
- return false;
}
+ return false;
}
/** Returns item identifiers of the items which are currently rendered on
@@ -4966,7 +4979,7 @@
@Override
public Collection<?> getVisibleItemIds() {
- final LinkedList<Object> visible = new LinkedList<Object>();
+ final LinkedList<Object> visible = new LinkedList<>();
final Object[][] cells = getVisibleCells();
// may be null if the table has not been rendered yet (e.g. not attached
@@ -5029,7 +5042,7 @@
Collection<?> containerPropertyIds = getContainerDataSource()
.getContainerPropertyIds();
- LinkedList<Object> newVisibleColumns = new LinkedList<Object>(
+ LinkedList<Object> newVisibleColumns = new LinkedList<>(
visibleColumns);
for (Iterator<Object> iterator = newVisibleColumns.iterator(); iterator
.hasNext();) {
@@ -5336,9 +5349,8 @@
final Container c = getContainerDataSource();
if (c instanceof Container.Sortable && isSortEnabled()) {
return ((Container.Sortable) c).getSortableContainerPropertyIds();
- } else {
- return Collections.EMPTY_LIST;
}
+ return Collections.EMPTY_LIST;
}
/**
@@ -5607,9 +5619,8 @@
if (getParent() != null && !getParent().isEnabled()) {
// some ancestor still disabled, don't update children
return;
- } else {
- markAsDirtyRecursive();
}
+ markAsDirtyRecursive();
}
/** Sets the drag start mode of the CustomTable. Drag start mode controls
@@ -5642,7 +5653,12 @@
*/
public class TableTransferable extends DataBoundTransferable {
- /** Instantiates a new table transferable.
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8358368561148789905L;
+
+ /** Instantiates a new table transferable.
*
* @param rawVariables
* the raw variables
@@ -5759,7 +5775,12 @@
*/
public static abstract class TableDropCriterion extends ServerSideCriterion {
- /** The table. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4438203379086782747L;
+
+ /** The table. */
private CustomTable table;
/** The allowed item ids. */
@@ -5847,7 +5868,11 @@
*/
public static class HeaderClickEvent extends ClickEvent {
- /** The Constant HEADER_CLICK_METHOD. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3842793591293767381L;
+ /** The Constant HEADER_CLICK_METHOD. */
public static final Method HEADER_CLICK_METHOD;
static {
@@ -5898,7 +5923,11 @@
*/
public static class FooterClickEvent extends ClickEvent {
- /** The Constant FOOTER_CLICK_METHOD. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5958041789945758720L;
+ /** The Constant FOOTER_CLICK_METHOD. */
public static final Method FOOTER_CLICK_METHOD;
static {
@@ -6138,7 +6167,12 @@
*/
public static class ColumnResizeEvent extends Component.Event {
- /** The Constant COLUMN_RESIZE_METHOD. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8407371352547584420L;
+
+ /** The Constant COLUMN_RESIZE_METHOD. */
public static final Method COLUMN_RESIZE_METHOD;
static {
@@ -6275,7 +6309,11 @@
*/
public static class ColumnReorderEvent extends Component.Event {
- /** The Constant METHOD. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7037717344987539459L;
+ /** The Constant METHOD. */
public static final Method METHOD;
static {
@@ -6430,7 +6468,12 @@
*/
public static class GeneratedRow implements Serializable {
- /** The html content allowed. */
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6224096809716484520L;
+
+ /** The html content allowed. */
private boolean htmlContentAllowed = false;
/** The span columns. */
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTreeTable.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTreeTable.java
index 3fcf910..d61b62b 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTreeTable.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/com/vaadin/ui/CustomTreeTable.java
@@ -29,6 +29,7 @@
import com.vaadin.data.Collapsible;
import com.vaadin.data.Container;
import com.vaadin.data.Container.Hierarchical;
+import com.vaadin.data.Container.ItemSetChangeEvent;
import com.vaadin.data.util.ContainerHierarchicalWrapper;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.data.util.HierarchicalContainerOrderedWrapper;
@@ -187,7 +188,7 @@
*/
private class HierarchicalStrategy extends AbstractStrategy {
- private final HashSet<Object> openItems = new HashSet<Object>();
+ private final HashSet<Object> openItems = new HashSet<>();
@Override
public boolean isNodeOpen(Object itemId) {
@@ -217,9 +218,8 @@
public Object lastItemId() {
if (getPreOrder().size() > 0) {
return getPreOrder().get(getPreOrder().size() - 1);
- } else {
- return null;
}
+ return null;
}
@Override
@@ -231,9 +231,8 @@
indexOf++;
if (indexOf == getPreOrder().size()) {
return null;
- } else {
- return getPreOrder().get(indexOf);
}
+ return getPreOrder().get(indexOf);
}
@Override
@@ -242,9 +241,8 @@
indexOf--;
if (indexOf < 0) {
return null;
- } else {
- return getPreOrder().get(indexOf);
}
+ return getPreOrder().get(indexOf);
}
@Override
@@ -274,7 +272,7 @@
*/
private List<Object> getPreOrder() {
if (preOrder == null) {
- preOrder = new ArrayList<Object>();
+ preOrder = new ArrayList<>();
Collection<?> rootItemIds = getContainerDataSource()
.rootItemIds();
for (Object id : rootItemIds) {
@@ -885,7 +883,7 @@
@Override
protected List<Object> getItemIds(int firstIndex, int rows) {
- List<Object> itemIds = new ArrayList<Object>();
+ List<Object> itemIds = new ArrayList<>();
for (int i = firstIndex; i < firstIndex + rows; i++) {
itemIds.add(getIdByIndex(i));
}
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterFieldGenerator.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterFieldGenerator.java
index 1be5035..3254f17 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterFieldGenerator.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterFieldGenerator.java
@@ -45,13 +45,13 @@
private final IFilterTable owner;
/* Mapping for property IDs, filters and components */
- private final Map<Object, Filter> filters = new HashMap<Object, Container.Filter>();
- private final Map<AbstractField<?>, Object> customFields = new HashMap<AbstractField<?>, Object>();
- private final Map<TextField, Object> texts = new HashMap<TextField, Object>();
- private final Map<ComboBox, Object> enums = new HashMap<ComboBox, Object>();
- private final Map<ComboBox, Object> booleans = new HashMap<ComboBox, Object>();
- private final Map<DateFilterPopup, Object> dates = new HashMap<DateFilterPopup, Object>();
- private final Map<NumberFilterPopup, Object> numbers = new HashMap<NumberFilterPopup, Object>();
+ private final Map<Object, Filter> filters = new HashMap<>();
+ private final Map<AbstractField<?>, Object> customFields = new HashMap<>();
+ private final Map<TextField, Object> texts = new HashMap<>();
+ private final Map<ComboBox, Object> enums = new HashMap<>();
+ private final Map<ComboBox, Object> booleans = new HashMap<>();
+ private final Map<DateFilterPopup, Object> dates = new HashMap<>();
+ private final Map<NumberFilterPopup, Object> numbers = new HashMap<>();
private And lastOnDemandFilter;
@@ -224,11 +224,10 @@
if (owner.getFilterGenerator() != null) {
return owner.getFilterGenerator().filterGeneratorFailed(reason,
propertyId, value);
- } else {
- throw new RuntimeException("Creating a filter for property '"
- + propertyId + "' with value '" + value
- + "'has failed.", reason);
}
+ throw new RuntimeException("Creating a filter for property '"
+ + propertyId + "' with value '" + value
+ + "'has failed.", reason);
}
}
@@ -245,10 +244,9 @@
/* Special handling for ComboBox (= enum properties) */
if (field instanceof ComboBox) {
return new Equal(propertyId, value);
- } else {
- return new SimpleStringFilter(propertyId, String.valueOf(value),
- true, false);
}
+ return new SimpleStringFilter(propertyId, String.valueOf(value),
+ true, false);
}
private Filter generateNumberFilter(Property<?> field, Object propertyId,
@@ -615,7 +613,7 @@
if (owner.getFilterable() != null) {
owner.getFilterable().removeContainerFilter(lastOnDemandFilter);
}
- List<Filter> filters = new ArrayList<Filter>();
+ List<Filter> filters = new ArrayList<>();
for (AbstractField<?> f : customFields.keySet()) {
addNonNullFilter(filters, f);
}
@@ -680,10 +678,9 @@
void setFilterOnDemandMode(boolean filterOnDemand) {
if (runFiltersOnDemand == filterOnDemand) {
return;
- } else {
- runFiltersOnDemand = filterOnDemand;
- destroyFilterComponents();
- initializeFilterFields();
}
+ runFiltersOnDemand = filterOnDemand;
+ destroyFilterComponents();
+ initializeFilterFields();
}
}
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTable.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTable.java
index 2aaeba1..f7058ba 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTable.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTable.java
@@ -33,9 +33,9 @@
@SuppressWarnings("serial")
public class FilterTable extends CustomTable implements IFilterTable {
/* Maps property id's to column filter components */
- private final Map<Object, Component> columnIdToFilterMap = new HashMap<Object, Component>();
+ private final Map<Object, Component> columnIdToFilterMap = new HashMap<>();
/* Internal list of currently collapsed column id:s */
- private final Set<Object> collapsedColumnIds = new HashSet<Object>();
+ private final Set<Object> collapsedColumnIds = new HashSet<>();
/* Set to true to show the filter components */
private boolean filtersVisible;
/* Filter Generator and Decorator */
@@ -52,7 +52,7 @@
/* Are filters run immediately, or only on demand? */
private boolean filtersRunOnDemand = false;
/* Custom column header style names */
- private final HashMap<Object, String> columnHeaderStylenames = new HashMap<Object, String>();
+ private final HashMap<Object, String> columnHeaderStylenames = new HashMap<>();
/**
* Creates a new empty FilterTable
@@ -295,9 +295,8 @@
Component field = getColumnIdToFilterMap().get(propertyId);
if (field != null) {
return ((AbstractField<?>) field).getValue();
- } else {
- return null;
}
+ return null;
}
/**
@@ -340,7 +339,7 @@
@Override
public Iterator<Component> iterator() {
- Set<Component> children = new HashSet<Component>();
+ Set<Component> children = new HashSet<>();
if (visibleComponents != null) {
children.addAll(visibleComponents);
}
@@ -386,11 +385,10 @@
public void setWrapFilters(boolean wrapFilters) {
if (this.wrapFilters == wrapFilters) {
return;
- } else {
- this.wrapFilters = wrapFilters;
- reRenderFilterFields = true;
- markAsDirty();
}
+ this.wrapFilters = wrapFilters;
+ reRenderFilterFields = true;
+ markAsDirty();
}
public boolean isWrapFilters() {
@@ -400,11 +398,10 @@
public void setFilterOnDemand(boolean filterOnDemand) {
if (filtersRunOnDemand == filterOnDemand) {
return;
- } else {
- filtersRunOnDemand = filterOnDemand;
- reRenderFilterFields = true;
- generator.setFilterOnDemandMode(filtersRunOnDemand);
}
+ filtersRunOnDemand = filterOnDemand;
+ reRenderFilterFields = true;
+ generator.setFilterOnDemandMode(filtersRunOnDemand);
}
@@ -425,7 +422,7 @@
if (allStyleNames == null) {
return null;
}
- List<String> stylenamesForPaint = new ArrayList<String>();
+ List<String> stylenamesForPaint = new ArrayList<>();
Object[] visibleColumns = getVisibleColumns();
for (int i = 0; i < allStyleNames.length; i++) {
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTreeTable.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTreeTable.java
index a80054d..dcd4498 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTreeTable.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/FilterTreeTable.java
@@ -24,9 +24,9 @@
@SuppressWarnings("serial")
public class FilterTreeTable extends CustomTreeTable implements IFilterTable {
/* Maps property id's to column filter components */
- private final Map<Object, Component> columnIdToFilterMap = new HashMap<Object, Component>();
+ private final Map<Object, Component> columnIdToFilterMap = new HashMap<>();
/* Internal list of currently collapsed column id:s */
- private final Set<Object> collapsedColumnIds = new HashSet<Object>();
+ private final Set<Object> collapsedColumnIds = new HashSet<>();
/* Set to true to show the filter components */
private boolean filtersVisible;
/* Filter Generator and Decorator */
@@ -270,9 +270,8 @@
Component field = getColumnIdToFilterMap().get(propertyId);
if (field != null) {
return ((AbstractField<?>) field).getValue();
- } else {
- return null;
}
+ return null;
}
/**
@@ -315,7 +314,7 @@
@Override
public Iterator<Component> iterator() {
- Set<Component> children = new HashSet<Component>();
+ Set<Component> children = new HashSet<>();
if (visibleComponents != null) {
children.addAll(visibleComponents);
}
@@ -362,11 +361,10 @@
public void setWrapFilters(boolean wrapFilters) {
if (this.wrapFilters == wrapFilters) {
return;
- } else {
- this.wrapFilters = wrapFilters;
- reRenderFilterFields = true;
- markAsDirty();
}
+ this.wrapFilters = wrapFilters;
+ reRenderFilterFields = true;
+ markAsDirty();
}
public boolean isWrapFilters() {
@@ -376,12 +374,10 @@
public void setFilterOnDemand(boolean filterOnDemand) {
if (filtersRunOnDemand == filterOnDemand) {
return;
- } else {
- filtersRunOnDemand = filterOnDemand;
- reRenderFilterFields = true;
- generator.setFilterOnDemandMode(filtersRunOnDemand);
}
-
+ filtersRunOnDemand = filterOnDemand;
+ reRenderFilterFields = true;
+ generator.setFilterOnDemandMode(filtersRunOnDemand);
}
public boolean isFilterOnDemand() {
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/FilterTableConnector.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/FilterTableConnector.java
index 65dfae2..26449fd 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/FilterTableConnector.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/FilterTableConnector.java
@@ -49,11 +49,17 @@
/**
* The Class FilterTableConnector.
*/
+@SuppressWarnings("deprecation")
@Connect(FilterTable.class)
public class FilterTableConnector extends AbstractHasComponentsConnector
implements Paintable, DirectionalManagedLayout, PostLayoutListener {
- /* (non-Javadoc)
+ /**
+ *
+ */
+ private static final long serialVersionUID = -696894581493941337L;
+
+ /* (non-Javadoc)
* @see com.vaadin.client.ui.AbstractConnector#init()
*/
@Override
@@ -369,7 +375,7 @@
getWidget().filters.filters.clear();
} else {
/* Prepare and paint filter components */
- Map<String, Widget> newWidgets = new HashMap<String, Widget>();
+ Map<String, Widget> newWidgets = new HashMap<>();
boolean allCached = true;
for (final Iterator<Object> it = uidl.getChildIterator(); it
.hasNext();) {
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTable.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTable.java
index e7bad0b..81fab25 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTable.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTable.java
@@ -24,6 +24,7 @@
import com.vaadin.shared.ui.dd.AcceptCriterion;
import com.vaadin.ui.CustomTable;
+@SuppressWarnings("deprecation")
public class VFilterTable extends VCustomScrollTable {
@AcceptCriterion(CustomTable.TableDropCriterion.class)
@@ -122,7 +123,7 @@
class FilterPanel extends FlowPanel implements ScrollHandler {
/* Column filter components - mapped by column keys */
- Map<String, Widget> filters = new HashMap<String, Widget>();
+ Map<String, Widget> filters = new HashMap<>();
/* Set to true to render the filter bar */
boolean filtersVisible;
/* Wrapper that holds the filter component container */
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTreeTable.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTreeTable.java
index bcb57d1..4a876be 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTreeTable.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/gwt/client/ui/VFilterTreeTable.java
@@ -41,6 +41,7 @@
import com.vaadin.client.Util;
import com.vaadin.client.ui.VCustomScrollTable;
+@SuppressWarnings("deprecation")
public class VFilterTreeTable extends VFilterTable {
/** For internal use only. May be removed or replaced in the future. */
@@ -86,7 +87,7 @@
public boolean animationsEnabled;
/** For internal use only. May be removed or replaced in the future. */
- public LinkedList<PendingNavigationEvent> pendingNavigationEvents = new LinkedList<VFilterTreeTable.PendingNavigationEvent>();
+ public LinkedList<PendingNavigationEvent> pendingNavigationEvents = new LinkedList<>();
/** For internal use only. May be removed or replaced in the future. */
public boolean focusParentResponsePending;
@@ -267,19 +268,8 @@
String w = cell.getStyle().getProperty("width");
if (w == null || "".equals(w) || !w.endsWith("px")) {
return -1;
- } else {
- return Integer.parseInt(w.substring(0, w.length() - 2));
}
- }
-
- private int getHierarchyAndIconWidth() {
- int consumedSpace = treeSpacer.getOffsetWidth();
- if (treeSpacer.getParentElement().getChildCount() > 2) {
- // icon next to tree spacer
- consumedSpace += ((com.google.gwt.dom.client.Element) treeSpacer
- .getNextSibling()).getOffsetWidth();
- }
- return consumedSpace;
+ return Integer.parseInt(w.substring(0, w.length() - 2));
}
@Override
@@ -462,7 +452,7 @@
protected void unlinkRowsAnimatedAndUpdateCacheWhenFinished(
final int firstIndex, final int rows) {
- List<VScrollTableRow> rowsToDelete = new ArrayList<VScrollTableRow>();
+ List<VScrollTableRow> rowsToDelete = new ArrayList<>();
for (int ix = firstIndex; ix < firstIndex + rows; ix++) {
VScrollTableRow row = getRowByRowIndex(ix);
if (row != null) {
@@ -784,10 +774,9 @@
protected String buildCaptionHtmlSnippet(UIDL uidl) {
if (uidl.getTag().equals("column")) {
return super.buildCaptionHtmlSnippet(uidl);
- } else {
- String s = uidl.getStringAttribute("caption");
- return s;
}
+ String s = uidl.getStringAttribute("caption");
+ return s;
}
/** For internal use only. May be removed or replaced in the future. */
diff --git a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/paged/PagedFilterTableContainer.java b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/paged/PagedFilterTableContainer.java
index 921d616..7e59196 100644
--- a/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/paged/PagedFilterTableContainer.java
+++ b/org.eclipse.osbp.fork.vaadin.addon.filteringtable/src/org/tepi/filtertable/paged/PagedFilterTableContainer.java
@@ -55,9 +55,8 @@
int rowsLeft = container.size() - startIndex;
if (rowsLeft > pageLength) {
return pageLength;
- } else {
- return rowsLeft;
}
+ return rowsLeft;
}
public int getRealSize() {