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);
}
};
}
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;
}
Aggregations