use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.
the class CollectionEditorDOMElement method initialise.
@Override
public void initialise(final GridBodyCellRenderContext context) {
transform(context);
final Bounds visibleBounds = gridLayer.getVisibleBounds();
final double shownWidth = visibleBounds.getWidth();
final double widgetWidth = (shownWidth * 0.5);
final double widgetLeft = ((shownWidth - widgetWidth) / 2);
widgetContainer.getElement().getStyle().setWidth(widgetWidth, Style.Unit.PX);
widgetContainer.getElement().getStyle().setLeft(widgetLeft, Style.Unit.PX);
final double shownHeight = visibleBounds.getHeight();
final double widgetHeight = (shownHeight * 0.5);
widget.setFixedHeight(widgetHeight, Style.Unit.PX);
widgetContainer.getElement().getStyle().setTop(0, Style.Unit.PX);
// Verify Collection editor is always shown on center of the widget, even when clicked cell left margin is outside of the grid
widgetContainer.getElement().getStyle().clearProperty("clip");
}
Aggregations