@Test public void testGetCurrentView() { setUpApplicationLayout(); View view = mock(View.class, withSettings().extraInterfaces(Component.class).defaultAnswer(Mockito.CALLS_REAL_METHODS)); applicationLayout.showView(view); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(view)); }
protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view);  }