use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ActionWorkItemInsertFactColumnConverter method makeHeaderMetaData.
@Override
public List<GridColumn.HeaderMetaData> makeHeaderMetaData(final BaseColumn column) {
final String workItemName = ((ActionWorkItemInsertFactCol52) column).getWorkItemName();
return new ArrayList<GridColumn.HeaderMetaData>() {
{
add(new BaseHeaderMetaData(workItemName, ActionCol52.class.getName()));
add(new BaseHeaderMetaData(column.getHeader(), workItemName + "-set"));
}
};
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldColumnConverter method makeHeaderMetaData.
@Override
public List<GridColumn.HeaderMetaData> makeHeaderMetaData(final BaseColumn column) {
final String workItemName = ((ActionWorkItemSetFieldCol52) column).getWorkItemName();
return new ArrayList<GridColumn.HeaderMetaData>() {
{
add(new BaseHeaderMetaData(workItemName, ActionCol52.class.getName()));
add(new BaseHeaderMetaData(column.getHeader(), workItemName + "-set"));
}
};
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ConditionColumnConverter method makeHeaderMetaData.
@Override
public List<GridColumn.HeaderMetaData> makeHeaderMetaData(final BaseColumn column) {
final String patternHeader = getPatternHeader(column);
final String conditionHeader = getConditionHeader(column);
return new ArrayList<GridColumn.HeaderMetaData>() {
{
add(new BaseHeaderMetaData(patternHeader, ConditionCol52.class.getName()));
add(new BaseHeaderMetaData(conditionHeader, patternHeader));
}
};
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ColumnHeaderPopOverImplTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
this.model = new GuidedDecisionTable52();
this.model.getExpandedColumns().get(0).setHeader("#");
this.model.getExpandedColumns().get(1).setHeader("description");
this.uiColumn1 = new RowNumberColumn();
this.uiColumn2 = new BaseGridColumn<>(new BaseHeaderMetaData("description"), columnRenderer, 100.0);
this.uiModel = new BaseGridData() {
{
setHeaderRowCount(2);
}
};
uiModel.appendColumn(uiColumn1);
uiModel.appendColumn(uiColumn2);
serviceCaller = new CallerMock<>(service);
when(service.toSource(any(Path.class), any(GuidedDecisionTable52.class))).thenReturn("source");
final Instance<ColumnDefinitionBuilder> buildersInstance = makeBuildersInstance();
final ColumnDefinitionFactory columnDefinitionFactory = new ColumnDefinitionFactory(buildersInstance);
when(renderer.getHeaderHeight()).thenReturn(64.0);
when(renderer.getHeaderRowHeight()).thenReturn(32.0);
when(dtPresenter.getView()).thenReturn(gridWidget);
when(dtPresenter.getModel()).thenReturn(model);
when(dtPresenter.getDataModelOracle()).thenReturn(dmo);
when(modellerView.getGridLayerView()).thenReturn(gridLayer);
when(gridLayer.getDomElementContainer()).thenReturn(domElementContainer);
when(gridLayer.getVisibleBounds()).thenReturn(bounds);
when(gridLayer.getViewport()).thenReturn(viewport);
when(gridWidget.getModel()).thenReturn(uiModel);
when(gridWidget.getViewport()).thenReturn(viewport);
when(gridWidget.getRenderer()).thenReturn(renderer);
when(gridWidget.getRendererHelper()).thenReturn(rendererHelper);
when(gridWidget.getWidth()).thenReturn(150.0);
when(gridWidget.getHeight()).thenReturn(64.0);
when(gridWidget.getX()).thenReturn(50.0);
when(gridWidget.getY()).thenReturn(50.0);
when(domElementContainer.getAbsoluteLeft()).thenReturn(200);
when(viewport.getTransform()).thenReturn(transform);
when(rendererHelper.getColumnOffset(uiColumn1)).thenReturn(0.0);
when(rendererHelper.getColumnOffset(uiColumn2)).thenReturn(uiColumn1.getWidth());
final BaseGridRendererHelper.RenderingInformation ri = new BaseGridRendererHelper.RenderingInformation(bounds, uiModel.getColumns(), new BaseGridRendererHelper.RenderingBlockInformation(new ArrayList<GridColumn<?>>() {
{
add(uiColumn2);
}
}, 0.0, 0.0, 0.0, 100.0), new BaseGridRendererHelper.RenderingBlockInformation(new ArrayList<GridColumn<?>>() {
{
add(uiColumn1);
}
}, 25.0, 0.0, 0.0, 50.0), 0, 0, Collections.<Double>emptyList(), false, false, 0, 2, 0);
when(rendererHelper.getRenderingInformation()).thenReturn(ri);
final ColumnHeaderPopOver wrapped = new ColumnHeaderPopOverImpl(view, columnDefinitionFactory);
this.popOver = spy(wrapped);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ColumnHeaderPopOverImplTest method showColumnServiceInvocation.
@Test
public void showColumnServiceInvocation() {
final Pattern52 p = new Pattern52();
p.getChildColumns().add(new ConditionCol52());
this.model.getConditions().add(p);
final BaseGridColumn<String> uiColumn3 = new BaseGridColumn<>(new BaseHeaderMetaData("condition"), columnRenderer, 100.0);
uiModel.appendColumn(uiColumn3);
when(transform.getScaleX()).thenReturn(1.0);
when(transform.getScaleY()).thenReturn(1.0);
popOver.show(modellerView, dtPresenter, 2);
verify(view, times(1)).show(contentProviderArgumentCaptor.capture());
popOver.show(modellerView, dtPresenter, 2);
verify(view, times(2)).show(contentProviderArgumentCaptor.capture());
// Emulate Timer execution
final PopOverView.ContentProvider contentProvider = contentProviderArgumentCaptor.getValue();
contentProvider.getContent((PopOverView.Content content) -> {
assertEquals("source", content.getContent());
});
verify(service, times(1)).toSource(any(Path.class), any(GuidedDecisionTable52.class));
}
Aggregations