本文整理汇总了Java中org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget类的典型用法代码示例。如果您正苦于以下问题:Java BaseGridWidget类的具体用法?Java BaseGridWidget怎么用?Java BaseGridWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseGridWidget类属于org.uberfire.ext.wires.core.grids.client.widget.grid.impl包,在下文中一共展示了BaseGridWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeGridWidget2
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
private GridWidget makeGridWidget2() {
final GridData grid2 = new BaseGridData(false);
final GridWidget gridWidget2 = new BaseGridWidget(grid2,
this,
view.getGridLayer(),
new BaseGridRenderer(new MultiColouredTheme()) {
@Override
public double getHeaderHeight() {
return 64.0;
}
@Override
public double getHeaderRowHeight() {
return 64.0;
}
});
for (int idx = 0; idx < 5; idx++) {
final GridColumn.HeaderMetaData grid2ColumnHeaderMetaData = new BaseHeaderMetaData("G2-G0-C" + idx);
final BaseGridColumn<String> grid2Column = new StringPopupColumn(grid2ColumnHeaderMetaData,
new StringColumnRenderer(),
150);
grid2.appendColumn(grid2Column);
}
GridDataFactory.populate(grid2,
GRID2_ROWS);
gridWidget2.setLocation(new Point2D(0,
750));
return gridWidget2;
}
示例2: testConvertDOMToGridCoordinateNoParent
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testConvertDOMToGridCoordinateNoParent() throws Exception {
point = new Point2D(15D, 20D);
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
convertedPoint = CoordinateUtilities.convertDOMToGridCoordinate(view, point);
Assertions.assertThat(convertedPoint).isNotNull();
Assertions.assertThat(convertedPoint.getX()).isEqualTo(15D);
Assertions.assertThat(convertedPoint.getY()).isEqualTo(20D);
}
示例3: testConvertDOMToGridCoordinateWithParentWithoutTransform
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testConvertDOMToGridCoordinateWithParentWithoutTransform() throws Exception {
point = new Point2D(15D, 20D);
view = spy(new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer));
when(view.getViewport()).thenReturn(mock(Viewport.class));
convertedPoint = CoordinateUtilities.convertDOMToGridCoordinate(view, point);
Assertions.assertThat(convertedPoint).isNotNull();
Assertions.assertThat(convertedPoint.getX()).isEqualTo(15D);
Assertions.assertThat(convertedPoint.getY()).isEqualTo(20D);
}
示例4: testConvertDOMToGridCoordinateWithParentWithTransformMove
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testConvertDOMToGridCoordinateWithParentWithTransformMove() throws Exception {
final Viewport viewport = mock(Viewport.class);
final Transform transform = new Transform();
transform.translate(10D, 10D);
point = new Point2D(15D, 20D);
view = spy(new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer));
when(view.getViewport()).thenReturn(viewport);
when(viewport.getTransform()).thenReturn(transform);
convertedPoint = CoordinateUtilities.convertDOMToGridCoordinate(view, point);
Assertions.assertThat(convertedPoint).isNotNull();
Assertions.assertThat(convertedPoint.getX()).isEqualTo(5D);
Assertions.assertThat(convertedPoint.getY()).isEqualTo(10D);
}
示例5: testConvertDOMToGridCoordinateWithParentWithTransformMoveAndRotate
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testConvertDOMToGridCoordinateWithParentWithTransformMoveAndRotate() throws Exception {
final Viewport viewport = mock(Viewport.class);
final Transform transform = new Transform();
transform.translate(10D, 10D);
transform.rotate(Math.PI);
point = new Point2D(15D, 20D);
view = spy(new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer));
when(view.getViewport()).thenReturn(viewport);
when(viewport.getTransform()).thenReturn(transform);
convertedPoint = CoordinateUtilities.convertDOMToGridCoordinate(view, point);
Assertions.assertThat(convertedPoint).isNotNull();
Assertions.assertThat(Double.valueOf(convertedPoint.getX()).intValue()).isEqualTo(-5);
Assertions.assertThat(Double.valueOf(convertedPoint.getY()).intValue()).isEqualTo(-10);
}
示例6: testGetUiRowIndexInHeaderInFirstRow
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiRowIndexInHeaderInFirstRow() throws Exception {
// one row has height 20
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer rowIndex = CoordinateUtilities.getUiRowIndex(view, gridRenderer.getHeaderHeight() + 1);
Assertions.assertThat(rowIndex).isEqualTo(0);
}
示例7: testGetUiRowIndexInHeaderInSecondRow
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiRowIndexInHeaderInSecondRow() throws Exception {
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer rowIndex = CoordinateUtilities.getUiRowIndex(view, gridRenderer.getHeaderHeight() + DEFAULT_ROW_HEIGHT + 1);
Assertions.assertThat(rowIndex).isEqualTo(1);
}
示例8: testGetUiRowIndexInHeaderInThirdRow
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiRowIndexInHeaderInThirdRow() throws Exception {
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer rowIndex = CoordinateUtilities.getUiRowIndex(view, gridRenderer.getHeaderHeight() + (DEFAULT_ROW_HEIGHT * 2) + 1);
Assertions.assertThat(rowIndex).isEqualTo(2);
}
示例9: testGetUiRowIndexInHeaderBelowLastRow
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiRowIndexInHeaderBelowLastRow() throws Exception {
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
gridData.appendRow(new BaseGridRow());
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer rowIndex = CoordinateUtilities.getUiRowIndex(view, gridRenderer.getHeaderHeight() + (DEFAULT_ROW_HEIGHT * 3) + 1);
Assertions.assertThat(rowIndex).isNull();
}
示例10: testGetUiColumnIndexInHeaderAfterLastColumn
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiColumnIndexInHeaderAfterLastColumn() throws Exception {
gridData.appendColumn(new BaseGridColumn<Object>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH));
gridData.appendColumn(new BaseGridColumn<Object>(new BaseHeaderMetaData("second"), gridColumnRenderer, COLUMN_WIDTH));
gridData.appendColumn(new BaseGridColumn<Object>(new BaseHeaderMetaData("third"), gridColumnRenderer, COLUMN_WIDTH));
view = spy(new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer));
doReturn(gridSelectionManager).when(view).getLayer();
final Integer columnIndex = CoordinateUtilities.getUiColumnIndex(view, (COLUMN_WIDTH * 3) + 1);
Assertions.assertThat(columnIndex).isNull();
}
示例11: makeGridWidget
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
private GridWidget makeGridWidget() {
final GridData uiModel = new BaseGridData();
return new BaseGridWidget(uiModel,
gridLayer,
gridLayer,
renderer) {
@Override
public void select() {
//Don't render Selector for tests
}
};
}
示例12: makeGridWidget1
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
private GridWidget makeGridWidget1() {
final GridData grid1 = new BaseGridData(false);
grid1.setHeaderRowCount(2);
final GridWidget gridWidget1 = new BaseGridWidget(grid1,
this,
view.getGridLayer(),
new BaseGridRenderer(new MultiColouredTheme()));
//Add a floating column for row number
final RowNumberColumn grid1ColumnRowNumber = new RowNumberColumn();
grid1.appendColumn(grid1ColumnRowNumber);
//Add a floating column
final GridColumn.HeaderMetaData grid1ColumnFloatingHeaderMetaData = new BaseHeaderMetaData("Floating");
final TextBoxSingletonDOMElementFactory grid1ColumnFloatingFactory = new TextBoxSingletonDOMElementFactory(view.getGridPanel(),
view.getGridLayer(),
gridWidget1);
final BaseGridColumn<String> grid1ColumnFloating = new StringDOMElementSingletonColumn(grid1ColumnFloatingHeaderMetaData,
grid1ColumnFloatingFactory,
100);
grid1ColumnFloating.setMovable(false);
grid1ColumnFloating.setResizable(true);
grid1ColumnFloating.setFloatable(true);
grid1.appendColumn(grid1ColumnFloating);
for (int idx = 0; idx < 8; idx++) {
final int grid1ColumnGroupSuffix = (idx < 3 ? 0 : (idx < 6 ? 1 : 2));
final boolean isFloatable = (idx == 0);
final GridColumn.HeaderMetaData grid1ColumnHeaderMetaData1 = new BaseHeaderMetaData("G1-G" + grid1ColumnGroupSuffix + "-a-Long-Caption-1",
"grid1ColumnGroup");
final GridColumn.HeaderMetaData grid1ColumnHeaderMetaData2 = new BaseHeaderMetaData("G1-G" + grid1ColumnGroupSuffix + "-C" + idx + "-a-Long-Caption-2",
"grid1ColumnGroup" + grid1ColumnGroupSuffix);
final List<GridColumn.HeaderMetaData> grid1ColumnHeaderMetaData = new ArrayList<GridColumn.HeaderMetaData>();
grid1ColumnHeaderMetaData.add(grid1ColumnHeaderMetaData1);
grid1ColumnHeaderMetaData.add(grid1ColumnHeaderMetaData2);
final BaseGridColumn<String> grid1Column = new StringPopupColumn(grid1ColumnHeaderMetaData,
new StringColumnRenderer(),
100);
grid1Column.setMinimumWidth(50.0);
grid1Column.setFloatable(isFloatable);
grid1.appendColumn(grid1Column);
}
GridDataFactory.populate(grid1,
GRID1_ROWS);
gridWidget1.setLocation(new Point2D(-1300,
0));
return gridWidget1;
}
示例13: testGetUiRowIndexOverHeader
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiRowIndexOverHeader() throws Exception {
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer rowIndex = CoordinateUtilities.getUiRowIndex(view, -1);
Assertions.assertThat(rowIndex).isNull();
}
示例14: testGetUiRowIndexInHeader
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiRowIndexInHeader() throws Exception {
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer rowIndex = CoordinateUtilities.getUiRowIndex(view, gridRenderer.getHeaderHeight() - 1);
Assertions.assertThat(rowIndex).isNull();
}
示例15: testGetUiColumnIndexBeforeWidget
import org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidget; //导入依赖的package包/类
@Test
public void testGetUiColumnIndexBeforeWidget() throws Exception {
view = new BaseGridWidget(gridData, gridSelectionManager, gridPinnedModeManager, gridRenderer);
final Integer columnIndex = CoordinateUtilities.getUiColumnIndex(view, -1);
Assertions.assertThat(columnIndex).isNull();
}