Search in sources :

Example 1 with CSSStyleDeclaration

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();
}
Also used : CSSStyleDeclaration(org.jboss.errai.common.client.dom.CSSStyleDeclaration)

Example 2 with CSSStyleDeclaration

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();
}
Also used : PopupEditorControls(org.kie.workbench.common.dmn.client.widgets.grid.controls.PopupEditorControls) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) CSSStyleDeclaration(org.jboss.errai.common.client.dom.CSSStyleDeclaration) Test(org.junit.Test)

Example 3 with CSSStyleDeclaration

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();
}
Also used : CSSStyleDeclaration(org.jboss.errai.common.client.dom.CSSStyleDeclaration)

Aggregations

CSSStyleDeclaration (org.jboss.errai.common.client.dom.CSSStyleDeclaration)3 HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)1 Test (org.junit.Test)1 PopupEditorControls (org.kie.workbench.common.dmn.client.widgets.grid.controls.PopupEditorControls)1