Bug 565581 - Fix issues reported by Sonar
Fixed reported bugs in tests and examples
Change-Id: Iec11a43b24431be2cc00a83b43aa2f73743ff923
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/VisualChangeEventConflaterTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/VisualChangeEventConflaterTest.java
index dc11f3b..380fe64 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/VisualChangeEventConflaterTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/VisualChangeEventConflaterTest.java
@@ -25,8 +25,7 @@
@Test
public void shouldAccumulateEvents() throws Exception {
NatTableFixture natTable = new NatTableFixture();
- VisualChangeEventConflater conflater = new VisualChangeEventConflater(
- natTable);
+ VisualChangeEventConflater conflater = new VisualChangeEventConflater(natTable);
EventConflaterChain chain = new EventConflaterChain();
chain.add(conflater);
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/columnChooser/ColumnChooserUtilsTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/columnChooser/ColumnChooserUtilsTest.java
index 27a1346..b934460 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/columnChooser/ColumnChooserUtilsTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/columnChooser/ColumnChooserUtilsTest.java
@@ -48,15 +48,13 @@
@Test
public void getPositionsFromEntries() throws Exception {
- List<Integer> positions = ColumnChooserUtils
- .getColumnEntryPositions(this.entriesFixture);
+ List<Integer> positions = ColumnChooserUtils.getColumnEntryPositions(this.entriesFixture);
assertEquals("[2, 6, 3, 4, 5]", positions.toString());
}
@Test
public void getIndexesFromEntries() throws Exception {
- List<Integer> indexes = ColumnChooserUtils
- .getColumnEntryIndexes(this.entriesFixture);
+ List<Integer> indexes = ColumnChooserUtils.getColumnEntryIndexes(this.entriesFixture);
assertEquals("[1, 3, 5, 7, 9]", indexes.toString());
}
@@ -67,15 +65,12 @@
}
@Test
- public void shouldProvideRenamedLabelsIfTheColumnHasBeenRenamed()
- throws Exception {
+ public void shouldProvideRenamedLabelsIfTheColumnHasBeenRenamed() throws Exception {
ColumnHeaderLayerFixture columnHeaderLayer = new ColumnHeaderLayerFixture();
- assertEquals("[1, 0]",
- getColumnLabel(columnHeaderLayer, getDataLayer(), 1));
+ assertEquals("[1, 0]", getColumnLabel(columnHeaderLayer, getDataLayer(), 1));
columnHeaderLayer.renameColumnPosition(1, "renamed");
- assertEquals("renamed*",
- getColumnLabel(columnHeaderLayer, getDataLayer(), 1));
+ assertEquals("renamed*", getColumnLabel(columnHeaderLayer, getDataLayer(), 1));
}
@Test
@@ -84,32 +79,31 @@
RowDataListFixture.getList(),
RowDataListFixture.getPropertyNames(),
RowDataListFixture.getPropertyToLabelMap());
- ColumnHideShowLayer columnHideShowLayer = gridLayer.getBodyLayer()
- .getColumnHideShowLayer();
+ ColumnHideShowLayer columnHideShowLayer = gridLayer.getBodyLayer().getColumnHideShowLayer();
ColumnHeaderLayer columnHeaderLayer = gridLayer.getColumnHeaderLayer();
- DataLayer columnHeaderDataLayer = (DataLayer) gridLayer
- .getColumnHeaderDataLayer();
+ DataLayer columnHeaderDataLayer = (DataLayer) gridLayer.getColumnHeaderDataLayer();
- List<ColumnEntry> visibleEntries = ColumnChooserUtils
- .getVisibleColumnsEntries(columnHideShowLayer,
- columnHeaderLayer, columnHeaderDataLayer);
+ List<ColumnEntry> visibleEntries = ColumnChooserUtils.getVisibleColumnsEntries(
+ columnHideShowLayer,
+ columnHeaderLayer,
+ columnHeaderDataLayer);
// All columns shown
- assertEquals(RowDataListFixture.getPropertyNames().length,
- visibleEntries.size());
+ assertEquals(RowDataListFixture.getPropertyNames().length, visibleEntries.size());
// Hide a few columns
- gridLayer.getBodyLayer().getColumnHideShowLayer()
- .hideColumnPositions(Arrays.asList(1, 2, 3));
+ gridLayer.getBodyLayer().getColumnHideShowLayer().hideColumnPositions(Arrays.asList(1, 2, 3));
visibleEntries = ColumnChooserUtils.getVisibleColumnsEntries(
- columnHideShowLayer, columnHeaderLayer, columnHeaderDataLayer);
- assertEquals(RowDataListFixture.getPropertyNames().length - 3,
- visibleEntries.size());
+ columnHideShowLayer,
+ columnHeaderLayer,
+ columnHeaderDataLayer);
+ assertEquals(RowDataListFixture.getPropertyNames().length - 3l, visibleEntries.size());
// Check the hidden entries
- List<ColumnEntry> hiddenEntries = ColumnChooserUtils
- .getHiddenColumnEntries(columnHideShowLayer, columnHeaderLayer,
- columnHeaderDataLayer);
+ List<ColumnEntry> hiddenEntries = ColumnChooserUtils.getHiddenColumnEntries(
+ columnHideShowLayer,
+ columnHeaderLayer,
+ columnHeaderDataLayer);
assertEquals(3, hiddenEntries.size());
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/config/DefaultComparatorTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/config/DefaultComparatorTest.java
index c68ee6d..34d4563 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/config/DefaultComparatorTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/config/DefaultComparatorTest.java
@@ -12,55 +12,49 @@
******************************************************************************/
package org.eclipse.nebula.widgets.nattable.config;
-import org.junit.Assert;
+import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
public class DefaultComparatorTest {
- private DefaultComparator defaultComparator = DefaultComparator
- .getInstance();
+ private DefaultComparator defaultComparator = DefaultComparator.getInstance();
@Test
public void testCompareNonNullComparables() {
- Assert.assertEquals("abc".compareTo("abc"),
- this.defaultComparator.compare("abc", "abc"));
- Assert.assertEquals("abc".compareTo("def"),
- this.defaultComparator.compare("abc", "def"));
- Assert.assertEquals("def".compareTo("abc"),
- this.defaultComparator.compare("def", "abc"));
+ assertEquals(0, this.defaultComparator.compare("abc", "abc"));
+ assertEquals("abc".compareTo("def"), this.defaultComparator.compare("abc", "def"));
+ assertEquals("def".compareTo("abc"), this.defaultComparator.compare("def", "abc"));
}
@Test
public void testCompareNullAB() {
- Assert.assertEquals(0, this.defaultComparator.compare(null, null));
+ assertEquals(0, this.defaultComparator.compare(null, null));
}
@Test
public void testCompareNullA() {
- Assert.assertEquals(-1, this.defaultComparator.compare(null, "abc"));
+ assertEquals(-1, this.defaultComparator.compare(null, "abc"));
}
@Test
public void testCompareNullB() {
- Assert.assertEquals(1, this.defaultComparator.compare("abc", null));
+ assertEquals(1, this.defaultComparator.compare("abc", null));
}
@Test
public void testCompareNonComparables() {
- Assert.assertEquals(0, this.defaultComparator.compare(new SimpleObject(
- "Test"), new SimpleObject("Test")));
+ assertEquals(0, this.defaultComparator.compare(new SimpleObject("Test"), new SimpleObject("Test")));
}
@Test
public void testCompareNonComparables1() {
- Assert.assertEquals(-1, this.defaultComparator.compare(new SimpleObject(
- "Test1"), new SimpleObject("Test2")));
+ assertEquals(-1, this.defaultComparator.compare(new SimpleObject("Test1"), new SimpleObject("Test2")));
}
@Test
public void testCompareNonComparables2() {
- Assert.assertEquals(1, this.defaultComparator.compare(new SimpleObject(
- "Test2"), new SimpleObject("Test1")));
+ assertEquals(1, this.defaultComparator.compare(new SimpleObject("Test2"), new SimpleObject("Test1")));
}
class SimpleObject {
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/DataChangeLayerIdIndexTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/DataChangeLayerIdIndexTest.java
index 27b0046..db37593 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/DataChangeLayerIdIndexTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/DataChangeLayerIdIndexTest.java
@@ -617,6 +617,7 @@
}
@Test
+ @SuppressWarnings("java:S2259")
public void shouldUpdateChangeOnSortAndSaveWithTemp() {
// enable temp data storage to test update on save
this.dataChangeLayer = new DataChangeLayer(this.dataLayer,
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeIdIndexTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeIdIndexTest.java
index b010bf3..5a296fc 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeIdIndexTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeIdIndexTest.java
@@ -367,7 +367,7 @@
assertEquals(1, this.dataChangeLayer.dataChanges.size());
assertEquals(1, this.deleteHandler.dataChanges.size());
- RowDeleteDataChange change = this.deleteHandler.dataChanges.get(10);
+ RowDeleteDataChange change = this.deleteHandler.dataChanges.get(Integer.valueOf(10));
assertNotNull(change);
assertEquals(10, change.getKey());
assertEquals(toDelete, change.getValue());
@@ -391,7 +391,7 @@
assertFalse("Cell 0/10 is dirty", this.dataChangeLayer.isCellDirty(0, 10));
assertFalse("Dirty label set", this.dataChangeLayer.getConfigLabelsByPosition(1, 10).hasLabel(DataChangeLayer.DIRTY));
- RowDeleteDataChange change = this.deleteHandler.dataChanges.get(10);
+ RowDeleteDataChange change = this.deleteHandler.dataChanges.get(Integer.valueOf(10));
assertNotNull(change);
assertEquals(10, change.getKey());
assertEquals(toDelete, change.getValue());
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeTest.java
index 2f31791..2344109 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/datachange/RowStructuralDataChangeTest.java
@@ -355,7 +355,7 @@
assertEquals(1, this.dataChangeLayer.dataChanges.size());
assertEquals(1, this.deleteHandler.dataChanges.size());
- RowDeleteDataChange change = this.deleteHandler.dataChanges.get(10);
+ RowDeleteDataChange change = this.deleteHandler.dataChanges.get(Integer.valueOf(10));
assertNotNull(change);
assertEquals(10, change.getKey());
assertEquals(toDelete, change.getValue());
@@ -379,7 +379,7 @@
assertFalse("Cell 0/10 is dirty", this.dataChangeLayer.isCellDirty(0, 10));
assertFalse("Dirty label set", this.dataChangeLayer.getConfigLabelsByPosition(1, 10).hasLabel(DataChangeLayer.DIRTY));
- RowDeleteDataChange change = this.deleteHandler.dataChanges.get(10);
+ RowDeleteDataChange change = this.deleteHandler.dataChanges.get(Integer.valueOf(10));
assertNotNull(change);
assertEquals(10, change.getKey());
assertEquals(toDelete, change.getValue());
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/edit/gui/MultiCellEditDialogRunner.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/edit/gui/MultiCellEditDialogRunner.java
index e640b78..adacd59 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/edit/gui/MultiCellEditDialogRunner.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/edit/gui/MultiCellEditDialogRunner.java
@@ -12,6 +12,8 @@
******************************************************************************/
package org.eclipse.nebula.widgets.nattable.edit.gui;
+import static org.junit.Assert.assertEquals;
+
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry;
import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
@@ -27,7 +29,6 @@
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-import org.junit.Assert;
public class MultiCellEditDialogRunner {
@@ -60,16 +61,14 @@
IDataValidator dataValidator = new DataValidator() {
@Override
- public boolean validate(int columnIndex, int rowIndex,
- Object newValue) {
- Assert.assertEquals(newValue, newValue);
+ public boolean validate(int columnIndex, int rowIndex, Object newValue) {
+ assertEquals(newValue, newValue);
return false;
}
};
- Shell shell = new Shell(Display.getDefault(), SWT.H_SCROLL
- | SWT.V_SCROLL | SWT.RESIZE);
+ Shell shell = new Shell(Display.getDefault(), SWT.H_SCROLL | SWT.V_SCROLL | SWT.RESIZE);
ConfigRegistry configRegistry = new ConfigRegistry();
configRegistry.registerConfigAttribute(
@@ -79,8 +78,7 @@
EditConfigAttributes.DATA_VALIDATOR,
dataValidator);
- final CellEditDialog dialog = new CellEditDialog(shell,
- newValue, cell, cellEditor, configRegistry);
+ final CellEditDialog dialog = new CellEditDialog(shell, newValue, cell, cellEditor, configRegistry);
if (!this.interactive) {
Display.getDefault().asyncExec(new Runnable() {
@@ -89,7 +87,7 @@
try {
Thread.sleep(100);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Thread.currentThread().interrupt();
} finally {
dialog.close();
}
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/FormulaParserTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/FormulaParserTest.java
index ff0fd28..eef4b85 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/FormulaParserTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/FormulaParserTest.java
@@ -142,10 +142,10 @@
assertEquals(new BigDecimal(20 / 2 / 5), result.getValue());
result = this.parser.parseFunction("5 / 2");
- assertEquals(new BigDecimal(5d / 2), result.getValue());
+ assertEquals(BigDecimal.valueOf(5d / 2), result.getValue());
result = this.parser.parseFunction("100 / 4 / 5 / 2");
- assertEquals(new BigDecimal(100d / 4 / 5 / 2), result.getValue());
+ assertEquals(BigDecimal.valueOf(100d / 4 / 5 / 2), result.getValue());
result = this.parser.parseFunction("-15 / 3");
assertEquals(new BigDecimal(-15 / 3), result.getValue());
@@ -172,8 +172,8 @@
assertEquals(new BigDecimal(29), result.getValue());
result = this.parser.parseFunction("2*5+10/4-3");
- assertEquals(new BigDecimal(2 * 5 + 10d / 4 - 3), result.getValue());
- assertEquals(new BigDecimal(9.5), result.getValue());
+ assertEquals(BigDecimal.valueOf(2 * 5 + 10d / 4 - 3), result.getValue());
+ assertEquals(BigDecimal.valueOf(9.5), result.getValue());
}
@Test(expected = IllegalArgumentException.class)
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/function/FunctionTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/function/FunctionTest.java
index e638d5f..17c059d 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/function/FunctionTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/formula/function/FunctionTest.java
@@ -182,7 +182,7 @@
values.add(new BigDecimalFunctionValue(4));
values.add(new BigDecimalFunctionValue(2));
FunctionValue function = new QuotientFunction(values);
- assertEquals(new BigDecimal(20d / 4d / 2d), function.getValue());
+ assertEquals(BigDecimal.valueOf(20d / 4d / 2d), function.getValue());
}
@Test
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java
index bc7c4e5..6c0d5f4 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayerTest.java
@@ -1338,62 +1338,60 @@
// this hides completely the Address and Facts group and the first item
// of the Personal group via two separate commands
- if (this.selectionLayer.doCommand(new MultiColumnHideCommand(this.selectionLayer, 4, 5, 6, 7))
- && this.selectionLayer.doCommand(new MultiColumnHideCommand(this.selectionLayer, 4, 5, 6, 7))) {
- assertEquals(6, this.selectionLayer.getColumnCount());
+ this.selectionLayer.doCommand(new MultiColumnHideCommand(this.selectionLayer, 4, 5, 6, 7));
+ this.selectionLayer.doCommand(new MultiColumnHideCommand(this.selectionLayer, 4, 5, 6, 7));
- ILayerCell cell = this.columnGroupHeaderLayer.getCellByPosition(0, 0);
- assertEquals(0, cell.getOriginColumnPosition());
- assertEquals(4, cell.getColumnSpan());
- assertEquals("Person", cell.getDataValue());
- assertEquals(0, cell.getBounds().x);
- assertEquals(0, cell.getBounds().y);
- assertEquals(400, cell.getBounds().width);
- assertEquals(20, cell.getBounds().height);
+ assertEquals(6, this.selectionLayer.getColumnCount());
- cell = this.columnGroupHeaderLayer.getCellByPosition(4, 0);
- assertEquals(4, cell.getOriginColumnPosition());
- assertEquals(4, cell.getColumnPosition());
- assertEquals(12, cell.getColumnIndex());
- assertEquals(2, cell.getColumnSpan());
- assertEquals("Personal", cell.getDataValue());
- assertEquals(400, cell.getBounds().x);
- assertEquals(0, cell.getBounds().y);
- assertEquals(200, cell.getBounds().width);
- assertEquals(20, cell.getBounds().height);
+ ILayerCell cell = this.columnGroupHeaderLayer.getCellByPosition(0, 0);
+ assertEquals(0, cell.getOriginColumnPosition());
+ assertEquals(4, cell.getColumnSpan());
+ assertEquals("Person", cell.getDataValue());
+ assertEquals(0, cell.getBounds().x);
+ assertEquals(0, cell.getBounds().y);
+ assertEquals(400, cell.getBounds().width);
+ assertEquals(20, cell.getBounds().height);
- Group group1 = this.columnGroupHeaderLayer.getGroupModel().getGroupByPosition(0);
- assertEquals(0, group1.getStartIndex());
- assertEquals(0, group1.getVisibleStartIndex());
- assertEquals(0, group1.getVisibleStartPosition());
- assertEquals(4, group1.getOriginalSpan());
- assertEquals(4, group1.getVisibleSpan());
+ cell = this.columnGroupHeaderLayer.getCellByPosition(4, 0);
+ assertEquals(4, cell.getOriginColumnPosition());
+ assertEquals(4, cell.getColumnPosition());
+ assertEquals(12, cell.getColumnIndex());
+ assertEquals(2, cell.getColumnSpan());
+ assertEquals("Personal", cell.getDataValue());
+ assertEquals(400, cell.getBounds().x);
+ assertEquals(0, cell.getBounds().y);
+ assertEquals(200, cell.getBounds().width);
+ assertEquals(20, cell.getBounds().height);
- Group group4 = this.columnGroupHeaderLayer.getGroupModel().getGroupByPosition(4);
- assertEquals(11, group4.getStartIndex());
- assertEquals(12, group4.getVisibleStartIndex());
- assertEquals(4, group4.getVisibleStartPosition());
- assertEquals(3, group4.getOriginalSpan());
- assertEquals(2, group4.getVisibleSpan());
+ Group group1 = this.columnGroupHeaderLayer.getGroupModel().getGroupByPosition(0);
+ assertEquals(0, group1.getStartIndex());
+ assertEquals(0, group1.getVisibleStartIndex());
+ assertEquals(0, group1.getVisibleStartPosition());
+ assertEquals(4, group1.getOriginalSpan());
+ assertEquals(4, group1.getVisibleSpan());
- // these groups are not visible by column position, so we retrieve
- // it by name
- Group group2 = this.columnGroupHeaderLayer.getGroupModel().getGroupByName("Address");
- assertEquals(4, group2.getStartIndex());
- assertEquals(-1, group2.getVisibleStartIndex());
- assertEquals(-1, group2.getVisibleStartPosition());
- assertEquals(4, group2.getOriginalSpan());
- assertEquals(0, group2.getVisibleSpan());
+ Group group4 = this.columnGroupHeaderLayer.getGroupModel().getGroupByPosition(4);
+ assertEquals(11, group4.getStartIndex());
+ assertEquals(12, group4.getVisibleStartIndex());
+ assertEquals(4, group4.getVisibleStartPosition());
+ assertEquals(3, group4.getOriginalSpan());
+ assertEquals(2, group4.getVisibleSpan());
- Group group3 = this.columnGroupHeaderLayer.getGroupModel().getGroupByName("Facts");
- assertEquals(8, group3.getStartIndex());
- assertEquals(-1, group3.getVisibleStartIndex());
- assertEquals(-1, group3.getVisibleStartPosition());
- assertEquals(3, group3.getOriginalSpan());
- assertEquals(0, group3.getVisibleSpan());
- } else {
- fail("Column not hidden");
- }
+ // these groups are not visible by column position, so we retrieve
+ // it by name
+ Group group2 = this.columnGroupHeaderLayer.getGroupModel().getGroupByName("Address");
+ assertEquals(4, group2.getStartIndex());
+ assertEquals(-1, group2.getVisibleStartIndex());
+ assertEquals(-1, group2.getVisibleStartPosition());
+ assertEquals(4, group2.getOriginalSpan());
+ assertEquals(0, group2.getVisibleSpan());
+
+ Group group3 = this.columnGroupHeaderLayer.getGroupModel().getGroupByName("Facts");
+ assertEquals(8, group3.getStartIndex());
+ assertEquals(-1, group3.getVisibleStartIndex());
+ assertEquals(-1, group3.getVisibleStartPosition());
+ assertEquals(3, group3.getOriginalSpan());
+ assertEquals(0, group3.getVisibleSpan());
// show again
if (this.gridLayer.doCommand(new ShowAllColumnsCommand())) {
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java
index d49f404..ba7cc5e 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayerTest.java
@@ -1335,62 +1335,59 @@
// this hides completely the Address and Facts group and the first item
// of the Personal group via two separate commands
- if (this.selectionLayer.doCommand(new MultiRowHideCommand(this.selectionLayer, 4, 5, 6, 7))
- && this.selectionLayer.doCommand(new MultiRowHideCommand(this.selectionLayer, 4, 5, 6, 7))) {
- assertEquals(6, this.selectionLayer.getRowCount());
+ this.selectionLayer.doCommand(new MultiRowHideCommand(this.selectionLayer, 4, 5, 6, 7));
+ this.selectionLayer.doCommand(new MultiRowHideCommand(this.selectionLayer, 4, 5, 6, 7));
+ assertEquals(6, this.selectionLayer.getRowCount());
- ILayerCell cell = this.rowGroupHeaderLayer.getCellByPosition(0, 0);
- assertEquals(0, cell.getOriginRowPosition());
- assertEquals(4, cell.getRowSpan());
- assertEquals("Person", cell.getDataValue());
- assertEquals(0, cell.getBounds().y);
- assertEquals(0, cell.getBounds().x);
- assertEquals(80, cell.getBounds().height);
- assertEquals(20, cell.getBounds().width);
+ ILayerCell cell = this.rowGroupHeaderLayer.getCellByPosition(0, 0);
+ assertEquals(0, cell.getOriginRowPosition());
+ assertEquals(4, cell.getRowSpan());
+ assertEquals("Person", cell.getDataValue());
+ assertEquals(0, cell.getBounds().y);
+ assertEquals(0, cell.getBounds().x);
+ assertEquals(80, cell.getBounds().height);
+ assertEquals(20, cell.getBounds().width);
- cell = this.rowGroupHeaderLayer.getCellByPosition(0, 4);
- assertEquals(4, cell.getOriginRowPosition());
- assertEquals(4, cell.getRowPosition());
- assertEquals(12, cell.getRowIndex());
- assertEquals(2, cell.getRowSpan());
- assertEquals("Personal", cell.getDataValue());
- assertEquals(80, cell.getBounds().y);
- assertEquals(0, cell.getBounds().x);
- assertEquals(40, cell.getBounds().height);
- assertEquals(20, cell.getBounds().width);
+ cell = this.rowGroupHeaderLayer.getCellByPosition(0, 4);
+ assertEquals(4, cell.getOriginRowPosition());
+ assertEquals(4, cell.getRowPosition());
+ assertEquals(12, cell.getRowIndex());
+ assertEquals(2, cell.getRowSpan());
+ assertEquals("Personal", cell.getDataValue());
+ assertEquals(80, cell.getBounds().y);
+ assertEquals(0, cell.getBounds().x);
+ assertEquals(40, cell.getBounds().height);
+ assertEquals(20, cell.getBounds().width);
- Group group1 = this.rowGroupHeaderLayer.getGroupModel().getGroupByPosition(0);
- assertEquals(0, group1.getStartIndex());
- assertEquals(0, group1.getVisibleStartIndex());
- assertEquals(0, group1.getVisibleStartPosition());
- assertEquals(4, group1.getOriginalSpan());
- assertEquals(4, group1.getVisibleSpan());
+ Group group1 = this.rowGroupHeaderLayer.getGroupModel().getGroupByPosition(0);
+ assertEquals(0, group1.getStartIndex());
+ assertEquals(0, group1.getVisibleStartIndex());
+ assertEquals(0, group1.getVisibleStartPosition());
+ assertEquals(4, group1.getOriginalSpan());
+ assertEquals(4, group1.getVisibleSpan());
- Group group4 = this.rowGroupHeaderLayer.getGroupModel().getGroupByPosition(4);
- assertEquals(11, group4.getStartIndex());
- assertEquals(12, group4.getVisibleStartIndex());
- assertEquals(4, group4.getVisibleStartPosition());
- assertEquals(3, group4.getOriginalSpan());
- assertEquals(2, group4.getVisibleSpan());
+ Group group4 = this.rowGroupHeaderLayer.getGroupModel().getGroupByPosition(4);
+ assertEquals(11, group4.getStartIndex());
+ assertEquals(12, group4.getVisibleStartIndex());
+ assertEquals(4, group4.getVisibleStartPosition());
+ assertEquals(3, group4.getOriginalSpan());
+ assertEquals(2, group4.getVisibleSpan());
- // these groups are not visible by column position, so we retrieve
- // it by name
- Group group2 = this.rowGroupHeaderLayer.getGroupModel().getGroupByName("Address");
- assertEquals(4, group2.getStartIndex());
- assertEquals(-1, group2.getVisibleStartIndex());
- assertEquals(-1, group2.getVisibleStartPosition());
- assertEquals(4, group2.getOriginalSpan());
- assertEquals(0, group2.getVisibleSpan());
+ // these groups are not visible by column position, so we retrieve
+ // it by name
+ Group group2 = this.rowGroupHeaderLayer.getGroupModel().getGroupByName("Address");
+ assertEquals(4, group2.getStartIndex());
+ assertEquals(-1, group2.getVisibleStartIndex());
+ assertEquals(-1, group2.getVisibleStartPosition());
+ assertEquals(4, group2.getOriginalSpan());
+ assertEquals(0, group2.getVisibleSpan());
- Group group3 = this.rowGroupHeaderLayer.getGroupModel().getGroupByName("Facts");
- assertEquals(8, group3.getStartIndex());
- assertEquals(-1, group3.getVisibleStartIndex());
- assertEquals(-1, group3.getVisibleStartPosition());
- assertEquals(3, group3.getOriginalSpan());
- assertEquals(0, group3.getVisibleSpan());
- } else {
- fail("Row not hidden");
- }
+ Group group3 = this.rowGroupHeaderLayer.getGroupModel().getGroupByName("Facts");
+ assertEquals(8, group3.getStartIndex());
+ assertEquals(-1, group3.getVisibleStartIndex());
+ assertEquals(-1, group3.getVisibleStartPosition());
+ assertEquals(3, group3.getOriginalSpan());
+ assertEquals(0, group3.getVisibleSpan());
// show again
if (this.gridLayer.doCommand(new ShowAllRowsCommand())) {
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTest.java
index e356fe6..df9c59d 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTest.java
@@ -35,7 +35,7 @@
List<Car> input = new ArrayList<>();
input.add(new Car("Mercedes", "C Klasse"));
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, false, CarService.PROPERTY_NAMES);
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, false, CarService.getPropertyNames());
assertEquals(1, result.size());
}
@@ -51,7 +51,7 @@
input.add(car);
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, false, Arrays.asList(CarService.PROPERTY_NAMES));
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, false, Arrays.asList(CarService.getPropertyNames()));
assertEquals(2, result.size());
}
@@ -71,7 +71,7 @@
input.add(car);
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, false, Arrays.asList(CarService.PROPERTY_NAMES));
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, false, Arrays.asList(CarService.getPropertyNames()));
assertEquals(3, result.size());
@@ -99,7 +99,7 @@
// System.out.println();
// test get data value
- HierarchicalReflectiveColumnPropertyAccessor accessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.PROPERTY_NAMES);
+ HierarchicalReflectiveColumnPropertyAccessor accessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.getPropertyNames());
assertEquals(Classification.NEUTRAL, accessor.getDataValue(result.get(1), 7));
// test set data value
@@ -118,7 +118,7 @@
List<Car> input = new ArrayList<>();
input.add(new Car("Mercedes", "C Klasse"));
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.PROPERTY_NAMES));
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.getPropertyNames()));
assertEquals(1, result.size());
}
@@ -134,7 +134,7 @@
input.add(car);
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.PROPERTY_NAMES));
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.getPropertyNames()));
assertEquals(3, result.size());
}
@@ -154,7 +154,7 @@
input.add(car);
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.PROPERTY_NAMES));
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.getPropertyNames()));
assertEquals(5, result.size());
@@ -184,7 +184,7 @@
// test get data value
// with structure parent objects, first object is Car, second Car +
// Motor, third Car + Motor + Feedback
- HierarchicalReflectiveColumnPropertyAccessor accessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.PROPERTY_NAMES);
+ HierarchicalReflectiveColumnPropertyAccessor accessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.getPropertyNames());
HierarchicalWrapper first = result.get(0);
HierarchicalWrapper second = result.get(1);
HierarchicalWrapper third = result.get(2);
@@ -232,7 +232,7 @@
input.add(car2);
- List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.PROPERTY_NAMES));
+ List<HierarchicalWrapper> result = HierarchicalHelper.deNormalize(input, true, Arrays.asList(CarService.getPropertyNames()));
assertEquals(7, result.size());
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTreeLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTreeLayerTest.java
index 3d1907e..f367187 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTreeLayerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/HierarchicalTreeLayerTest.java
@@ -99,13 +99,13 @@
@Before
public void setup() {
// de-normalize the object graph without parent structure objects
- this.data = HierarchicalHelper.deNormalize(CarService.getInput(), false, CarService.PROPERTY_NAMES_COMPACT);
+ this.data = HierarchicalHelper.deNormalize(CarService.getInput(), false, CarService.getPropertyNamesCompact());
HierarchicalReflectiveColumnPropertyAccessor columnPropertyAccessor =
- new HierarchicalReflectiveColumnPropertyAccessor(CarService.PROPERTY_NAMES_COMPACT);
+ new HierarchicalReflectiveColumnPropertyAccessor(CarService.getPropertyNamesCompact());
this.bodyDataProvider = new ListDataProvider<>(this.data, columnPropertyAccessor);
- HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(this.bodyDataProvider, CarService.PROPERTY_NAMES_COMPACT);
+ HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(this.bodyDataProvider, CarService.getPropertyNamesCompact());
this.bodyDataLayer = new SpanningDataLayer(spanningDataProvider);
// simply apply labels for every column by index
@@ -114,7 +114,7 @@
this.columnHideShowLayer = new ColumnHideShowLayer(this.columnReorderLayer);
this.rowHideShowLayer = new RowHideShowLayer(this.columnHideShowLayer);
this.selectionLayer = new SelectionLayer(this.rowHideShowLayer);
- this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.data, CarService.PROPERTY_NAMES_COMPACT);
+ this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.data, CarService.getPropertyNamesCompact());
this.layerListener = new LayerListenerFixture();
this.treeLayer.addLayerListener(this.layerListener);
@@ -637,7 +637,7 @@
@Test
public void testGetDisplayModeByPositionWithSelectionLayer() {
- this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.data, CarService.PROPERTY_NAMES_COMPACT, this.selectionLayer);
+ this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.data, CarService.getPropertyNamesCompact(), this.selectionLayer);
// first test that all cells in a row are NORMAL
for (int i = 0; i < this.treeLayer.getColumnCount(); i++) {
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/action/HierarchicalTreeColumnReorderDragModeTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/action/HierarchicalTreeColumnReorderDragModeTest.java
index 799809e..a0a3ab6 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/action/HierarchicalTreeColumnReorderDragModeTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/hierarchical/action/HierarchicalTreeColumnReorderDragModeTest.java
@@ -42,13 +42,13 @@
@Before
public void setup() {
// de-normalize the object graph without parent structure objects
- List<HierarchicalWrapper> data = HierarchicalHelper.deNormalize(CarService.getInput(), false, CarService.PROPERTY_NAMES_COMPACT);
+ List<HierarchicalWrapper> data = HierarchicalHelper.deNormalize(CarService.getInput(), false, CarService.getPropertyNamesCompact());
HierarchicalReflectiveColumnPropertyAccessor columnPropertyAccessor =
- new HierarchicalReflectiveColumnPropertyAccessor(CarService.PROPERTY_NAMES_COMPACT);
+ new HierarchicalReflectiveColumnPropertyAccessor(CarService.getPropertyNamesCompact());
IRowDataProvider<HierarchicalWrapper> bodyDataProvider = new ListDataProvider<>(data, columnPropertyAccessor);
- HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(bodyDataProvider, CarService.PROPERTY_NAMES_COMPACT);
+ HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(bodyDataProvider, CarService.getPropertyNamesCompact());
DataLayer bodyDataLayer = new SpanningDataLayer(spanningDataProvider);
// simply apply labels for every column by index
@@ -56,7 +56,7 @@
ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(bodyDataLayer);
ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer);
- this.treeLayer = new HierarchicalTreeLayer(selectionLayer, data, CarService.PROPERTY_NAMES_COMPACT);
+ this.treeLayer = new HierarchicalTreeLayer(selectionLayer, data, CarService.getPropertyNamesCompact());
}
@Test
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/ColumnSelectionTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/ColumnSelectionTest.java
index a5b0151..1069714 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/ColumnSelectionTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/ColumnSelectionTest.java
@@ -59,7 +59,7 @@
// Last selected cell should be part of last row
assertEquals(2, this.selectionLayer.getLastSelectedCellPosition().getColumnPosition());
- assertEquals(rowCount - 1, this.selectionLayer.getLastSelectedCellPosition().getRowPosition());
+ assertEquals(rowCount - 1l, this.selectionLayer.getLastSelectedCellPosition().getRowPosition());
// Cells in between should have been selected
assertEquals(rowCount, this.selectionLayer.getSelectedRowCount());
@@ -170,7 +170,7 @@
// Last selected cell should be part of last row
assertEquals(1, this.selectionLayer.getLastSelectedCellPosition().getColumnPosition());
final int lastRowPosition = this.selectionLayer.getLastSelectedCellPosition().getRowPosition();
- assertEquals(rowCount - 1, lastRowPosition);
+ assertEquals(rowCount - 1l, lastRowPosition);
// Cells in column should have been selected
assertEquals(rowCount, this.selectionLayer.getSelectedRowCount());
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/EditTraversalStrategyUpDownTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/EditTraversalStrategyUpDownTest.java
index 93af826..88982aa 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/EditTraversalStrategyUpDownTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/EditTraversalStrategyUpDownTest.java
@@ -1241,7 +1241,7 @@
try {
Thread.sleep(50);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Thread.currentThread().interrupt();
}
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/PreserveSelectionModelStructuralChangeEventHandlerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/PreserveSelectionModelStructuralChangeEventHandlerTest.java
index e951db3..253c67c 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/PreserveSelectionModelStructuralChangeEventHandlerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/PreserveSelectionModelStructuralChangeEventHandlerTest.java
@@ -128,7 +128,7 @@
assertEquals(1, this.selectionLayer.getFullySelectedRowPositions().length);
assertEquals(1, this.selectionLayer.getSelectedRowCount());
- assertEquals(this.listFixture.size() - 1, this.selectionLayer.getFullySelectedRowPositions()[0]);
+ assertEquals(this.listFixture.size() - 1l, this.selectionLayer.getFullySelectedRowPositions()[0]);
}
@Test
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RangeTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RangeTest.java
index 4b17a5b..4dbf4f3 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RangeTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RangeTest.java
@@ -49,7 +49,8 @@
@Test
public void shouldIdentifyEquality() {
- assertTrue(new Range(3, 10).equals(new Range(3, 10)));
+ Range test = new Range(3, 10);
+ assertTrue(test.equals(new Range(3, 10)));
}
@Test
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionModelStructuralChangeEventHandlerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionModelStructuralChangeEventHandlerTest.java
index 6c852eb..e8726da 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionModelStructuralChangeEventHandlerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionModelStructuralChangeEventHandlerTest.java
@@ -130,7 +130,7 @@
assertEquals(1, this.selectionLayer.getFullySelectedRowPositions().length);
assertEquals(1, this.selectionLayer.getSelectedRowCount());
- assertEquals(this.listFixture.size() - 1, this.selectionLayer.getFullySelectedRowPositions()[0]);
+ assertEquals(this.listFixture.size() - 1l, this.selectionLayer.getFullySelectedRowPositions()[0]);
}
@Test
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTest.java
index 9fcb662..67ff6cb 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTest.java
@@ -55,7 +55,7 @@
assertEquals(2, this.selectionLayer.getSelectionAnchor().getRowPosition());
// Last selected cell should be part of last column
- assertEquals(columnCount - 1, this.selectionLayer.getLastSelectedCellPosition().getColumnPosition());
+ assertEquals(columnCount - 1l, this.selectionLayer.getLastSelectedCellPosition().getColumnPosition());
assertEquals(2, this.selectionLayer.getLastSelectedCellPosition().getRowPosition());
// Cells in between should have been selected
@@ -189,7 +189,7 @@
// Last selected cell should be part of last column
assertEquals(1, this.selectionLayer.getLastSelectedCellPosition().getRowPosition());
int lastColumnPosition = this.selectionLayer.getLastSelectedCellPosition().getColumnPosition();
- assertEquals(columnCount - 1, lastColumnPosition);
+ assertEquals(columnCount - 1l, lastColumnPosition);
// Cells in row should have been selected
int[] selectedColumns = this.selectionLayer.getSelectedColumnPositions();
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTraversalTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTraversalTest.java
index aaaf26d..054f088 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTraversalTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/RowSelectionTraversalTest.java
@@ -117,7 +117,7 @@
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT,
ITraversalStrategy.AXIS_CYCLE_TRAVERSAL_STRATEGY, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -139,7 +139,7 @@
// move one to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -179,7 +179,7 @@
// move 3 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -219,7 +219,7 @@
// move one to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -239,7 +239,7 @@
// move one to right at end -> relocate at beginning, same row
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -259,7 +259,7 @@
// move 3 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -279,7 +279,7 @@
// move 4 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -299,7 +299,7 @@
// move 24 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -319,7 +319,7 @@
// move one to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -339,7 +339,7 @@
// move one to right at end -> relocate at beginning, new row
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -379,7 +379,7 @@
// move 3 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -399,7 +399,7 @@
// move 4 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -419,7 +419,7 @@
// move 24 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -459,7 +459,7 @@
// move one to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -479,7 +479,7 @@
// move one to right at end -> relocate at beginning, new row
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -499,7 +499,7 @@
// move one to right at end -> relocate at beginning, top
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -522,7 +522,7 @@
// move 3 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -542,7 +542,7 @@
// move 4 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -562,7 +562,7 @@
// move 24 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -582,7 +582,7 @@
// move 34 steps to right
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.RIGHT, 34, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(2, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -604,7 +604,7 @@
// move one to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -624,7 +624,7 @@
// move on to left at beginning -> stay
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -644,7 +644,7 @@
// move 3 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -664,7 +664,7 @@
// move 4 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -684,7 +684,7 @@
// move one to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -724,7 +724,7 @@
// move 3 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -744,7 +744,7 @@
// move 4 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -764,7 +764,7 @@
// move 24 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -784,7 +784,7 @@
// move one to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -824,7 +824,7 @@
// move one to left at beginning -> stay
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -844,7 +844,7 @@
// move 3 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -864,7 +864,7 @@
// move 4 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(3, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -884,7 +884,7 @@
// move 24 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -904,7 +904,7 @@
// move 24 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -924,7 +924,7 @@
// move one to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -984,7 +984,7 @@
// move 3 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(4, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1004,7 +1004,7 @@
// move 4 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(3, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1024,7 +1024,7 @@
// move 24 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1044,7 +1044,7 @@
// move 34 steps to left
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.LEFT, 34, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1066,7 +1066,7 @@
// move one down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1086,7 +1086,7 @@
// move down at end -> stay
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(9, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1106,7 +1106,7 @@
// move 3 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1126,7 +1126,7 @@
// move 4 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(9, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1146,7 +1146,7 @@
// move one down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1166,7 +1166,7 @@
// move down at end -> relocate at beginning, same column
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1186,7 +1186,7 @@
// move 3 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1206,7 +1206,7 @@
// move 4 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1226,7 +1226,7 @@
// move 24 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1246,7 +1246,7 @@
// move one down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1266,7 +1266,7 @@
// move one down at end -> relocate at beginning, new column
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1306,7 +1306,7 @@
// move 3 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1326,7 +1326,7 @@
// move 4 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1346,7 +1346,7 @@
// move 24 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1386,7 +1386,7 @@
// move one down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(5, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1406,7 +1406,7 @@
// move one down at end -> relocate at beginning, new column
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1426,7 +1426,7 @@
// move one to right at end -> relocate at beginning, top
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1446,7 +1446,7 @@
// move 3 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(7, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1466,7 +1466,7 @@
// move 4 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1486,7 +1486,7 @@
// move 24 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1506,7 +1506,7 @@
// move 34 steps down
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.DOWN, 34, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1528,7 +1528,7 @@
// move one up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(3, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1548,7 +1548,7 @@
// move up at beginning -> stay
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1568,7 +1568,7 @@
// move 3 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1588,7 +1588,7 @@
// move 4 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1608,7 +1608,7 @@
// move one up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(3, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1628,7 +1628,7 @@
// move one up at beginning -> relocate at end, same column
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(9, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1648,7 +1648,7 @@
// move 3 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1668,7 +1668,7 @@
// move 4 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1688,7 +1688,7 @@
// move 24 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1708,7 +1708,7 @@
// move one up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(3, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1728,7 +1728,7 @@
// move one up at beginning -> relocate at end, new column
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(9, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1748,7 +1748,7 @@
// move one up at beginning -> stay
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1768,7 +1768,7 @@
// move 3 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1788,7 +1788,7 @@
// move 4 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1808,7 +1808,7 @@
// move 24 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1828,7 +1828,7 @@
// move 24 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(0, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1848,7 +1848,7 @@
// move one up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(3, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1868,7 +1868,7 @@
// move one up at beginning -> relocate at end, new column
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(9, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1908,7 +1908,7 @@
// move 3 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 3, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(1, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1928,7 +1928,7 @@
// move 4 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 4, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1948,7 +1948,7 @@
// move 24 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 24, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
@@ -1968,7 +1968,7 @@
// move 34 steps up
this.viewportLayer.doCommand(new MoveSelectionCommand(MoveDirectionEnum.UP, 34, false, false));
- assertEquals(this.selectionLayer.getColumnCount() - 1, this.selectionLayer.getLastSelectedCell().getColumnPosition());
+ assertEquals(this.selectionLayer.getColumnCount() - 1l, this.selectionLayer.getLastSelectedCell().getColumnPosition());
assertEquals(8, this.selectionLayer.getLastSelectedCell().getRowPosition());
assertEquals(1, this.selectionLayer.getSelectedRowCount());
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/event/SelectionEventsTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/event/SelectionEventsTest.java
index 5268eb1..37195b8 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/event/SelectionEventsTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/selection/event/SelectionEventsTest.java
@@ -26,26 +26,26 @@
public class SelectionEventsTest {
- public static boolean NO_SHIFT = false;
- public static boolean NO_CTRL = false;
+ public static final boolean NO_SHIFT = false;
+ public static final boolean NO_CTRL = false;
- public static boolean WITH_SHIFT = true;
- public static boolean WITH_CTRL = true;
+ public static final boolean WITH_SHIFT = true;
+ public static final boolean WITH_CTRL = true;
- NatTableFixture nattable;
+ NatTableFixture natTable;
private LayerListenerFixture listener;
@Before
public void setup() {
- this.nattable = new NatTableFixture();
+ this.natTable = new NatTableFixture();
this.listener = new LayerListenerFixture();
- this.nattable.addLayerListener(this.listener);
+ this.natTable.addLayerListener(this.listener);
}
@Test
public void shouldFireCellSelectionEvent() {
// Grid coordinates
- this.nattable.doCommand(new SelectCellCommand(this.nattable, 1, 5, NO_SHIFT, NO_CTRL));
+ this.natTable.doCommand(new SelectCellCommand(this.natTable, 1, 5, NO_SHIFT, NO_CTRL));
assertEquals(1, this.listener.getEventsCount());
assertTrue(this.listener.containsInstanceOf(CellSelectionEvent.class));
@@ -58,7 +58,7 @@
@Test
public void shouldFireRowSelectionEvent() {
// Select single row
- this.nattable.doCommand(new SelectRowsCommand(this.nattable, 5, 5, NO_SHIFT, NO_CTRL));
+ this.natTable.doCommand(new SelectRowsCommand(this.natTable, 5, 5, NO_SHIFT, NO_CTRL));
assertEquals(1, this.listener.getEventsCount());
assertTrue(this.listener.containsInstanceOf(RowSelectionEvent.class));
@@ -68,7 +68,7 @@
assertEquals(6, event.getRowPositionRanges().iterator().next().end);
// Select additional rows with shift
- this.nattable.doCommand(new SelectRowsCommand(this.nattable, 5, 7, WITH_SHIFT, NO_CTRL));
+ this.natTable.doCommand(new SelectRowsCommand(this.natTable, 5, 7, WITH_SHIFT, NO_CTRL));
assertEquals(2, this.listener.getEventsCount());
assertTrue(this.listener.containsInstanceOf(RowSelectionEvent.class));
@@ -81,7 +81,7 @@
@Test
public void shouldFireColumnSelectionEvent() {
- this.nattable.doCommand(new SelectColumnCommand(this.nattable, 5, 5, NO_SHIFT, NO_CTRL));
+ this.natTable.doCommand(new SelectColumnCommand(this.natTable, 5, 5, NO_SHIFT, NO_CTRL));
assertEquals(2, this.listener.getEventsCount());
assertTrue(this.listener.containsInstanceOf(ColumnSelectionEvent.class));
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/style/StyleInheritanceTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/style/StyleInheritanceTest.java
index d0d377c..a5bb0ec 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/style/StyleInheritanceTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/style/StyleInheritanceTest.java
@@ -60,16 +60,14 @@
this.superCellStyle);
// Setup even row style
- this.evenCellStyle = new Style() {
- {
- setAttributeValue(
- CellStyleAttributes.BACKGROUND_COLOR,
- Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
- setAttributeValue(
- CellStyleAttributes.FOREGROUND_COLOR,
- Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- }
- };
+ this.evenCellStyle = new Style();
+ this.evenCellStyle.setAttributeValue(
+ CellStyleAttributes.BACKGROUND_COLOR,
+ Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
+ this.evenCellStyle.setAttributeValue(
+ CellStyleAttributes.FOREGROUND_COLOR,
+ Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
+
this.configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_STYLE,
this.evenCellStyle,
@@ -77,13 +75,10 @@
AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);
// Setup odd row style
- this.oddCellStyle = new Style() {
- {
- setAttributeValue(
- CellStyleAttributes.FOREGROUND_COLOR,
- Display.getDefault().getSystemColor(SWT.COLOR_RED));
- }
- };
+ this.oddCellStyle = new Style();
+ this.oddCellStyle.setAttributeValue(
+ CellStyleAttributes.FOREGROUND_COLOR,
+ Display.getDefault().getSystemColor(SWT.COLOR_RED));
this.configRegistry.registerConfigAttribute(
CellConfigAttributes.CELL_STYLE,
this.oddCellStyle,
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/BorderStyleFixture.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/BorderStyleFixture.java
index 8aa7493..9ad11d2 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/BorderStyleFixture.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/BorderStyleFixture.java
@@ -18,9 +18,9 @@
public class BorderStyleFixture extends BorderStyle {
- public static int THICKNESS = 2;
- public static Color COLOR = GUIHelper.COLOR_GREEN;
- public static LineStyleEnum LINE_STYLE = LineStyleEnum.DASHDOT;
+ public static final int THICKNESS = 2;
+ public static final Color COLOR = GUIHelper.COLOR_GREEN;
+ public static final LineStyleEnum LINE_STYLE = LineStyleEnum.DASHDOT;
public BorderStyleFixture() {
super(2, COLOR, LINE_STYLE);
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ColumnHeaderLayerFixture.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ColumnHeaderLayerFixture.java
index b89b96e..c2fb8f4 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ColumnHeaderLayerFixture.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ColumnHeaderLayerFixture.java
@@ -20,20 +20,19 @@
public class ColumnHeaderLayerFixture extends ColumnHeaderLayer {
// Viewport is 400px wide
- public static DataLayer dataLayer = new DataLayerFixture();
- public static SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
- public static ViewportLayer bodyLayer = new ViewportLayerFixture(
- selectionLayer);
+ public static final DataLayer DATA_LAYER = new DataLayerFixture();
+ public static final SelectionLayer SELECTION_LAYER = new SelectionLayer(DATA_LAYER);
+ public static final ViewportLayer BODY_LAYER = new ViewportLayerFixture(SELECTION_LAYER);
public ColumnHeaderLayerFixture() {
- super(dataLayer, bodyLayer, selectionLayer);
+ super(DATA_LAYER, BODY_LAYER, SELECTION_LAYER);
}
public ColumnHeaderLayerFixture(ViewportLayer viewportLayer) {
- super(dataLayer, viewportLayer, selectionLayer);
+ super(DATA_LAYER, viewportLayer, SELECTION_LAYER);
}
public static DataLayer getDataLayer() {
- return dataLayer;
+ return DATA_LAYER;
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ViewportLayerFixture.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ViewportLayerFixture.java
index 4457c0b..2c743b0 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ViewportLayerFixture.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/fixture/layer/ViewportLayerFixture.java
@@ -28,9 +28,9 @@
*/
public class ViewportLayerFixture extends ViewportLayer {
- public static Rectangle DEFAULT_CLIENT_AREA = new Rectangle(0, 0, 200, 100);
- public static IClientAreaProvider DEFAULT_CLIENT_AREA_PROVIDER = getClientAreaProvider(DEFAULT_CLIENT_AREA);
- public static Scrollable DEFAULT_SCROLLABLE = scrollable();
+ public static final Rectangle DEFAULT_CLIENT_AREA = new Rectangle(0, 0, 200, 100);
+ public static final IClientAreaProvider DEFAULT_CLIENT_AREA_PROVIDER = getClientAreaProvider(DEFAULT_CLIENT_AREA);
+ public static final Scrollable DEFAULT_SCROLLABLE = scrollable();
/**
* Default Xtor
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/integration/PersistenceIntegrationTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/integration/PersistenceIntegrationTest.java
index 9e15824..cfc33fa 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/integration/PersistenceIntegrationTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/test/integration/PersistenceIntegrationTest.java
@@ -13,7 +13,6 @@
package org.eclipse.nebula.widgets.nattable.test.integration;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import java.util.Properties;
@@ -48,10 +47,8 @@
IUniqueIndexLayer columnHeaderDataLayer,
IUniqueIndexLayer rowHeaderDataLayer,
IUniqueIndexLayer cornerDataLayer) {
- RowReorderLayer rowReorderLayer = new RowReorderLayer(
- bodyDataLayer);
- super.init(rowReorderLayer, columnHeaderDataLayer,
- rowHeaderDataLayer, cornerDataLayer);
+ RowReorderLayer rowReorderLayer = new RowReorderLayer(bodyDataLayer);
+ super.init(rowReorderLayer, columnHeaderDataLayer, rowHeaderDataLayer, cornerDataLayer);
}
});
@@ -75,21 +72,18 @@
public void saveStateToPropeties() throws Exception {
// Resize column 2 to 200px
assertEquals(100, this.natTableFixture.getColumnWidthByPosition(2));
- this.natTableFixture.doCommand(new ColumnResizeCommand(this.natTableFixture, 2,
- 200));
+ this.natTableFixture.doCommand(new ColumnResizeCommand(this.natTableFixture, 2, 200));
assertEquals(200, this.natTableFixture.getColumnWidthByPosition(2));
// Resize row 2 to 100px
assertEquals(20, this.natTableFixture.getRowHeightByPosition(2));
- this.natTableFixture
- .doCommand(new RowResizeCommand(this.natTableFixture, 2, 100));
+ this.natTableFixture.doCommand(new RowResizeCommand(this.natTableFixture, 2, 100));
assertEquals(100, this.natTableFixture.getRowHeightByPosition(2));
// Reorder column 1 --> 5 (grid coordinates)
// 0, 1, 2, 3, 4, 5,.. --> 1, 2, 3, 0, 4, 5,..
assertEquals(0, this.natTableFixture.getColumnIndexByPosition(1));
- this.natTableFixture.doCommand(new ColumnReorderCommand(this.natTableFixture, 1,
- 5));
+ this.natTableFixture.doCommand(new ColumnReorderCommand(this.natTableFixture, 1, 5));
assertEquals(1, this.natTableFixture.getColumnIndexByPosition(1));
// Reorder row 1 --> 5 (grid coordinates)
@@ -108,65 +102,59 @@
// Ensure that properties got persisted
assertEquals(
"true",
- this.properties
- .get("testPrefix.COLUMN_HEADER.columnWidth.resizableByDefault"));
+ this.properties.get("testPrefix.COLUMN_HEADER.columnWidth.resizableByDefault"));
assertEquals(
"100",
- this.properties
- .get("testPrefix.COLUMN_HEADER.columnWidth.defaultSize"));
+ this.properties.get("testPrefix.COLUMN_HEADER.columnWidth.defaultSize"));
assertEquals(
"true",
- this.properties
- .get("testPrefix.COLUMN_HEADER.rowHeight.resizableByDefault"));
+ this.properties.get("testPrefix.COLUMN_HEADER.rowHeight.resizableByDefault"));
- assertEquals("40",
+ assertEquals(
+ "40",
this.properties.get("testPrefix.ROW_HEADER.columnWidth.defaultSize"));
assertEquals(
"true",
- this.properties
- .get("testPrefix.ROW_HEADER.rowHeight.resizableByDefault"));
+ this.properties.get("testPrefix.ROW_HEADER.rowHeight.resizableByDefault"));
assertEquals(
"true",
- this.properties
- .get("testPrefix.ROW_HEADER.columnWidth.resizableByDefault"));
- assertEquals("40",
+ this.properties.get("testPrefix.ROW_HEADER.columnWidth.resizableByDefault"));
+ assertEquals(
+ "40",
this.properties.get("testPrefix.ROW_HEADER.rowHeight.defaultSize"));
- assertEquals("20",
+ assertEquals(
+ "20",
this.properties.get("testPrefix.CORNER.rowHeight.defaultSize"));
assertEquals(
"true",
- this.properties
- .get("testPrefix.CORNER.columnWidth.resizableByDefault"));
- assertEquals("true",
- this.properties
- .get("testPrefix.CORNER.rowHeight.resizableByDefault"));
+ this.properties.get("testPrefix.CORNER.columnWidth.resizableByDefault"));
+ assertEquals(
+ "true",
+ this.properties.get("testPrefix.CORNER.rowHeight.resizableByDefault"));
- assertEquals("20",
+ assertEquals(
+ "20",
this.properties.get("testPrefix.BODY.rowHeight.defaultSize"));
- assertEquals("true",
+ assertEquals(
+ "true",
this.properties.get("testPrefix.BODY.rowHeight.resizableByDefault"));
- assertEquals("true",
- this.properties
- .get("testPrefix.BODY.columnWidth.resizableByDefault"));
- assertEquals("1,2,3,0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19",
+ assertEquals(
+ "true",
+ this.properties.get("testPrefix.BODY.columnWidth.resizableByDefault"));
+ assertEquals(
+ "1,2,3,0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19",
this.properties.get("testPrefix.BODY.columnIndexOrder"));
- assertEquals("1:100,",
+ assertEquals(
+ "1:100,",
this.properties.get("testPrefix.BODY.rowHeight.sizes"));
- assertEquals("1:200,",
+ assertEquals(
+ "1:200,",
this.properties.get("testPrefix.BODY.columnWidth.sizes"));
}
@Test
- public void tableShouldDefaultProperlyIfNoPropertiesAreLoaded()
- throws Exception {
- boolean exceptionOccured = false;
- try {
- this.natTableFixture.loadState(TEST_PERSISTENCE_PREFIX, this.properties);
- } catch (Exception e) {
- e.printStackTrace();
- exceptionOccured = true;
- }
- assertFalse(exceptionOccured);
+ public void tableShouldDefaultProperlyIfNoPropertiesAreLoaded() throws Exception {
+ this.natTableFixture.loadState(TEST_PERSISTENCE_PREFIX, this.properties);
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/tree/TreeLayerTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/tree/TreeLayerTest.java
index f852967..a7fcd39 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/tree/TreeLayerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/tree/TreeLayerTest.java
@@ -298,7 +298,7 @@
// identify the parent node element
String current = null;
for (Person p : this.values) {
- if (p.getLastName() != current) {
+ if (!p.getLastName().equals(current)) {
this.firstElementMapping.put(p.getLastName(), p);
current = p.getLastName();
}
diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/util/CalculatedValueCacheTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/util/CalculatedValueCacheTest.java
index aa6ac84..b49e3d4 100644
--- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/util/CalculatedValueCacheTest.java
+++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/util/CalculatedValueCacheTest.java
@@ -33,6 +33,7 @@
try {
Thread.sleep(200);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
}
return Integer.valueOf(42);
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/blink/UpdateEventsCache.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/blink/UpdateEventsCache.java
index b816e8a..b400ec0 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/blink/UpdateEventsCache.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/blink/UpdateEventsCache.java
@@ -34,10 +34,10 @@
public class UpdateEventsCache<T> {
/** Initial startup delay for the expired event removal task */
- public static final int INITIAL_DELAY = 100;
+ public static final long INITIAL_DELAY = 100;
/** TTL for an event in the cache. The event is deleted when this expires */
- public static final int TIME_TO_LIVE = 500;
+ public static final long TIME_TO_LIVE = 500;
private final IRowIdAccessor<T> rowIdAccessor;
private final KeyStrategy keyStrategy;
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/conflation/EventConflaterChain.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/conflation/EventConflaterChain.java
index 48e9dd8..fbf2fda 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/conflation/EventConflaterChain.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/conflation/EventConflaterChain.java
@@ -26,8 +26,8 @@
*/
public class EventConflaterChain implements IEventConflater {
- public static final int DEFAULT_INITIAL_DELAY = 100;
- public static final int DEFAULT_REFRESH_INTERVAL = 20;
+ public static final long DEFAULT_INITIAL_DELAY = 100;
+ public static final long DEFAULT_REFRESH_INTERVAL = 20;
private static final Scheduler scheduler = new Scheduler("EventConflaterChain"); //$NON-NLS-1$
private final List<IEventConflater> chain = new LinkedList<IEventConflater>();
@@ -40,7 +40,10 @@
this(DEFAULT_REFRESH_INTERVAL, DEFAULT_INITIAL_DELAY);
}
- public EventConflaterChain(int refreshInterval, int initialDelay) {
+ /**
+ * @since 2.0
+ */
+ public EventConflaterChain(long refreshInterval, long initialDelay) {
this.refreshInterval = refreshInterval;
this.initialDelay = initialDelay;
}
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterRowConfiguration.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterRowConfiguration.java
index 1556e3f..e04daad 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterRowConfiguration.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterRowConfiguration.java
@@ -35,8 +35,7 @@
* FilterRowComboBoxCellEditor as editor for the filter row with its necessary
* configurations regarding matching mode, converter and painter.
*/
-public class ComboBoxFilterRowConfiguration extends
- AbstractRegistryConfiguration {
+public class ComboBoxFilterRowConfiguration extends AbstractRegistryConfiguration {
/**
* The ICellEditor that should be used for the filter cells. Usually it
@@ -70,20 +69,35 @@
* The IComboBoxDataProvider that is used to fill the filter row
* comboboxes.
*/
- public ComboBoxFilterRowConfiguration(
- IComboBoxDataProvider comboBoxDataProvider) {
- this.cellEditor = new FilterRowComboBoxCellEditor(comboBoxDataProvider,
- 10);
- this.filterIconPainter = new ComboBoxFilterIconPainter(
- comboBoxDataProvider);
+ public ComboBoxFilterRowConfiguration(IComboBoxDataProvider comboBoxDataProvider) {
+ this.cellEditor = new FilterRowComboBoxCellEditor(comboBoxDataProvider, 10);
+ this.filterIconPainter = new ComboBoxFilterIconPainter(comboBoxDataProvider);
+ }
+
+ /**
+ * Create a ComboBoxFilterRowConfiguration with the given filter cell editor
+ * and filter icon painter.
+ *
+ * @param cellEditor
+ * The {@link ICellEditor} that should be used in the filter row.
+ * @param filterIconPainter
+ * The {@link ImagePainter} that should be used to render a
+ * filter icon in the filter row.
+ * @since 2.0
+ */
+ public ComboBoxFilterRowConfiguration(ICellEditor cellEditor, ImagePainter filterIconPainter) {
+ this.cellEditor = cellEditor;
+ this.filterIconPainter = filterIconPainter;
}
@Override
public void configureRegistry(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(
- EditConfigAttributes.CELL_EDITOR, this.cellEditor,
- DisplayMode.NORMAL, GridRegion.FILTER_ROW);
+ EditConfigAttributes.CELL_EDITOR,
+ this.cellEditor,
+ DisplayMode.NORMAL,
+ GridRegion.FILTER_ROW);
configRegistry.registerConfigAttribute(
FilterRowConfigAttributes.TEXT_MATCHING_MODE,
@@ -99,21 +113,21 @@
// selection will be taken into account for auto resizing
@Override
- public int getPreferredWidth(ILayerCell cell, GC gc,
- IConfigRegistry configRegistry) {
+ public int getPreferredWidth(ILayerCell cell, GC gc, IConfigRegistry configRegistry) {
return 0;
}
@Override
- public int getPreferredHeight(ILayerCell cell, GC gc,
- IConfigRegistry configRegistry) {
+ public int getPreferredHeight(ILayerCell cell, GC gc, IConfigRegistry configRegistry) {
return 0;
}
}, CellEdgeEnum.RIGHT, this.filterIconPainter);
configRegistry.registerConfigAttribute(
- CellConfigAttributes.CELL_PAINTER, cellPainter,
- DisplayMode.NORMAL, GridRegion.FILTER_ROW);
+ CellConfigAttributes.CELL_PAINTER,
+ cellPainter,
+ DisplayMode.NORMAL,
+ GridRegion.FILTER_ROW);
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/layer/cell/LayerCell.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/layer/cell/LayerCell.java
index 4ac897f..b36ec1a 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/layer/cell/LayerCell.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/layer/cell/LayerCell.java
@@ -80,12 +80,18 @@
@Override
public int getColumnIndex() {
- return getLayer().getColumnIndexByPosition(getColumnPosition());
+ if (getLayer() != null) {
+ return getLayer().getColumnIndexByPosition(getColumnPosition());
+ }
+ return getColumnPosition();
}
@Override
public int getRowIndex() {
- return getLayer().getRowIndexByPosition(getRowPosition());
+ if (getLayer() != null) {
+ return getLayer().getRowIndexByPosition(getRowPosition());
+ }
+ return getRowPosition();
}
@Override
diff --git a/org.eclipse.nebula.widgets.nattable.dataset.test/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGeneratorTest.java b/org.eclipse.nebula.widgets.nattable.dataset.test/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGeneratorTest.java
index 2f5a0c1..f907b07 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset.test/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGeneratorTest.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset.test/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGeneratorTest.java
@@ -24,8 +24,7 @@
@Test
public void testGenerate() {
try {
- PricingDataBean pricingDataBean = new DataGenerator<PricingDataBean>()
- .generate(PricingDataBean.class);
+ PricingDataBean pricingDataBean = new DataGenerator<PricingDataBean>().generate(PricingDataBean.class);
assertNotNull(pricingDataBean);
assertTrue(pricingDataBean.getBid() >= 0.0d);
@@ -39,7 +38,6 @@
assertNotNull(pricingDataBean.getPricingSource());
} catch (GeneratorException e) {
- e.printStackTrace();
fail(e.getMessage() + " : " + e.getCause().getMessage());
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/car/CarService.java b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/car/CarService.java
index b556998..de9c13c 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/car/CarService.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/car/CarService.java
@@ -20,7 +20,7 @@
public class CarService {
- public static String[] PROPERTY_NAMES = {
+ private static final String[] PROPERTY_NAMES = {
"manufacturer",
"model",
"motors.identifier",
@@ -32,7 +32,7 @@
"motors.feedbacks.comment"
};
- public static String[] PROPERTY_NAMES_COMPACT = {
+ private static final String[] PROPERTY_NAMES_COMPACT = {
"manufacturer",
"model",
"motors.identifier",
@@ -86,4 +86,12 @@
return input;
}
+ public static String[] getPropertyNames() {
+ return PROPERTY_NAMES;
+ }
+
+ public static String[] getPropertyNamesCompact() {
+ return PROPERTY_NAMES_COMPACT;
+ }
+
}
diff --git a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGenerator.java b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGenerator.java
index 922d301..a552e4c 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGenerator.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/DataGenerator.java
@@ -35,8 +35,7 @@
for (Field field : dataClass.getDeclaredFields()) {
- final IValueGenerator generator = generatorFactory
- .createValueGenerator(field);
+ final IValueGenerator generator = generatorFactory.createValueGenerator(field);
if (generator != null) {
setField(dataClass, dataContainer, field, generator);
}
@@ -44,23 +43,7 @@
return dataContainer;
- } catch (InstantiationException ie) {
- ie.printStackTrace();
- throw new GeneratorException(ie);
- } catch (IllegalAccessException iae) {
- iae.printStackTrace();
- throw new GeneratorException(iae);
- } catch (SecurityException se) {
- se.printStackTrace();
- throw new GeneratorException(se);
- } catch (NoSuchMethodException nsme) {
- nsme.printStackTrace();
- throw new GeneratorException(nsme);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- throw new GeneratorException(e);
- } catch (InvocationTargetException e) {
- e.printStackTrace();
+ } catch (Exception e) {
throw new GeneratorException(e);
}
}
@@ -81,70 +64,52 @@
}
private static interface IValueGeneratorFactory {
- IValueGenerator createValueGenerator(Field field)
- throws InstantiationException, IllegalAccessException;
+ IValueGenerator createValueGenerator(Field field) throws InstantiationException, IllegalAccessException;
}
- private static class DataValueGeneratorFactory implements
- IValueGeneratorFactory {
+ private static class DataValueGeneratorFactory implements IValueGeneratorFactory {
@Override
- public IValueGenerator createValueGenerator(Field field)
- throws InstantiationException, IllegalAccessException {
+ public IValueGenerator createValueGenerator(Field field) throws InstantiationException, IllegalAccessException {
field.setAccessible(true);
- DataValueGenerator annotation = field
- .getAnnotation(DataValueGenerator.class);
+ DataValueGenerator annotation = field.getAnnotation(DataValueGenerator.class);
// Class<? extends IValueGenerator> generatorClass =
// annotation.value();
- Class<? extends IValueGenerator> generatorClass = annotation
- .value();
+ Class<? extends IValueGenerator> generatorClass = annotation.value();
return generatorClass.newInstance();
}
}
- private static class DoubleValueGeneratorFactory implements
- IValueGeneratorFactory {
+ private static class DoubleValueGeneratorFactory implements IValueGeneratorFactory {
@Override
- public IValueGenerator createValueGenerator(Field field)
- throws InstantiationException, IllegalAccessException {
+ public IValueGenerator createValueGenerator(Field field) throws InstantiationException, IllegalAccessException {
field.setAccessible(true);
- GenerateDouble generateDouble = field
- .getAnnotation(GenerateDouble.class);
- return new DoubleValueGenerator(generateDouble.floor(),
- generateDouble.range());
+ GenerateDouble generateDouble = field.getAnnotation(GenerateDouble.class);
+ return new DoubleValueGenerator(generateDouble.floor(), generateDouble.range());
}
}
- private static class StringListValueGeneratorFactory implements
- IValueGeneratorFactory {
+ private static class StringListValueGeneratorFactory implements IValueGeneratorFactory {
@Override
- public IValueGenerator createValueGenerator(Field field)
- throws InstantiationException, IllegalAccessException {
+ public IValueGenerator createValueGenerator(Field field) throws InstantiationException, IllegalAccessException {
field.setAccessible(true);
- GenerateListOfStrings generateList = field
- .getAnnotation(GenerateListOfStrings.class);
- return new ListValueGenerator<String>(
- generateList.nullLoadFactor(), generateList.values());
+ GenerateListOfStrings generateList = field.getAnnotation(GenerateListOfStrings.class);
+ return new ListValueGenerator<String>(generateList.nullLoadFactor(), generateList.values());
}
}
- private static class ValueGeneratorFactory implements
- IValueGeneratorFactory {
+ private static class ValueGeneratorFactory implements IValueGeneratorFactory {
@Override
- public IValueGenerator createValueGenerator(Field field)
- throws InstantiationException, IllegalAccessException {
+ public IValueGenerator createValueGenerator(Field field) throws InstantiationException, IllegalAccessException {
if (field.isAnnotationPresent(DataValueGenerator.class)) {
- return new DataValueGeneratorFactory()
- .createValueGenerator(field);
+ return new DataValueGeneratorFactory().createValueGenerator(field);
}
if (field.isAnnotationPresent(GenerateDouble.class)) {
- return new DoubleValueGeneratorFactory()
- .createValueGenerator(field);
+ return new DoubleValueGeneratorFactory().createValueGenerator(field);
}
if (field.isAnnotationPresent(GenerateListOfStrings.class)) {
- return new StringListValueGeneratorFactory()
- .createValueGenerator(field);
+ return new StringListValueGeneratorFactory().createValueGenerator(field);
}
return null;
diff --git a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/NatTableDataGenerator.java b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/NatTableDataGenerator.java
index a00ef48..ed698e4 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/NatTableDataGenerator.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/generator/NatTableDataGenerator.java
@@ -52,15 +52,13 @@
private void initColumnDataTypes() {
this.columnDataTypes = new ArrayList<ColumnDataType>();
for (int i = 0; i < this.numCols; i++) {
- ColumnDataType dataType = ColumnDataType.values()[(int) (Math
- .random() * ColumnDataType.values().length)];
+ ColumnDataType dataType = ColumnDataType.values()[(int) (Math.random() * ColumnDataType.values().length)];
this.columnDataTypes.add(dataType);
}
}
- public void persistData(final String fileName) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
+ public void persistData(final String fileName) throws IOException, GeneratorException {
+ try (BufferedWriter out = new BufferedWriter(new FileWriter(fileName))) {
// first write the data types
for (int i = 0; i < this.columnDataTypes.size(); i++) {
ColumnDataType dataType = this.columnDataTypes.get(i);
@@ -78,12 +76,10 @@
ColumnValueBean<?> value = null;
switch (dataType) {
case STRING_DATA:
- value = stringGenerator
- .generate(StringColumnValueBean.class);
+ value = stringGenerator.generate(StringColumnValueBean.class);
break;
case DOUBLE_DATA:
- value = doubleGenerator
- .generate(DoubleColumnValueBean.class);
+ value = doubleGenerator.generate(DoubleColumnValueBean.class);
break;
}
String stringValue = (value == null || value.getValue() == null) ? " "
@@ -102,20 +98,13 @@
}
out.newLine();
}
- out.close();
System.out.println("done");
- } catch (IOException e) {
- e.printStackTrace();
- System.exit(-1);
- } catch (GeneratorException e) {
- e.printStackTrace();
- System.exit(-1);
}
}
// TODO: file dimensions should be embedded in the file
- public void getNumRows(String fileName) {
+ public void getNumRows(String fileName) throws IOException {
try (BufferedReader bro = new BufferedReader(new FileReader(fileName))) {
String stringFromFile = bro.readLine();
@@ -124,17 +113,11 @@
this.numRows++;
stringFromFile = bro.readLine(); // read next line
}
- } catch (FileNotFoundException filenotfoundexxption) {
- System.out.println(fileName + ", does not exist");
- System.exit(-1);
- } catch (IOException ioexception) {
- ioexception.printStackTrace();
- System.exit(-1);
}
this.numRows--; // first row contains the data types of the columns
}
- public TableDataProvider loadData(final String fileName) {
+ public TableDataProvider loadData(final String fileName) throws FileNotFoundException, IOException {
// need to pass through file first to get matrix dimensions
getNumRows(fileName);
@@ -167,12 +150,6 @@
System.out.print(".");
}
System.out.println("done");
- } catch (FileNotFoundException filenotfoundexxption) {
- System.out.println(fileName + ", does not exist");
- System.exit(-1);
- } catch (IOException ioexception) {
- ioexception.printStackTrace();
- System.exit(-1);
}
return new TableDataProvider(tableData, this.numCols, this.numRows);
@@ -251,7 +228,7 @@
}
};
- public static void main(String[] args) {
+ public static void main(String[] args) throws GeneratorException, IOException {
NatTableDataGenerator dataGenerator;
String fileName;
diff --git a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/DataModelConstants.java b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/DataModelConstants.java
index a729e18..63fbb50 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/DataModelConstants.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/DataModelConstants.java
@@ -41,7 +41,7 @@
public static final String POSTALCODE_PROPERTYNAME = "postalCode";
public static final String CITY_PROPERTYNAME = "city";
- public static final String[] PERSON_PROPERTY_NAMES = {
+ private static final String[] PERSON_PROPERTY_NAMES = {
FIRSTNAME_PROPERTYNAME,
LASTNAME_PROPERTYNAME,
GENDER_PROPERTYNAME,
@@ -49,7 +49,11 @@
BIRTHDAY_PROPERTYNAME
};
- public static final String[] PERSONWITHADDRESS_PROPERTY_NAMES = {
+ public static String[] getPersonPropertyNames() {
+ return PERSON_PROPERTY_NAMES;
+ }
+
+ private static final String[] PERSONWITHADDRESS_PROPERTY_NAMES = {
FIRSTNAME_PROPERTYNAME,
LASTNAME_PROPERTYNAME,
GENDER_PROPERTYNAME,
@@ -60,4 +64,8 @@
POSTALCODE_PROPERTYNAME,
CITY_PROPERTYNAME
};
+
+ public static String[] getPersonwithaddressPropertyNames() {
+ return PERSONWITHADDRESS_PROPERTY_NAMES;
+ }
}
diff --git a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/PersonService.java b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/PersonService.java
index 0b418eb..0d481b7 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/PersonService.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/person/PersonService.java
@@ -287,7 +287,7 @@
try {
result.setBirthday(sdf.parse("" + year + "-" + month + "-" + day));
} catch (ParseException e) {
- e.printStackTrace();
+ // do nothing as there should be no parse exception;
}
result.setMoney(randomGenerator.nextDouble() * 100);
diff --git a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/pricing/ColumnHeaders.java b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/pricing/ColumnHeaders.java
index bfa75db..ba34ffc 100644
--- a/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/pricing/ColumnHeaders.java
+++ b/org.eclipse.nebula.widgets.nattable.dataset/src/org/eclipse/nebula/widgets/nattable/dataset/pricing/ColumnHeaders.java
@@ -16,30 +16,12 @@
import java.util.Map;
public enum ColumnHeaders {
- ONE("ISIN", "isin", String.class),
- TWO("Bid", "bid", Double.class),
- THREE("Ask", "ask", Double.class),
- FOUR("Pricing Model", "pricingModel", String.class),
- FIVE("Ask Yield", "askYield", Double.class),
- SIX("Bid Yield", "bidYield", Double.class),
- SEVEN("(p) Bid/Ask", "bidOverAsk", Double.class),
- EIGHT("Bid Ask Type", "bidAskType", String.class),
- NINE("Base Issue", "baseIssue", String.class),
- TEN("Closing Price", "closingPrice", Double.class),
- ELEVEN("Closing Yield", "closingYield", Double.class),
- TWELVE("Closing Spread", "closingSpread", Double.class),
- THIRTEEN("Price Change", "priceChange", Double.class),
- FOURTEEN("Yield Change", "yieldChange", Double.class),
- FIFTEEN("Spread Change", "spreadChange", Double.class),
- SIXTEEN("Alias", "alias", String.class),
- SEVENTEEN("Basis Point Value", "basisPointValue", Double.class),
- EIGHTEEN("Mod. Duration", "modDuration", Double.class),
- NINETEEN("Convexity", "convexity", Double.class),
- TWENTY("Native Trading Group", "nativeTradingGroup", String.class),
- TWENTYONE("Error Severity", "errorSeverity", Double.class),
- TWENTYTWO("Error Message", "errorMessage", String.class),
- TWENTYTHREE("Pricing Source", "pricingSource", String.class),
- TWENTYFOUR("Security Type", "securityType", String.class);
+ ONE("ISIN", "isin", String.class), TWO("Bid", "bid", Double.class), THREE("Ask", "ask", Double.class), FOUR("Pricing Model", "pricingModel", String.class), FIVE("Ask Yield", "askYield", Double.class), SIX("Bid Yield", "bidYield",
+ Double.class), SEVEN("(p) Bid/Ask", "bidOverAsk", Double.class), EIGHT("Bid Ask Type", "bidAskType", String.class), NINE("Base Issue", "baseIssue", String.class), TEN("Closing Price", "closingPrice", Double.class), ELEVEN(
+ "Closing Yield", "closingYield", Double.class), TWELVE("Closing Spread", "closingSpread", Double.class), THIRTEEN("Price Change", "priceChange", Double.class), FOURTEEN("Yield Change", "yieldChange",
+ Double.class), FIFTEEN("Spread Change", "spreadChange", Double.class), SIXTEEN("Alias", "alias", String.class), SEVENTEEN("Basis Point Value", "basisPointValue", Double.class), EIGHTEEN("Mod. Duration",
+ "modDuration", Double.class), NINETEEN("Convexity", "convexity", Double.class), TWENTY("Native Trading Group", "nativeTradingGroup", String.class), TWENTYONE("Error Severity", "errorSeverity",
+ Double.class), TWENTYTWO("Error Message", "errorMessage", String.class), TWENTYTHREE("Pricing Source", "pricingSource", String.class), TWENTYFOUR("Security Type", "securityType", String.class);
private String label;
private String property;
@@ -64,10 +46,6 @@
return this.label;
}
- public void setLabel(String label) {
- this.label = label;
- }
-
public static String[] getProperties() {
String properties[] = new String[ColumnHeaders.values().length];
int colIndex = 0;
@@ -101,10 +79,6 @@
return this.property;
}
- public void setProperty(String property) {
- this.property = property;
- }
-
public Class<?> getType() {
return this.type;
}
diff --git a/org.eclipse.nebula.widgets.nattable.examples.e4/src/org/eclipse/nebula/widgets/nattable/examples/e4/AbstractE4NatExamplePart.java b/org.eclipse.nebula.widgets.nattable.examples.e4/src/org/eclipse/nebula/widgets/nattable/examples/e4/AbstractE4NatExamplePart.java
index a79ad39..e19ed43 100644
--- a/org.eclipse.nebula.widgets.nattable.examples.e4/src/org/eclipse/nebula/widgets/nattable/examples/e4/AbstractE4NatExamplePart.java
+++ b/org.eclipse.nebula.widgets.nattable.examples.e4/src/org/eclipse/nebula/widgets/nattable/examples/e4/AbstractE4NatExamplePart.java
@@ -59,7 +59,7 @@
if (!path.startsWith("/")) {
path = "/" + path;
}
- String source = getResourceAsString("/src" + path + ".java");
+ String source = getResourceAsText("/src" + path + ".java");
if (source != null) {
viewSource(part.getLabel(), source);
}
@@ -73,7 +73,7 @@
final SelectionAdapter cssLinkSelectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- String source = getResourceAsString(event.text);
+ String source = getResourceAsText(event.text);
if (source != null) {
viewSource("default.css", source);
}
@@ -82,7 +82,7 @@
cssLink.addSelectionListener(cssLinkSelectionListener);
}
- private String getResourceAsString(String resource) {
+ private String getResourceAsText(String resource) {
try (InputStream inStream = getClass().getResourceAsStream(resource)) {
if (inStream != null) {
StringBuilder builder = new StringBuilder();
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_302_CustomColumnPropertyAccessorExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_302_CustomColumnPropertyAccessorExample.java
index a665ac2..d1a280d 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_302_CustomColumnPropertyAccessorExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_302_CustomColumnPropertyAccessorExample.java
@@ -197,12 +197,12 @@
@Override
public String getColumnProperty(int columnIndex) {
- return DataModelConstants.PERSONWITHADDRESS_PROPERTY_NAMES[columnIndex];
+ return DataModelConstants.getPersonwithaddressPropertyNames()[columnIndex];
}
@Override
public int getColumnIndex(String propertyName) {
- return Arrays.asList(DataModelConstants.PERSONWITHADDRESS_PROPERTY_NAMES).indexOf(propertyName);
+ return Arrays.asList(DataModelConstants.getPersonwithaddressPropertyNames()).indexOf(propertyName);
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_303_CalculatedDataExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_303_CalculatedDataExample.java
index db344d7..507f65d 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_303_CalculatedDataExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_303_CalculatedDataExample.java
@@ -69,11 +69,11 @@
*/
public class _303_CalculatedDataExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
private EventList<NumberValues> valuesToShow = GlazedLists.eventList(new ArrayList<NumberValues>());
@@ -198,8 +198,8 @@
return rowObject.getColumnTwoNumber()
+ rowObject.getColumnThreeNumber();
case 4: // calculate the percentage
- return new Double(rowObject.getColumnTwoNumber()
- + rowObject.getColumnThreeNumber())
+ return new Double((double) rowObject.getColumnTwoNumber()
+ + (double) rowObject.getColumnThreeNumber())
/ rowObject.getColumnOneNumber();
}
return null;
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_306_CalculatedFormulaDataExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_306_CalculatedFormulaDataExample.java
index c3e2e08..f557d67 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_306_CalculatedFormulaDataExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_300_Data/_306_CalculatedFormulaDataExample.java
@@ -74,11 +74,11 @@
*/
public class _306_CalculatedFormulaDataExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
private EventList<NumberValues> valuesToShow = GlazedLists.eventList(new ArrayList<NumberValues>());
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_4222_CellPainterExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_4222_CellPainterExample.java
index 0c092f5..566abba 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_4222_CellPainterExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_4222_CellPainterExample.java
@@ -72,18 +72,18 @@
return "Example showing the different painters that come with NatTable";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
- public static String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
- public static String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
- public static String COLUMN_NINE_LABEL = "ColumnNineLabel";
- public static String COLUMN_TEN_LABEL = "ColumnTenLabel";
- public static String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
- public static String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
+ public static final String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
+ public static final String COLUMN_NINE_LABEL = "ColumnNineLabel";
+ public static final String COLUMN_TEN_LABEL = "ColumnTenLabel";
+ public static final String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
+ public static final String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
private NatTable natTable;
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4451_CrossValidationGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4451_CrossValidationGridExample.java
index ad45574..da6298d 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4451_CrossValidationGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4451_CrossValidationGridExample.java
@@ -63,8 +63,8 @@
*/
public class _4451_CrossValidationGridExample extends AbstractNatExample {
- public static String DATE_LABEL = "DateLabel";
- public static String INVALID_LABEL = "InvalidLabel";
+ public static final String DATE_LABEL = "DateLabel";
+ public static final String INVALID_LABEL = "InvalidLabel";
private EventList<EventData> valuesToShow = GlazedLists.eventList(new ArrayList<EventData>());
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_446_EditErrorHandlingExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_446_EditErrorHandlingExample.java
index 7c4fb17..cbcae9f 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_446_EditErrorHandlingExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_446_EditErrorHandlingExample.java
@@ -74,15 +74,15 @@
+ "other exceptions than the defined ones for conversion and validation failures are logged completely.";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
- public static String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
- public static String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
- public static String COLUMN_NINE_LABEL = "ColumnNineLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
+ public static final String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
+ public static final String COLUMN_NINE_LABEL = "ColumnNineLabel";
@Override
public Control createExampleControl(Composite parent) {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4471_EditorTraversalExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4471_EditorTraversalExample.java
index 8134e2d..a5b9411 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4471_EditorTraversalExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_4471_EditorTraversalExample.java
@@ -61,11 +61,11 @@
return "";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
@Override
public Control createExampleControl(Composite parent) {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_447_EditorExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_447_EditorExample.java
index 2181955..2a4b16f 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_447_EditorExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_447_EditorExample.java
@@ -87,20 +87,20 @@
return "";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
- public static String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
- public static String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
- public static String COLUMN_NINE_LABEL = "ColumnNineLabel";
- public static String COLUMN_TEN_LABEL = "ColumnTenLabel";
- public static String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
- public static String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
- public static String COLUMN_THIRTEEN_LABEL = "ColumnThirteenLabel";
- public static String COLUMN_FOURTEEN_LABEL = "ColumnFourteenLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
+ public static final String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
+ public static final String COLUMN_NINE_LABEL = "ColumnNineLabel";
+ public static final String COLUMN_TEN_LABEL = "ColumnTenLabel";
+ public static final String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
+ public static final String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
+ public static final String COLUMN_THIRTEEN_LABEL = "ColumnThirteenLabel";
+ public static final String COLUMN_FOURTEEN_LABEL = "ColumnFourteenLabel";
@Override
public Control createExampleControl(Composite parent) {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_448_CDateTimeEditorExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_448_CDateTimeEditorExample.java
index 98c05ab..b7f89b1 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_448_CDateTimeEditorExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_400_Configuration/_440_Editing/_448_CDateTimeEditorExample.java
@@ -72,12 +72,12 @@
*/
public class _448_CDateTimeEditorExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
private EventList<DateValues> valuesToShow = GlazedLists.eventList(new ArrayList<DateValues>());
@@ -311,7 +311,7 @@
if (canonicalValue != null) {
canonical = (Calendar) canonicalValue;
}
- return super.canonicalToDisplayValue(canonical.getTime());
+ return super.canonicalToDisplayValue(canonical != null ? canonical.getTime() : null);
}
@Override
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5055_SelectionTraversalExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5055_SelectionTraversalExample.java
index 212718d..5917ee1 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5055_SelectionTraversalExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5055_SelectionTraversalExample.java
@@ -219,11 +219,11 @@
return panel;
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
private void registerColumnLabels(ColumnOverrideLabelAccumulator columnLabelAccumulator) {
columnLabelAccumulator.registerColumnOverrides(0, COLUMN_ONE_LABEL);
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_514_TreeLayerExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_514_TreeLayerExample.java
index c53051f..c90c310 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_514_TreeLayerExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_514_TreeLayerExample.java
@@ -284,7 +284,7 @@
// identify the parent node element
String current = null;
for (PersonWithAddress p : this.values) {
- if (p.getLastName() != current) {
+ if (!p.getLastName().equals(current)) {
this.firstElementMapping.put(p.getLastName(), p);
current = p.getLastName();
}
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6035_ExcelLikeFilterRowCustomTypesExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6035_ExcelLikeFilterRowCustomTypesExample.java
index 7b176aa..27ebd00 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6035_ExcelLikeFilterRowCustomTypesExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6035_ExcelLikeFilterRowCustomTypesExample.java
@@ -134,16 +134,10 @@
columnHeaderLayer, columnHeaderDataProvider, configRegistry,
false);
final IComboBoxDataProvider comboBoxDataProvider = filterRowHeaderLayer.getComboBoxDataProvider();
- filterRowHeaderLayer.addConfiguration(new ComboBoxFilterRowConfiguration() {
- {
- this.cellEditor = new FilterRowComboBoxCellEditor(
- comboBoxDataProvider, 5);
- this.filterIconPainter = new ComboBoxFilterIconPainter(
- comboBoxDataProvider, GUIHelper
- .getImage("filter"),
- null);
- }
- });
+ filterRowHeaderLayer.addConfiguration(
+ new ComboBoxFilterRowConfiguration(
+ new FilterRowComboBoxCellEditor(comboBoxDataProvider, 5),
+ new ComboBoxFilterIconPainter(comboBoxDataProvider, GUIHelper.getImage("filter"), null)));
// build the row header layer
IDataProvider rowHeaderDataProvider =
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6043_HierarchicalTreeExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6043_HierarchicalTreeExample.java
index 8e458f0..0433cb4 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6043_HierarchicalTreeExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6043_HierarchicalTreeExample.java
@@ -86,12 +86,12 @@
BodyLayerStack bodyLayerStack = new BodyLayerStack(
CarService.getInput(),
- CarService.PROPERTY_NAMES,
- new HierarchicalWrapperTreeFormat(CarService.PROPERTY_NAMES));
+ CarService.getPropertyNames(),
+ new HierarchicalWrapperTreeFormat(CarService.getPropertyNames()));
// create the column header layer stack
IDataProvider columnHeaderDataProvider =
- new DefaultColumnHeaderDataProvider(CarService.PROPERTY_NAMES, propertyToLabelMap);
+ new DefaultColumnHeaderDataProvider(CarService.getPropertyNames(), propertyToLabelMap);
ILayer columnHeaderLayer = new ColumnHeaderLayer(
new DataLayer(columnHeaderDataProvider),
bodyLayerStack,
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6044_HierarchicalTreeLayerGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6044_HierarchicalTreeLayerGridExample.java
index c053493..22ea8fb 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6044_HierarchicalTreeLayerGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6044_HierarchicalTreeLayerGridExample.java
@@ -102,11 +102,11 @@
ConfigRegistry configRegistry = new ConfigRegistry();
- BodyLayerStack bodyLayerStack = new BodyLayerStack(CarService.getInput(), CarService.PROPERTY_NAMES);
+ BodyLayerStack bodyLayerStack = new BodyLayerStack(CarService.getInput(), CarService.getPropertyNames());
// create the column header layer stack
IDataProvider columnHeaderDataProvider =
- new DefaultColumnHeaderDataProvider(CarService.PROPERTY_NAMES, propertyToLabelMap);
+ new DefaultColumnHeaderDataProvider(CarService.getPropertyNames(), propertyToLabelMap);
DataLayer columnHeaderDataLayer = new DataLayer(columnHeaderDataProvider);
ILayer columnHeaderLayer = new ColumnHeaderLayer(
columnHeaderDataLayer,
@@ -145,13 +145,12 @@
NatTable natTable = new NatTable(parent, gridLayer, false);
natTable.setConfigRegistry(configRegistry);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- this.vAlign = VerticalAlignmentEnum.TOP;
- this.hAlign = HorizontalAlignmentEnum.LEFT;
- this.cellPainter = new PaddingDecorator(new TextPainter(), 2);
- }
- });
+
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ styleConfig.vAlign = VerticalAlignmentEnum.TOP;
+ styleConfig.hAlign = HorizontalAlignmentEnum.LEFT;
+ styleConfig.cellPainter = new PaddingDecorator(new TextPainter(), 2);
+ natTable.addConfiguration(styleConfig);
// adds the key bindings that allows pressing space bar to
// expand/collapse tree nodes
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6045_HierarchicalTreeLayerExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6045_HierarchicalTreeLayerExample.java
index e5f2260..43fc726 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6045_HierarchicalTreeLayerExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_604_Tree/_6045_HierarchicalTreeLayerExample.java
@@ -139,11 +139,11 @@
BodyLayerStack bodyLayerStack = new BodyLayerStack(
CarService.getInput(),
- CarService.PROPERTY_NAMES);
+ CarService.getPropertyNames());
// create the column header layer stack
IDataProvider columnHeaderDataProvider =
- new DefaultColumnHeaderDataProvider(CarService.PROPERTY_NAMES, propertyToLabelMap);
+ new DefaultColumnHeaderDataProvider(CarService.getPropertyNames(), propertyToLabelMap);
DataLayer columnHeaderDataLayer = new DataLayer(columnHeaderDataProvider);
ILayer columnHeaderLayer = new ColumnHeaderLayer(
columnHeaderDataLayer,
@@ -195,8 +195,7 @@
protected void addAlternateRowColoringConfig(CompositeLayer gridLayer) {
// do nothing to avoid the default grid alternate row coloring
// needed because the alternate row coloring in the hierarchical
- // tree
- // is based on the spanned cells and not per individual row
+ // tree is based on the spanned cells and not per individual row
// position
}
});
@@ -204,13 +203,11 @@
NatTable natTable = new NatTable(container, compositeLayer, false);
natTable.setConfigRegistry(configRegistry);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- this.vAlign = VerticalAlignmentEnum.TOP;
- this.hAlign = HorizontalAlignmentEnum.LEFT;
- this.cellPainter = new PaddingDecorator(new TextPainter(), 2);
- }
- });
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ styleConfig.vAlign = VerticalAlignmentEnum.TOP;
+ styleConfig.hAlign = HorizontalAlignmentEnum.LEFT;
+ styleConfig.cellPainter = new PaddingDecorator(new TextPainter(), 2);
+ natTable.addConfiguration(styleConfig);
// add editing configuration
natTable.addConfiguration(new AbstractRegistryConfiguration() {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_700_AdditionalFunctions/_774_MultiExportExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_700_AdditionalFunctions/_774_MultiExportExample.java
index 0e103bc..9c1ba12 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_700_AdditionalFunctions/_774_MultiExportExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_700_AdditionalFunctions/_774_MultiExportExample.java
@@ -68,8 +68,8 @@
public class _774_MultiExportExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
public static void main(String[] args) throws Exception {
StandaloneNatExampleRunner.run(600, 480, new _774_MultiExportExample());
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_802_CalculatingGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_802_CalculatingGridExample.java
index c367548..006bf11 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_802_CalculatingGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_802_CalculatingGridExample.java
@@ -78,11 +78,11 @@
*/
public class _802_CalculatingGridExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
private EventList<NumberValues> valuesToShow = GlazedLists.eventList(new ArrayList<NumberValues>());
@@ -204,11 +204,10 @@
case 2:
return rowObject.getColumnThreeNumber();
case 3: // calculate the sum
- return rowObject.getColumnTwoNumber()
- + rowObject.getColumnThreeNumber();
+ return rowObject.getColumnTwoNumber() + rowObject.getColumnThreeNumber();
case 4: // calculate the percentage
- return new Double(rowObject.getColumnTwoNumber()
- + rowObject.getColumnThreeNumber())
+ return new Double(
+ (double) rowObject.getColumnTwoNumber() + (double) rowObject.getColumnThreeNumber())
/ rowObject.getColumnOneNumber();
}
return null;
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_803_CachedCalculatingGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_803_CachedCalculatingGridExample.java
index 0b860e5..33e47c3 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_803_CachedCalculatingGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_803_CachedCalculatingGridExample.java
@@ -86,11 +86,11 @@
*/
public class _803_CachedCalculatingGridExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
private EventList<NumberValues> valuesToShow = GlazedLists.eventList(new ArrayList<NumberValues>());
@@ -278,6 +278,7 @@
try {
Thread.sleep(500);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
}
return colTwo + colThree;
}
@@ -292,15 +293,16 @@
@Override
public Object executeCalculation() {
// calculate the percentage
- int colOne = (Integer) getDataValue(0, rowIndex);
- int colTwo = (Integer) getDataValue(1, rowIndex);
- int colThree = (Integer) getDataValue(2, rowIndex);
+ Integer colOne = (Integer) getDataValue(0, rowIndex);
+ Integer colTwo = (Integer) getDataValue(1, rowIndex);
+ Integer colThree = (Integer) getDataValue(2, rowIndex);
// add some delay
try {
Thread.sleep(500);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
}
- return new Double(colTwo + colThree) / colOne;
+ return new Double(colTwo.doubleValue() + colThree.doubleValue()) / colOne.doubleValue();
}
});
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_804_GlazedListsEditorExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_804_GlazedListsEditorExample.java
index 050cb9f..1f47381 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_804_GlazedListsEditorExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_804_GlazedListsEditorExample.java
@@ -105,19 +105,19 @@
return "";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
- public static String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
- public static String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
- public static String COLUMN_NINE_LABEL = "ColumnNineLabel";
- public static String COLUMN_TEN_LABEL = "ColumnTenLabel";
- public static String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
- public static String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
- public static String COLUMN_THIRTEEN_LABEL = "ColumnThirteenLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
+ public static final String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
+ public static final String COLUMN_NINE_LABEL = "ColumnNineLabel";
+ public static final String COLUMN_TEN_LABEL = "ColumnTenLabel";
+ public static final String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
+ public static final String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
+ public static final String COLUMN_THIRTEEN_LABEL = "ColumnThirteenLabel";
@Override
public Control createExampleControl(Composite parent) {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_817_TreeLayerWithRowGroupingExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_817_TreeLayerWithRowGroupingExample.java
index 2c97a52..2406c16 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_817_TreeLayerWithRowGroupingExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_800_Integration/_817_TreeLayerWithRowGroupingExample.java
@@ -300,7 +300,7 @@
// identify the parent node element
String current = null;
for (Person p : this.values) {
- if (p.getLastName() != current) {
+ if (!p.getLastName().equals(current)) {
this.firstElementMapping.put(p.getLastName(), p);
current = p.getLastName();
}
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/TextPainter_Examples.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/TextPainter_Examples.java
index b638cb8..c007d84 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/TextPainter_Examples.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/TextPainter_Examples.java
@@ -75,28 +75,19 @@
tableContainer.setLayout(new GridLayout(6, true));
GridDataFactory.fillDefaults().grab(true, true).applyTo(tableContainer);
- createNatTable(tableContainer, new GradientBackgroundPainter(
- new TextPainter(false, false, false), true));
+ createNatTable(tableContainer, new GradientBackgroundPainter(new TextPainter(false, false, false), true));
createNatTable(tableContainer, new TextPainter(true, true, false));
createNatTable(tableContainer, new TextPainter(false, true, true));
createNatTable(tableContainer, new TextPainter(true, true, true));
createNatTable(tableContainer, new TextPainter(true, true, 5, true));
- createNatTable(tableContainer, new PaddingDecorator(new TextPainter(
- true, true, 5, true), 5));
+ createNatTable(tableContainer, new PaddingDecorator(new TextPainter(true, true, 5, true), 5));
- createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(
- false, true, false));
- createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(
- true, true, false));
- createVerticalHeaderNatTable(tableContainer,
- new GradientBackgroundPainter(new VerticalTextPainter(false,
- false, true)));
- createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(
- true, true, true));
- createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(
- true, true, 5, true));
- createVerticalHeaderNatTable(tableContainer, new PaddingDecorator(
- new VerticalTextPainter(true, true, 5, true), 5));
+ createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(false, true, false));
+ createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(true, true, false));
+ createVerticalHeaderNatTable(tableContainer, new GradientBackgroundPainter(new VerticalTextPainter(false, false, true)));
+ createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(true, true, true));
+ createVerticalHeaderNatTable(tableContainer, new VerticalTextPainter(true, true, 5, true));
+ createVerticalHeaderNatTable(tableContainer, new PaddingDecorator(new VerticalTextPainter(true, true, 5, true), 5));
TextPainter underlineTextPainer = new TextPainter();
underlineTextPainer.setUnderline(true);
@@ -109,20 +100,16 @@
underlineStrikethroughTextPainer.setStrikethrough(true);
createNatTable2(tableContainer, underlineStrikethroughTextPainer);
- VerticalTextPainter vunderlineTextPainer = new VerticalTextPainter(
- true, true, true);
+ VerticalTextPainter vunderlineTextPainer = new VerticalTextPainter(true, true, true);
vunderlineTextPainer.setUnderline(true);
createVerticalHeaderNatTable(tableContainer, vunderlineTextPainer);
- VerticalTextPainter vstrikethroughTextPainer = new VerticalTextPainter(
- true, true, true);
+ VerticalTextPainter vstrikethroughTextPainer = new VerticalTextPainter(true, true, true);
vstrikethroughTextPainer.setStrikethrough(true);
createVerticalHeaderNatTable(tableContainer, vstrikethroughTextPainer);
- VerticalTextPainter vunderlineStrikethroughTextPainer = new VerticalTextPainter(
- true, true, true);
+ VerticalTextPainter vunderlineStrikethroughTextPainer = new VerticalTextPainter(true, true, true);
vunderlineStrikethroughTextPainer.setUnderline(true);
vunderlineStrikethroughTextPainer.setStrikethrough(true);
- createVerticalHeaderNatTable(tableContainer,
- vunderlineStrikethroughTextPainer);
+ createVerticalHeaderNatTable(tableContainer, vunderlineStrikethroughTextPainer);
// uncomment the following lines to see different calculation
// configurations with greater font sizes
@@ -176,19 +163,17 @@
viewportLayer, selectionLayer);
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
- compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
- columnHeaderLayer, 0, 0);
+ compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);
NatTable natTable = new NatTable(parent, compositeLayer, false);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- this.vAlign = VerticalAlignmentEnum.TOP;
- this.hAlign = HorizontalAlignmentEnum.LEFT;
- this.cellPainter = new LineBorderDecorator(painter);
- }
- });
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ styleConfig.vAlign = VerticalAlignmentEnum.TOP;
+ styleConfig.hAlign = HorizontalAlignmentEnum.LEFT;
+ styleConfig.cellPainter = new LineBorderDecorator(painter);
+
+ natTable.addConfiguration(styleConfig);
natTable.configure();
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
@@ -202,66 +187,52 @@
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
- new DataLayer(new ExampleHeaderDataProvider()), viewportLayer,
- selectionLayer, false);
- columnHeaderLayer
- .addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
- @Override
- protected void addColumnHeaderStyleConfig() {
- addConfiguration(new DefaultColumnHeaderStyleConfiguration() {
- {
- this.cellPainter = new BeveledBorderDecorator(
- painter);
- }
- });
- }
- });
+ new DataLayer(new ExampleHeaderDataProvider()), viewportLayer, selectionLayer, false);
+ columnHeaderLayer.addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
+ @Override
+ protected void addColumnHeaderStyleConfig() {
+ DefaultColumnHeaderStyleConfiguration styleConfig = new DefaultColumnHeaderStyleConfiguration();
+ styleConfig.cellPainter = new BeveledBorderDecorator(painter);
+ addConfiguration(styleConfig);
+ }
+ });
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
- compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
- columnHeaderLayer, 0, 0);
+ compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);
NatTable natTable = new NatTable(parent, compositeLayer, false);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- this.vAlign = VerticalAlignmentEnum.TOP;
- this.hAlign = HorizontalAlignmentEnum.LEFT;
- this.cellPainter = new LineBorderDecorator(painter);
- }
- });
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ styleConfig.vAlign = VerticalAlignmentEnum.TOP;
+ styleConfig.hAlign = HorizontalAlignmentEnum.LEFT;
+ styleConfig.cellPainter = new LineBorderDecorator(painter);
+
+ natTable.addConfiguration(styleConfig);
natTable.configure();
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
}
- private void createVerticalHeaderNatTable(Composite parent,
- final ICellPainter painter) {
+ private void createVerticalHeaderNatTable(Composite parent, final ICellPainter painter) {
IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
- SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(
- bodyDataProvider));
+ SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider));
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
new DataLayer(new ExampleHeaderDataProvider()), viewportLayer,
selectionLayer, false);
- columnHeaderLayer
- .addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
- @Override
- protected void addColumnHeaderStyleConfig() {
- addConfiguration(new DefaultColumnHeaderStyleConfiguration() {
- {
- this.cellPainter = new BeveledBorderDecorator(
- painter);
- }
- });
- }
- });
+ columnHeaderLayer.addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
+ @Override
+ protected void addColumnHeaderStyleConfig() {
+ DefaultColumnHeaderStyleConfiguration styleConfig = new DefaultColumnHeaderStyleConfiguration();
+ styleConfig.cellPainter = new BeveledBorderDecorator(painter);
+ addConfiguration(styleConfig);
+ }
+ });
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
- compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
- columnHeaderLayer, 0, 0);
+ compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);
NatTable natTable = new NatTable(parent, compositeLayer);
@@ -282,31 +253,27 @@
viewportLayer, selectionLayer);
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
- compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
- columnHeaderLayer, 0, 0);
+ compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);
NatTable natTable = new NatTable(parent, compositeLayer, false);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- this.vAlign = VerticalAlignmentEnum.TOP;
- this.hAlign = HorizontalAlignmentEnum.LEFT;
- this.cellPainter = new LineBorderDecorator(painter);
- this.font = GUIHelper.getFont(new FontData("Arial", 20, SWT.NORMAL));
- }
- });
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ styleConfig.vAlign = VerticalAlignmentEnum.TOP;
+ styleConfig.hAlign = HorizontalAlignmentEnum.LEFT;
+ styleConfig.cellPainter = new LineBorderDecorator(painter);
+ styleConfig.font = GUIHelper.getFont(new FontData("Arial", 20, SWT.NORMAL));
+
+ natTable.addConfiguration(styleConfig);
natTable.configure();
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
}
@SuppressWarnings("unused")
- private void createVerticalNatTable(Composite parent,
- final ICellPainter painter) {
+ private void createVerticalNatTable(Composite parent, final ICellPainter painter) {
IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
- SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(
- bodyDataProvider, 20, 100));
+ SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(bodyDataProvider, 20, 100));
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
@@ -314,34 +281,28 @@
bodyDataProvider), 20, 100),
viewportLayer,
selectionLayer);
- columnHeaderLayer
- .addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
- @Override
- protected void addColumnHeaderStyleConfig() {
- addConfiguration(new DefaultColumnHeaderStyleConfiguration() {
- {
- this.cellPainter = new BeveledBorderDecorator(
- new VerticalTextPainter());
- }
- });
- }
- });
+ columnHeaderLayer.addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
+ @Override
+ protected void addColumnHeaderStyleConfig() {
+ DefaultColumnHeaderStyleConfiguration styleConfig = new DefaultColumnHeaderStyleConfiguration();
+ styleConfig.cellPainter = new BeveledBorderDecorator(new VerticalTextPainter());
+ addConfiguration(styleConfig);
+ }
+ });
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
- compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
- columnHeaderLayer, 0, 0);
+ compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, viewportLayer, 0, 1);
NatTable natTable = new NatTable(parent, compositeLayer, false);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- this.vAlign = VerticalAlignmentEnum.MIDDLE;
- this.hAlign = HorizontalAlignmentEnum.LEFT;
- this.cellPainter = new LineBorderDecorator(painter);
- this.font = GUIHelper.getFont(new FontData("Arial", 20, SWT.NORMAL));
- }
- });
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ styleConfig.vAlign = VerticalAlignmentEnum.MIDDLE;
+ styleConfig.hAlign = HorizontalAlignmentEnum.LEFT;
+ styleConfig.cellPainter = new LineBorderDecorator(painter);
+ styleConfig.font = GUIHelper.getFont(new FontData("Arial", 20, SWT.NORMAL));
+
+ natTable.addConfiguration(styleConfig);
natTable.configure();
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_104_Styling/_001_Custom_styling_of_specific_cells.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_104_Styling/_001_Custom_styling_of_specific_cells.java
index ebaffde..84fc559 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_104_Styling/_001_Custom_styling_of_specific_cells.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_104_Styling/_001_Custom_styling_of_specific_cells.java
@@ -87,10 +87,8 @@
// Custom label "FOO" for cell at column, row index (1, 5)
IConfigLabelAccumulator cellLabelAccumulator = new IConfigLabelAccumulator() {
@Override
- public void accumulateConfigLabels(LabelStack configLabels,
- int columnPosition, int rowPosition) {
- int columnIndex = bodyLayer
- .getColumnIndexByPosition(columnPosition);
+ public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
+ int columnIndex = bodyLayer.getColumnIndexByPosition(columnPosition);
int rowIndex = bodyLayer.getRowIndexByPosition(rowPosition);
if (columnIndex == 1 && rowIndex == 5) {
configLabels.addLabel(FOO_LABEL);
@@ -101,18 +99,14 @@
// add labels for surrounding borders
if (rowIndex == 13) {
- configLabels
- .addLabel(CustomLineBorderDecorator.TOP_LINE_BORDER_LABEL);
- configLabels
- .addLabel(CustomLineBorderDecorator.BOTTOM_LINE_BORDER_LABEL);
+ configLabels.addLabel(CustomLineBorderDecorator.TOP_LINE_BORDER_LABEL);
+ configLabels.addLabel(CustomLineBorderDecorator.BOTTOM_LINE_BORDER_LABEL);
if (columnIndex == 0) {
- configLabels
- .addLabel(CustomLineBorderDecorator.LEFT_LINE_BORDER_LABEL);
+ configLabels.addLabel(CustomLineBorderDecorator.LEFT_LINE_BORDER_LABEL);
}
if (columnIndex == 2) {
- configLabels
- .addLabel(CustomLineBorderDecorator.RIGHT_LINE_BORDER_LABEL);
+ configLabels.addLabel(CustomLineBorderDecorator.RIGHT_LINE_BORDER_LABEL);
}
}
}
@@ -121,16 +115,15 @@
NatTable natTable = new NatTable(parent, gridLayer, false);
- natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
- {
- // override the LineBorderDecorator here to show how to paint
- // borders on single sides of a cell
- this.cellPainter = new CustomLineBorderDecorator(new TextPainter());
- // set a border style
- this.borderStyle = new BorderStyle(2, GUIHelper.COLOR_BLUE,
- LineStyleEnum.DASHDOT);
- }
- });
+ DefaultNatTableStyleConfiguration styleConfig = new DefaultNatTableStyleConfiguration();
+ // override the LineBorderDecorator here to show how to paint
+ // borders on single sides of a cell
+ styleConfig.cellPainter = new CustomLineBorderDecorator(new TextPainter());
+ // set a border style
+ styleConfig.borderStyle = new BorderStyle(2, GUIHelper.COLOR_BLUE, LineStyleEnum.DASHDOT);
+
+ natTable.addConfiguration(styleConfig);
+
// Custom style for label "FOO"
natTable.addConfiguration(new AbstractRegistryConfiguration() {
@Override
@@ -140,7 +133,8 @@
CellStyleAttributes.BACKGROUND_COLOR,
GUIHelper.COLOR_GREEN);
configRegistry.registerConfigAttribute(
- CellConfigAttributes.CELL_STYLE, cellStyle,
+ CellConfigAttributes.CELL_STYLE,
+ cellStyle,
DisplayMode.NORMAL, FOO_LABEL);
cellStyle = new Style();
@@ -148,7 +142,8 @@
CellStyleAttributes.TEXT_DECORATION,
TextDecorationEnum.UNDERLINE_STRIKETHROUGH);
configRegistry.registerConfigAttribute(
- CellConfigAttributes.CELL_STYLE, cellStyle,
+ CellConfigAttributes.CELL_STYLE,
+ cellStyle,
DisplayMode.NORMAL, BAR_LABEL);
}
});
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CalculatingGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CalculatingGridExample.java
index 058c7f1..1317dec 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CalculatingGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CalculatingGridExample.java
@@ -77,11 +77,11 @@
*/
public class CalculatingGridExample extends AbstractNatExample {
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
private EventList<NumberValues> valuesToShow = GlazedLists.eventList(new ArrayList<NumberValues>());
@@ -206,8 +206,8 @@
return rowObject.getColumnTwoNumber()
+ rowObject.getColumnThreeNumber();
case 4: // calculate the percentage
- return new Double(rowObject.getColumnTwoNumber()
- + rowObject.getColumnThreeNumber())
+ return new Double((double) rowObject.getColumnTwoNumber()
+ + (double) rowObject.getColumnThreeNumber())
/ rowObject.getColumnOneNumber();
}
return null;
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CrossValidationGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CrossValidationGridExample.java
index 2ef172c..cabfb7b 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CrossValidationGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/CrossValidationGridExample.java
@@ -63,8 +63,8 @@
*/
public class CrossValidationGridExample extends AbstractNatExample {
- public static String DATE_LABEL = "DateLabel";
- public static String INVALID_LABEL = "InvalidLabel";
+ public static final String DATE_LABEL = "DateLabel";
+ public static final String INVALID_LABEL = "InvalidLabel";
private EventList<EventData> valuesToShow = GlazedLists.eventList(new ArrayList<EventData>());
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditErrorHandlingExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditErrorHandlingExample.java
index a3f79b9..3f6838d 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditErrorHandlingExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditErrorHandlingExample.java
@@ -74,15 +74,15 @@
+ "other exceptions than the defined ones for conversion and validation failures are logged completely.";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
- public static String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
- public static String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
- public static String COLUMN_NINE_LABEL = "ColumnNineLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
+ public static final String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
+ public static final String COLUMN_NINE_LABEL = "ColumnNineLabel";
@Override
public Control createExampleControl(Composite parent) {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditableGridExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditableGridExample.java
index ac83067..9203dd7 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditableGridExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditableGridExample.java
@@ -550,8 +550,7 @@
valid = isAlpha(alphabeticPart)
&& isNumeric(numericPart);
} else {
- String alphabeticPart = value.substring(0, value.length());
- valid = isAlpha(alphabeticPart);
+ valid = isAlpha(value);
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditorExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditorExample.java
index 9a3e836..110d3fe 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditorExample.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_110_Editing/EditorExample.java
@@ -77,19 +77,19 @@
return "";
}
- public static String COLUMN_ONE_LABEL = "ColumnOneLabel";
- public static String COLUMN_TWO_LABEL = "ColumnTwoLabel";
- public static String COLUMN_THREE_LABEL = "ColumnThreeLabel";
- public static String COLUMN_FOUR_LABEL = "ColumnFourLabel";
- public static String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
- public static String COLUMN_SIX_LABEL = "ColumnSixLabel";
- public static String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
- public static String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
- public static String COLUMN_NINE_LABEL = "ColumnNineLabel";
- public static String COLUMN_TEN_LABEL = "ColumnTenLabel";
- public static String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
- public static String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
- public static String COLUMN_THIRTEEN_LABEL = "ColumnThirteenLabel";
+ public static final String COLUMN_ONE_LABEL = "ColumnOneLabel";
+ public static final String COLUMN_TWO_LABEL = "ColumnTwoLabel";
+ public static final String COLUMN_THREE_LABEL = "ColumnThreeLabel";
+ public static final String COLUMN_FOUR_LABEL = "ColumnFourLabel";
+ public static final String COLUMN_FIVE_LABEL = "ColumnFiveLabel";
+ public static final String COLUMN_SIX_LABEL = "ColumnSixLabel";
+ public static final String COLUMN_SEVEN_LABEL = "ColumnSevenLabel";
+ public static final String COLUMN_EIGHT_LABEL = "ColumnEightLabel";
+ public static final String COLUMN_NINE_LABEL = "ColumnNineLabel";
+ public static final String COLUMN_TEN_LABEL = "ColumnTenLabel";
+ public static final String COLUMN_ELEVEN_LABEL = "ColumnElevenLabel";
+ public static final String COLUMN_TWELVE_LABEL = "ColumnTwelveLabel";
+ public static final String COLUMN_THIRTEEN_LABEL = "ColumnThirteenLabel";
@Override
public Control createExampleControl(Composite parent) {
diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_900_Everything_but_the_kitchen_sink.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_900_Everything_but_the_kitchen_sink.java
index 4601b12..a4d88be 100644
--- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_900_Everything_but_the_kitchen_sink.java
+++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_900_Everything_but_the_kitchen_sink.java
@@ -109,8 +109,7 @@
@Override
public Control createExampleControl(Composite parent) {
final String[] propertyNames = RowDataListFixture.getPropertyNames();
- final Map<String, String> propertyToLabelMap = RowDataListFixture
- .getPropertyToLabelMap();
+ final Map<String, String> propertyToLabelMap = RowDataListFixture.getPropertyToLabelMap();
ConfigRegistry configRegistry = new ConfigRegistry();
ColumnGroupModel columnGroupModel = new ColumnGroupModel();
@@ -118,15 +117,12 @@
// Body
LinkedList<BlinkingRowDataFixture> rowData = new LinkedList<>();
- this.baseEventList = GlazedLists.threadSafeList(GlazedLists
- .eventList(rowData));
+ this.baseEventList = GlazedLists.threadSafeList(GlazedLists.eventList(rowData));
ObservableElementList<BlinkingRowDataFixture> observableElementList = new ObservableElementList<>(
this.baseEventList,
GlazedLists.beanConnector(BlinkingRowDataFixture.class));
- FilterList<BlinkingRowDataFixture> filterList = new FilterList<>(
- observableElementList);
- SortedList<BlinkingRowDataFixture> sortedList = new SortedList<>(
- filterList, null);
+ FilterList<BlinkingRowDataFixture> filterList = new FilterList<>(observableElementList);
+ SortedList<BlinkingRowDataFixture> sortedList = new SortedList<>(filterList, null);
FullFeaturedBodyLayerStack<BlinkingRowDataFixture> bodyLayer =
new FullFeaturedBodyLayerStack<>(
@@ -147,34 +143,38 @@
registerBlinkingConfigCells(configRegistry);
// Column header
- FullFeaturedColumnHeaderLayerStack<BlinkingRowDataFixture> columnHeaderLayer = new FullFeaturedColumnHeaderLayerStack<>(
- sortedList, filterList, propertyNames, propertyToLabelMap,
- bodyLayer, bodyLayer.getSelectionLayer(), columnGroupModel,
- configRegistry);
+ FullFeaturedColumnHeaderLayerStack<BlinkingRowDataFixture> columnHeaderLayer =
+ new FullFeaturedColumnHeaderLayerStack<>(
+ sortedList,
+ filterList,
+ propertyNames,
+ propertyToLabelMap,
+ bodyLayer,
+ bodyLayer.getSelectionLayer(),
+ columnGroupModel,
+ configRegistry);
// column groups
setUpColumnGroups(columnHeaderLayer);
// Row header
- final DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultSummaryRowHeaderDataProvider(
- this.bodyDataProvider);
- DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
- rowHeaderDataProvider);
+ final DefaultRowHeaderDataProvider rowHeaderDataProvider =
+ new DefaultSummaryRowHeaderDataProvider(this.bodyDataProvider);
+ DefaultRowHeaderDataLayer rowHeaderDataLayer =
+ new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
rowHeaderDataLayer.setDefaultColumnWidth(50);
- ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
- bodyLayer, bodyLayer.getSelectionLayer());
+ ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, bodyLayer, bodyLayer.getSelectionLayer());
// Corner
- final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
- columnHeaderLayer.getColumnHeaderDataProvider(),
- rowHeaderDataProvider);
+ final DefaultCornerDataProvider cornerDataProvider =
+ new DefaultCornerDataProvider(
+ columnHeaderLayer.getColumnHeaderDataProvider(),
+ rowHeaderDataProvider);
DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
- ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
- columnHeaderLayer);
+ ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);
// Grid
- GridLayer gridLayer = new GridLayer(bodyLayer, columnHeaderLayer,
- rowHeaderLayer, cornerLayer);
+ GridLayer gridLayer = new GridLayer(bodyLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);
this.natTable = new NatTable(parent, gridLayer, false);
@@ -193,13 +193,11 @@
this.natTable.addConfiguration(new SingleClickSortConfiguration());
// Editing
- ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
- bodyLayer.getBodyDataLayer());
- bodyLayer.getBodyDataLayer().setConfigLabelAccumulator(
- columnLabelAccumulator);
- this.natTable.addConfiguration(EditableGridExample
- .editableGridConfiguration(columnLabelAccumulator,
- this.bodyDataProvider));
+ ColumnOverrideLabelAccumulator columnLabelAccumulator =
+ new ColumnOverrideLabelAccumulator(bodyLayer.getBodyDataLayer());
+ bodyLayer.getBodyDataLayer().setConfigLabelAccumulator(columnLabelAccumulator);
+ this.natTable.addConfiguration(
+ EditableGridExample.editableGridConfiguration(columnLabelAccumulator, this.bodyDataProvider));
this.natTable.addConfiguration(new FilterRowGridExample.FilterRowCustomConfiguration());
// Column chooser
@@ -212,19 +210,15 @@
bodyLayer.registerCommandHandler(columnChooserCommandHandler);
// Summary row configuration
- this.natTable.addConfiguration(new MySummaryRow<>(
- this.bodyDataProvider));
+ this.natTable.addConfiguration(new MySummaryRow<>(this.bodyDataProvider));
this.natTable.configure();
return this.natTable;
}
- private void setUpColumnGroups(
- FullFeaturedColumnHeaderLayerStack<BlinkingRowDataFixture> headerLayer) {
- headerLayer.getColumnGroupHeaderLayer().addColumnsIndexesToGroup(
- "TestGroup", 1, 2);
- headerLayer.getColumnGroupHeaderLayer().addColumnsIndexesToGroup(
- "TestGroup1", 5, 6, 7);
+ private void setUpColumnGroups(FullFeaturedColumnHeaderLayerStack<BlinkingRowDataFixture> headerLayer) {
+ headerLayer.getColumnGroupHeaderLayer().addColumnsIndexesToGroup("TestGroup", 1, 2);
+ headerLayer.getColumnGroupHeaderLayer().addColumnsIndexesToGroup("TestGroup1", 5, 6, 7);
headerLayer.getColumnGroupHeaderLayer().setGroupUnbreakable(5);
headerLayer.getColumnGroupHeaderLayer().setGroupAsCollapsed(5);
}
@@ -254,21 +248,30 @@
private void registerBlinkingConfigCells(ConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(
- BlinkConfigAttributes.BLINK_RESOLVER, getBlinkResolver(),
+ BlinkConfigAttributes.BLINK_RESOLVER,
+ getBlinkResolver(),
DisplayMode.NORMAL);
// Styles
Style cellStyle = new Style();
- cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
+ cellStyle.setAttributeValue(
+ CellStyleAttributes.BACKGROUND_COLOR,
GUIHelper.COLOR_GREEN);
- configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
- cellStyle, DisplayMode.NORMAL, BLINK_UP_CONFIG_LABEL);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_STYLE,
+ cellStyle,
+ DisplayMode.NORMAL,
+ BLINK_UP_CONFIG_LABEL);
cellStyle = new Style();
- cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR,
+ cellStyle.setAttributeValue(
+ CellStyleAttributes.BACKGROUND_COLOR,
GUIHelper.COLOR_RED);
- configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,
- cellStyle, DisplayMode.NORMAL, BLINK_DOWN_CONFIG_LABEL);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_STYLE,
+ cellStyle,
+ DisplayMode.NORMAL,
+ BLINK_DOWN_CONFIG_LABEL);
}
private IBlinkingCellResolver getBlinkResolver() {
@@ -279,7 +282,8 @@
public String[] resolve(Object oldValue, Object newValue) {
double old = ((Double) oldValue).doubleValue();
double latest = ((Double) newValue).doubleValue();
- this.configLabels[0] = (latest > old ? BLINK_UP_CONFIG_LABEL
+ this.configLabels[0] = (latest > old
+ ? BLINK_UP_CONFIG_LABEL
: BLINK_DOWN_CONFIG_LABEL);
return this.configLabels;
}
@@ -305,8 +309,7 @@
private final String waitMsg = "Loading data. Please wait... ";
private WaitDialog dialog;
- public DataLoader(PropertyChangeListener changeListener,
- EventList<BlinkingRowDataFixture> baseEventList) {
+ public DataLoader(PropertyChangeListener changeListener, EventList<BlinkingRowDataFixture> baseEventList) {
this.changeListener = changeListener;
this.list = baseEventList;
}
@@ -332,8 +335,7 @@
// Add to buffer
List<BlinkingRowDataFixture> buffer = new ArrayList<>();
for (int i = 0; i < 100; i++) {
- buffer.addAll(BlinkingRowDataFixture
- .getList(this.changeListener));
+ buffer.addAll(BlinkingRowDataFixture.getList(this.changeListener));
}
// Load as a batch
this.list.addAll(buffer);
@@ -399,7 +401,7 @@
// System.out.println("Ask:
// "+rowObject.getAsk_price()+" --> "+nextAsk);
rowObject.setAsk_price(nextAsk);
- rowObject.setBid_price(-1 * nextAsk);
+ rowObject.setBid_price(-1d * nextAsk);
}
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/GlazedListsEventLayerTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/GlazedListsEventLayerTest.java
index 28b0b35..c4502a0 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/GlazedListsEventLayerTest.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/GlazedListsEventLayerTest.java
@@ -62,12 +62,16 @@
CountDownLatch countDownLatch = new CountDownLatch(1);
this.listenerFixture.setCountDownLatch(countDownLatch);
this.listFixture.add(RowDataFixture.getInstance("T1", "A"));
- countDownLatch.await(500, TimeUnit.MILLISECONDS);
+ boolean completed = countDownLatch.await(500, TimeUnit.MILLISECONDS);
+
+ assertTrue(completed, "Timeout - no event received");
countDownLatch = new CountDownLatch(1);
this.listenerFixture.setCountDownLatch(countDownLatch);
this.listFixture.add(RowDataFixture.getInstance("T2", "A"));
- countDownLatch.await(500, TimeUnit.MILLISECONDS);
+ completed = countDownLatch.await(500, TimeUnit.MILLISECONDS);
+
+ assertTrue(completed, "Timeout - no event received");
assertNotNull(this.listenerFixture.getReceivedEvent(RowStructuralRefreshEvent.class));
}
@@ -80,12 +84,16 @@
assertFalse(this.layerUnderTest.isDisposed());
this.listFixture.add(RowDataFixture.getInstance("T1", "A"));
- countDownLatch.await(500, TimeUnit.MILLISECONDS);
+ boolean completed = countDownLatch.await(500, TimeUnit.MILLISECONDS);
+
+ assertTrue(completed, "Timeout - no event received");
countDownLatch = new CountDownLatch(1);
this.listenerFixture.setCountDownLatch(countDownLatch);
this.listFixture.add(RowDataFixture.getInstance("T2", "A"));
- countDownLatch.await(500, TimeUnit.MILLISECONDS);
+ completed = countDownLatch.await(500, TimeUnit.MILLISECONDS);
+
+ assertTrue(completed, "Timeout - no event received");
this.layerUnderTest.doCommand(new DisposeResourcesCommand());
assertTrue(this.layerUnderTest.isDisposed());
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxFilterRowHeaderCompositeIntegrationTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxFilterRowHeaderCompositeIntegrationTest.java
index cfedadc..47f5f72 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxFilterRowHeaderCompositeIntegrationTest.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxFilterRowHeaderCompositeIntegrationTest.java
@@ -324,7 +324,9 @@
// edit one entry
natTable.doCommand(new UpdateDataCommand(natTable, 1, 3, "Bort"));
- countDown.await(2000, TimeUnit.MILLISECONDS);
+ boolean completed = countDown.await(2000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(1, listener.getEventsCount());
@@ -350,7 +352,9 @@
natTable.doCommand(new UpdateDataCommand(natTable, 1, 3, "Bart"));
- countDown.await(2000, TimeUnit.MILLISECONDS);
+ completed = countDown.await(2000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(1, listener.getEventsCount());
@@ -395,10 +399,12 @@
bodyLayer.eventList.add(entry);
// long start = System.currentTimeMillis();
- countDown.await(2000, TimeUnit.MILLISECONDS);
+ boolean completed = countDown.await(2000, TimeUnit.MILLISECONDS);
// long end = System.currentTimeMillis();
// System.out.println("duration " + (end - start));
+ assertTrue("Timeout - no event received", completed);
+
assertEquals(2, listener.getEventsCount());
FilterRowComboUpdateEvent evt = listener.getReceivedEvents().get(0);
@@ -433,10 +439,12 @@
listener.setCountDown(countDown);
// start = System.currentTimeMillis();
- countDown.await(2000, TimeUnit.MILLISECONDS);
+ completed = countDown.await(2000, TimeUnit.MILLISECONDS);
// end = System.currentTimeMillis();
// System.out.println("duration " + (end - start));
+ assertTrue("Timeout - no event received", completed);
+
filterRowHeaderLayer.comboBoxDataProvider.removeCacheUpdateListener(listener);
}
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/fixture/ViewportLayerFixture.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/fixture/ViewportLayerFixture.java
index 41ba95d..b6e4984 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/fixture/ViewportLayerFixture.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/fixture/ViewportLayerFixture.java
@@ -27,9 +27,9 @@
*/
public class ViewportLayerFixture extends ViewportLayer {
- public static Rectangle DEFAULT_CLIENT_AREA = new Rectangle(0, 0, 200, 100);
- public static IClientAreaProvider DEFAULT_CLIENT_AREA_PROVIDER = getClientAreaProvider(DEFAULT_CLIENT_AREA);
- public static Scrollable DEFAULT_SCROLLABLE = scrollable();
+ public static final Rectangle DEFAULT_CLIENT_AREA = new Rectangle(0, 0, 200, 100);
+ public static final IClientAreaProvider DEFAULT_CLIENT_AREA_PROVIDER = getClientAreaProvider(DEFAULT_CLIENT_AREA);
+ public static final Scrollable DEFAULT_SCROLLABLE = scrollable();
/**
* Default Xtor
@@ -41,8 +41,7 @@
public ViewportLayerFixture(IUniqueIndexLayer underlingLayer) {
super(underlingLayer);
- setClientAreaProvider(getClientAreaProvider(new Rectangle(0, 0, 1000,
- 1000)));
+ setClientAreaProvider(getClientAreaProvider(new Rectangle(0, 0, 1000, 1000)));
doCommand(new InitializeClientAreaCommandFixture());
}
@@ -61,10 +60,8 @@
* @param rowCount
* total number of rows
*/
- public ViewportLayerFixture(int colCount, int rowCount,
- int defaultColWidth, int defaultRowHeight) {
- super(new DataLayerFixture(colCount, rowCount, defaultColWidth,
- defaultRowHeight));
+ public ViewportLayerFixture(int colCount, int rowCount, int defaultColWidth, int defaultRowHeight) {
+ super(new DataLayerFixture(colCount, rowCount, defaultColWidth, defaultRowHeight));
setClientAreaProvider(DEFAULT_CLIENT_AREA_PROVIDER);
}
@@ -76,8 +73,7 @@
setClientAreaProvider(getClientAreaProvider(clientArea));
}
- private static IClientAreaProvider getClientAreaProvider(
- final Rectangle clientArea) {
+ private static IClientAreaProvider getClientAreaProvider(Rectangle clientArea) {
return new IClientAreaProvider() {
@Override
public Rectangle getClientArea() {
@@ -87,7 +83,6 @@
}
private static Scrollable scrollable() {
- return new Composite(new Shell(Display.getDefault()), SWT.H_SCROLL
- | SWT.V_SCROLL);
+ return new Composite(new Shell(Display.getDefault()), SWT.H_SCROLL | SWT.V_SCROLL);
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/groupby/GroupByDataLayerSummaryRowConcurrencyTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/groupby/GroupByDataLayerSummaryRowConcurrencyTest.java
index d3417cf..1f2da29 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/groupby/GroupByDataLayerSummaryRowConcurrencyTest.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/groupby/GroupByDataLayerSummaryRowConcurrencyTest.java
@@ -84,7 +84,7 @@
try {
Thread.sleep(80);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Thread.currentThread().interrupt();
}
}
return rowObject.value;
@@ -170,7 +170,7 @@
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Thread.currentThread().interrupt();
}
}
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/hierarchical/HierarchicalTreeLayerGlazedListsTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/hierarchical/HierarchicalTreeLayerGlazedListsTest.java
index e74762e..52c102b 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/hierarchical/HierarchicalTreeLayerGlazedListsTest.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/hierarchical/HierarchicalTreeLayerGlazedListsTest.java
@@ -83,22 +83,22 @@
public void setup() {
this.input = CarService.getInput();
// de-normalize the object graph without parent structure objects
- List<HierarchicalWrapper> data = HierarchicalHelper.deNormalize(this.input, false, CarService.PROPERTY_NAMES_COMPACT);
+ List<HierarchicalWrapper> data = HierarchicalHelper.deNormalize(this.input, false, CarService.getPropertyNamesCompact());
this.eventList = GlazedLists.eventList(data);
TransformedList<HierarchicalWrapper, HierarchicalWrapper> rowObjectsGlazedList = GlazedLists.threadSafeList(this.eventList);
- this.columnPropertyAccessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.PROPERTY_NAMES_COMPACT);
+ this.columnPropertyAccessor = new HierarchicalReflectiveColumnPropertyAccessor(CarService.getPropertyNamesCompact());
this.sortedList = new SortedList<>(
rowObjectsGlazedList,
new HierarchicalWrapperComparator(
this.columnPropertyAccessor,
- HierarchicalHelper.getLevelIndexMapping(CarService.PROPERTY_NAMES_COMPACT)));
+ HierarchicalHelper.getLevelIndexMapping(CarService.getPropertyNamesCompact())));
this.filterList = new FilterList<>(this.sortedList);
this.bodyDataProvider = new ListDataProvider<>(this.filterList, this.columnPropertyAccessor);
- HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(this.bodyDataProvider, CarService.PROPERTY_NAMES_COMPACT);
+ HierarchicalSpanningDataProvider spanningDataProvider = new HierarchicalSpanningDataProvider(this.bodyDataProvider, CarService.getPropertyNamesCompact());
this.bodyDataLayer = new SpanningDataLayer(spanningDataProvider);
// simply apply labels for every column by index
@@ -109,7 +109,7 @@
glazedListsEventLayer.setTestMode(true);
this.selectionLayer = new SelectionLayer(glazedListsEventLayer);
- this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.filterList, CarService.PROPERTY_NAMES_COMPACT);
+ this.treeLayer = new HierarchicalTreeLayer(this.selectionLayer, this.filterList, CarService.getPropertyNamesCompact());
// create a dummy config registry
this.configRegistry = new ConfigRegistry();
@@ -117,7 +117,7 @@
SortConfigAttributes.SORT_COMPARATOR,
DefaultComparator.getInstance());
- this.columnHeaderDataLayer = new DataLayer(new DefaultColumnHeaderDataProvider(CarService.PROPERTY_NAMES_COMPACT));
+ this.columnHeaderDataLayer = new DataLayer(new DefaultColumnHeaderDataProvider(CarService.getPropertyNamesCompact()));
this.sortModel = new HierarchicalWrapperSortModel(
this.sortedList, this.columnPropertyAccessor, this.treeLayer.getLevelIndexMapping(), this.columnHeaderDataLayer, this.configRegistry);
@@ -934,7 +934,7 @@
this.input.add(car4);
- List<HierarchicalWrapper> data = HierarchicalHelper.deNormalize(this.input, false, CarService.PROPERTY_NAMES_COMPACT);
+ List<HierarchicalWrapper> data = HierarchicalHelper.deNormalize(this.input, false, CarService.getPropertyNamesCompact());
this.eventList.clear();
this.eventList.addAll(data);
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/DataChangeLayerIntegrationTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/DataChangeLayerIntegrationTest.java
index 9eec975..3bd0d37 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/DataChangeLayerIntegrationTest.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/DataChangeLayerIntegrationTest.java
@@ -134,7 +134,9 @@
// give the GlazedListsEventLayer some time to trigger the
// RowStructuralRefreshEvent
- this.lock.await(1000, TimeUnit.MILLISECONDS);
+ boolean completed = this.lock.await(1000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(9, this.filterList.size());
assertFalse(this.dataChangeLayer.getDataChanges().isEmpty());
@@ -145,7 +147,9 @@
// give the GlazedListsEventLayer some time to trigger the
// RowStructuralRefreshEvent
- this.lock.await(1000, TimeUnit.MILLISECONDS);
+ completed = this.lock.await(1000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(18, this.filterList.size());
assertFalse(this.dataChangeLayer.getDataChanges().isEmpty());
@@ -174,7 +178,9 @@
// give the GlazedListsEventLayer some time to trigger the
// RowStructuralRefreshEvent
- this.lock.await(1000, TimeUnit.MILLISECONDS);
+ boolean completed = this.lock.await(1000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(18, this.filterList.size());
assertFalse(this.dataChangeLayer.getDataChanges().isEmpty());
diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/RowStructuralDataChangeLayerIntegrationTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/RowStructuralDataChangeLayerIntegrationTest.java
index b663cd0..6653238 100644
--- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/RowStructuralDataChangeLayerIntegrationTest.java
+++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/test/integration/RowStructuralDataChangeLayerIntegrationTest.java
@@ -440,7 +440,9 @@
// give the GlazedListsEventLayer some time to trigger the
// RowStructuralRefreshEvent
- this.lock.await(1000, TimeUnit.MILLISECONDS);
+ boolean completed = this.lock.await(1000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(9, this.filterList.size());
assertFalse(this.dataChangeLayer.getDataChanges().isEmpty());
@@ -451,7 +453,9 @@
// give the GlazedListsEventLayer some time to trigger the
// RowStructuralRefreshEvent
- this.lock.await(1000, TimeUnit.MILLISECONDS);
+ completed = this.lock.await(1000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(18, this.filterList.size());
assertFalse(this.dataChangeLayer.getDataChanges().isEmpty());
@@ -480,7 +484,9 @@
// give the GlazedListsEventLayer some time to trigger the
// RowStructuralRefreshEvent
- this.lock.await(1000, TimeUnit.MILLISECONDS);
+ boolean completed = this.lock.await(1000, TimeUnit.MILLISECONDS);
+
+ assertTrue("Timeout - no event received", completed);
assertEquals(18, this.filterList.size());
assertFalse(this.dataChangeLayer.getDataChanges().isEmpty());