Search in sources :

Example 51 with PositionCoordinate

use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.

the class EditUtilsTest method testIsCellEditableWithSingleSelectionEnableEditing.

@Test
public void testIsCellEditableWithSingleSelectionEnableEditing() {
    this.natTable.enableEditingOnAllCells();
    this.selectionLayer.selectCell(1, 1, false, false);
    PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
    assertTrue(EditUtils.isCellEditable(this.selectionLayer, this.natTable.getConfigRegistry(), coord));
}
Also used : PositionCoordinate(org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate) Test(org.junit.Test)

Example 52 with PositionCoordinate

use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.

the class RowSelectionEditUtilsTest method testIsCellEditableWithSingleSelectionEnableEditing.

@Test
public void testIsCellEditableWithSingleSelectionEnableEditing() {
    this.natTable.enableEditingOnAllCells();
    this.selectionLayer.selectCell(1, 1, false, false);
    PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
    assertTrue(EditUtils.isCellEditable(this.selectionLayer, this.natTable.getConfigRegistry(), coord));
}
Also used : PositionCoordinate(org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate) Test(org.junit.Test)

Example 53 with PositionCoordinate

use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.

the class RowSelectionEditUtilsTest method testIsCellEditableWithSingleSelection.

@Test
public void testIsCellEditableWithSingleSelection() {
    this.selectionLayer.selectCell(1, 1, false, false);
    PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
    assertFalse(EditUtils.isCellEditable(this.selectionLayer, this.natTable.getConfigRegistry(), coord));
}
Also used : PositionCoordinate(org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate) Test(org.junit.Test)

Example 54 with PositionCoordinate

use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.

the class RowSelectionEditUtilsTest method testIsCellEditableWithoutSelection.

@Test
public void testIsCellEditableWithoutSelection() {
    PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 0, 0);
    assertFalse(EditUtils.isCellEditable(this.selectionLayer, this.natTable.getConfigRegistry(), coord));
}
Also used : PositionCoordinate(org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate) Test(org.junit.Test)

Example 55 with PositionCoordinate

use of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate in project nebula.widgets.nattable by eclipse.

the class PositionCoordinateTest method setup.

@Before
public void setup() {
    ILayer layer = new DataLayerFixture();
    this.p1 = new PositionCoordinate(layer, 1, 2);
    this.p2 = new PositionCoordinate(layer, 1, 2);
}
Also used : ILayer(org.eclipse.nebula.widgets.nattable.layer.ILayer) DataLayerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture) PositionCoordinate(org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate) Before(org.junit.Before)

Aggregations

PositionCoordinate (org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate)97 Test (org.junit.Test)55 SelectCellCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectCellCommand)15 ILayerCell (org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell)10 Rectangle (org.eclipse.swt.graphics.Rectangle)9 SelectRegionCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectRegionCommand)7 ArrayList (java.util.ArrayList)5 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)5 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)5 Range (org.eclipse.nebula.widgets.nattable.coordinate.Range)4 ViewportSelectColumnGroupCommand (org.eclipse.nebula.widgets.nattable.group.command.ViewportSelectColumnGroupCommand)4 SearchEvent (org.eclipse.nebula.widgets.nattable.search.event.SearchEvent)4 SelectAllCommand (org.eclipse.nebula.widgets.nattable.selection.command.SelectAllCommand)4 ILayerListener (org.eclipse.nebula.widgets.nattable.layer.ILayerListener)3 HashSet (java.util.HashSet)2 Pattern (java.util.regex.Pattern)2 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)2 ColumnPositionCoordinate (org.eclipse.nebula.widgets.nattable.coordinate.ColumnPositionCoordinate)2 RowPositionCoordinate (org.eclipse.nebula.widgets.nattable.coordinate.RowPositionCoordinate)2 UpdateDataCommand (org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommand)2