use of org.jboss.errai.common.client.dom.CSSStyleDeclaration in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImpl method show.
@Override
public void show(final HasCellEditorControls.Editor editor, final int x, final int y) {
DOMUtil.removeAllChildren(cellEditorControlsContainer);
cellEditorControlsContainer.appendChild(editor.getElement());
final int tx = presenter.getTransformedX(x);
final int ty = presenter.getTransformedY(y);
final CSSStyleDeclaration style = getElement().getStyle();
style.setProperty("left", tx + "px");
style.setProperty("top", ty + "px");
activeEditor = Optional.of(editor);
editor.show();
}
use of org.jboss.errai.common.client.dom.CSSStyleDeclaration in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImplTest method testShow.
@Test
public void testShow() {
final PopupEditorControls editor = mock(PopupEditorControls.class);
final int x = 10;
final int y = 20;
final HTMLElement element = mock(HTMLElement.class);
doReturn(element).when(view).getElement();
final CSSStyleDeclaration style = mock(CSSStyleDeclaration.class);
when(element.getStyle()).thenReturn(style);
view.show(editor, x, y);
verify(style).setProperty(LEFT, x + PX);
verify(style).setProperty(TOP, y + PX);
verify(view).setOnClosedByKeyboardCallback(editor);
verify(editor).show();
}
use of org.jboss.errai.common.client.dom.CSSStyleDeclaration in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImpl method show.
@Override
public void show(final PopupEditorControls editor, final int x, final int y) {
DOMUtil.removeAllChildren(cellEditorControlsContainer);
cellEditorControlsContainer.appendChild(editor.getElement());
final CSSStyleDeclaration style = getElement().getStyle();
style.setProperty(LEFT, x + PX);
style.setProperty(TOP, y + PX);
setActiveEditor(Optional.of(editor));
setOnClosedByKeyboardCallback(editor);
editor.show();
}
Aggregations