Search in sources :

Example 1 with ElementWrapperWidget

use of org.jboss.errai.common.client.ui.ElementWrapperWidget in project kie-wb-common by kiegroup.

the class TreeExplorerTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    when(canvasHandler.getDiagram()).thenReturn(diagram);
    when(canvasHandler.getDiagram().getGraph()).thenReturn(graph);
    when(diagram.getMetadata()).thenReturn(metadata);
    when(metadata.getShapeSetId()).thenReturn(SHAPE_SET_ID);
    when(textPropertyProviderFactory.getProvider(any(Element.class))).thenReturn(textPropertyProvider);
    when(definitionUtils.getDefinitionManager()).thenReturn(definitionManager);
    when(definitionManager.adapters()).thenReturn(adapterManager);
    when(adapterManager.forDefinition()).thenReturn(definitionAdapter);
    when(definitionAdapter.getId(anyObject())).thenReturn("defId");
    when(shapeManager.getShapeSet(eq(SHAPE_SET_ID))).thenReturn(shapeSet);
    when(shapeSet.getShapeFactory()).thenReturn(shapeFactory);
    when(shapeFactory.getGlyph(eq("defId"))).thenReturn(glyph);
    when(domGlyphRenderers.render(eq(glyph), anyDouble(), anyDouble())).thenReturn(isElement);
    this.childrenTraverseProcessor = spy(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()));
    this.testedTree = new TreeExplorer(childrenTraverseProcessor, textPropertyProviderFactory, elementSelectedEvent, definitionUtils, shapeManager, domGlyphRenderers, view) {

        @Override
        ElementWrapperWidget<?> wrapIconElement(final IsElement icon) {
            return mock(ElementWrapperWidget.class);
        }
    };
}
Also used : ElementWrapperWidget(org.jboss.errai.common.client.ui.ElementWrapperWidget) IsElement(org.jboss.errai.common.client.api.IsElement) IsElement(org.jboss.errai.common.client.api.IsElement) Element(org.kie.workbench.common.stunner.core.graph.Element) ChildrenTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl) TreeWalkTraverseProcessorImpl(org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl) Before(org.junit.Before)

Example 2 with ElementWrapperWidget

use of org.jboss.errai.common.client.ui.ElementWrapperWidget in project kie-wb-common by kiegroup.

the class BaseNavigateCommand method wrapElementForErrai1090.

// See https://issues.jboss.org/browse/ERRAI-1090
// The Widget returned from ElementWrapperWidget does not implement interfaces
// defined on the editor.getElement() and hence RequiresResize is lost.
// Wrap the editor in a ResizeFlowPanel to support RequiresResize.
protected ResizeFlowPanel wrapElementForErrai1090() {
    final Widget w = ElementWrapperWidget.getWidget(editor.getElement());
    final ResizeFlowPanel container = new ResizeFlowPanel() {

        @Override
        public void onResize() {
            super.onResize();
            editor.getView().onResize();
        }
    };
    container.getElement().setId("dmn-expression-editor-container");
    container.getElement().getStyle().setDisplay(Style.Display.FLEX);
    container.getElement().getStyle().setWidth(100.0, Style.Unit.PCT);
    container.getElement().getStyle().setHeight(100.0, Style.Unit.PCT);
    container.add(w);
    return container;
}
Also used : ResizeFlowPanel(org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel) Widget(com.google.gwt.user.client.ui.Widget) ElementWrapperWidget(org.jboss.errai.common.client.ui.ElementWrapperWidget)

Aggregations

ElementWrapperWidget (org.jboss.errai.common.client.ui.ElementWrapperWidget)2 Widget (com.google.gwt.user.client.ui.Widget)1 IsElement (org.jboss.errai.common.client.api.IsElement)1 Before (org.junit.Before)1 Element (org.kie.workbench.common.stunner.core.graph.Element)1 ChildrenTraverseProcessorImpl (org.kie.workbench.common.stunner.core.graph.processing.traverse.content.ChildrenTraverseProcessorImpl)1 TreeWalkTraverseProcessorImpl (org.kie.workbench.common.stunner.core.graph.processing.traverse.tree.TreeWalkTraverseProcessorImpl)1 ResizeFlowPanel (org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel)1