Search in sources :

Example 1 with ResizeFlowPanel

use of org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel in project kie-wb-common by kiegroup.

the class BaseNavigateCommand method addExpressionEditorToCanvasWidget.

protected void addExpressionEditorToCanvasWidget() {
    final ResizeFlowPanel container = wrapElementForErrai1090();
    presenter.getView().setCanvasWidget(container);
    presenter.getView().setContentScrollType(SessionPresenter.View.ScrollType.CUSTOM);
    Scheduler.get().scheduleDeferred(container::onResize);
}
Also used : ResizeFlowPanel(org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel)

Example 2 with ResizeFlowPanel

use of org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel 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

ResizeFlowPanel (org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel)2 Widget (com.google.gwt.user.client.ui.Widget)1 ElementWrapperWidget (org.jboss.errai.common.client.ui.ElementWrapperWidget)1