WorkbenchLayoutImpl implements WorkbenchLayout { @Override public void onResize() { resizeTo(Window.getClientWidth(), Window.getClientHeight()); } WorkbenchLayoutImpl(); @Inject  WorkbenchLayoutImpl(SyncBeanManager iocManager,
                               HeaderPanel root,
                               WorkbenchDragAndDropManager dndManager,
                               UberfireDocksContainer uberfireDocksContainer,
                               WorkbenchPickupDragController dragController,
                               Div headerPanel,
                               Div footerPanel); @Override HeaderPanel getRoot(); @Override HasWidgets getPerspectiveContainer(); @Override void onBootstrap(); @Override void onResize(); @Override void resizeTo(int width,
                         int height); @Override void maximize(final Widget w); @Override void maximize(final Widget w,
                         final Command callback); @Override void unmaximize(final Widget w); @Override void unmaximize(final Widget w,
                           final Command callback); @Override void setMarginWidgets(boolean isStandaloneMode,
                                 Set<String> headersToKeep); void addWorkbenchProfileCssClass(@Observes WorkbenchProfileCssClass workbenchProfileCssClass); static final String UF_MAXIMIZED_PANEL; static final String UF_ROOT_CSS_CLASS; }
@Test public void testExpandAnimation() { final WorkbenchLayoutImpl.ExpandAnimation expandAnimation = new WorkbenchLayoutImpl.ExpandAnimation(widget, Maps.<Widget, WorkbenchLayoutImpl.OriginalStyleInfo>newHashMap(), mock(SimpleLayoutPanel.class), null); expandAnimation.onComplete(); verify(((RequiresResize) widget)).onResize(); }
@Test public void testExpandAnimationWithCallback() { final Command callback = mock(Command.class); final WorkbenchLayoutImpl.ExpandAnimation expandAnimation = new WorkbenchLayoutImpl.ExpandAnimation(widget, Maps.<Widget, WorkbenchLayoutImpl.OriginalStyleInfo>newHashMap(), mock(SimpleLayoutPanel.class), callback); expandAnimation.onComplete(); verify(((RequiresResize) widget)).onResize(); verify(callback).execute(); }
@Test public void testCollapseAnimation() { final HashMap<Widget, WorkbenchLayoutImpl.OriginalStyleInfo> maximizedWidgetOriginalStyles = Maps.newHashMap(); maximizedWidgetOriginalStyles.put(widget, new WorkbenchLayoutImpl.OriginalStyleInfo(widget)); final WorkbenchLayoutImpl.CollapseAnimation collapseAnimation = new WorkbenchLayoutImpl.CollapseAnimation( widget, maximizedWidgetOriginalStyles, null); collapseAnimation.onComplete(); verify(((RequiresResize) widget)).onResize(); }
@Test public void testCollapseAnimationWithCallback() { final HashMap<Widget, WorkbenchLayoutImpl.OriginalStyleInfo> maximizedWidgetOriginalStyles = Maps.newHashMap(); maximizedWidgetOriginalStyles.put(widget, new WorkbenchLayoutImpl.OriginalStyleInfo(widget)); final Command callback = mock(Command.class); final WorkbenchLayoutImpl.CollapseAnimation collapseAnimation = new WorkbenchLayoutImpl.CollapseAnimation( widget, maximizedWidgetOriginalStyles, callback); collapseAnimation.onComplete(); verify(((RequiresResize) widget)).onResize(); verify(callback).execute(); }