@Test public void testSetupDetailBreadcrumb() { String listLabel = "listLabel"; String detailLabel = "detailLabel"; String detailScreenId = "screenId"; PlaceManager placeManagerMock = mock(PlaceManager.class); presenter.setPlaceManager(placeManagerMock); presenter.setupDetailBreadcrumb(placeManagerMock, listLabel, detailLabel, detailScreenId); ArgumentCaptor<Command> captureCommand = ArgumentCaptor.forClass(Command.class); verify(breadcrumbsMock).clearBreadcrumbs(PERSPECTIVE_ID); verify(breadcrumbsMock).addBreadCrumb(eq(PERSPECTIVE_ID), eq(Constants.INSTANCE.Home()), captureCommand.capture()); captureCommand.getValue().execute(); verify(placeManagerMock).goTo(PerspectiveIds.HOME); verify(breadcrumbsMock).addBreadCrumb(eq(PERSPECTIVE_ID), eq(listLabel), captureCommand.capture()); captureCommand.getValue().execute(); verify(placeManagerMock).closePlace(detailScreenId); verify(breadcrumbsMock).addBreadCrumb(eq(PERSPECTIVE_ID), eq(detailLabel), eq(Commands.DO_NOTHING)); verifyNoMoreInteractions(breadcrumbsMock); }
public void setupDetailBreadcrumb(PlaceManager placeManager, String listLabel, String detailLabel, String detailScreenId) { breadcrumbs.clearBreadcrumbs(getPerspectiveId()); breadcrumbs.addBreadCrumb(getPerspectiveId(), Constants.INSTANCE.Home(), () -> placeManager.goTo(PerspectiveIds.HOME)); breadcrumbs.addBreadCrumb(getPerspectiveId(), listLabel, () -> closeDetails(detailScreenId)); breadcrumbs.addBreadCrumb(getPerspectiveId(), detailLabel, Commands.DO_NOTHING); this.detailScreenId = detailScreenId; }
AbstractScreenListPresenter extends AbstractListPresenter<T> { public void setupDetailBreadcrumb(PlaceManager placeManager, String listLabel, String detailLabel, String detailScreenId) { breadcrumbs.clearBreadcrumbs(getPerspectiveId()); breadcrumbs.addBreadCrumb(getPerspectiveId(), Constants.INSTANCE.Home(), () -> placeManager.goTo(PerspectiveIds.HOME)); breadcrumbs.addBreadCrumb(getPerspectiveId(), listLabel, () -> closeDetails(detailScreenId)); breadcrumbs.addBreadCrumb(getPerspectiveId(), detailLabel, Commands.DO_NOTHING); this.detailScreenId = detailScreenId; } }
AbstractScreenListPresenter extends AbstractListPresenter<T> { public void setupDetailBreadcrumb(PlaceManager placeManager, String listLabel, String detailLabel, String detailScreenId) { breadcrumbs.clearBreadcrumbs(getPerspectiveId()); breadcrumbs.addBreadCrumb(getPerspectiveId(), Constants.INSTANCE.Home(), () -> placeManager.goTo(PerspectiveIds.HOME)); breadcrumbs.addBreadCrumb(getPerspectiveId(), listLabel, () -> closeDetails(detailScreenId)); breadcrumbs.addBreadCrumb(getPerspectiveId(), detailLabel, Commands.DO_NOTHING); this.detailScreenId = detailScreenId; }  }
AbstractScreenListPresenter extends AbstractListPresenter<T> { public void setupDetailBreadcrumb(PlaceManager placeManager, String listLabel, String detailLabel, String detailScreenId) { breadcrumbs.clearBreadcrumbs(getPerspectiveId()); breadcrumbs.addBreadCrumb(getPerspectiveId(), Constants.INSTANCE.Home(), () -> placeManager.goTo(PerspectiveIds.HOME)); breadcrumbs.addBreadCrumb(getPerspectiveId(), listLabel, () -> closeDetails(detailScreenId)); breadcrumbs.addBreadCrumb(getPerspectiveId(), detailLabel, Commands.DO_NOTHING); this.detailScreenId = detailScreenId; }  @WorkbenchPartTitle String getTitle(); @WorkbenchPartTitleDecoration IsWidget getTitleDecorator(); @OnOpen void onOpen(); void onDetailScreenClosed(@Observes ClosePlaceEvent closed); @OnFocus void onFocus(); @OnStartup void onStartup(final PlaceRequest place); String getPerspectiveId(); @Inject void setIdentity(final User identity); @Inject void setServerTemplateSelectorMenuBuilder(final ServerTemplateSelectorMenuBuilder serverTemplateSelectorMenuBuilder); void onServerTemplateSelected(@Observes final ServerTemplateSelected serverTemplateSelected); String getSelectedServerTemplate(); void setSelectedServerTemplate(final ServerTemplate serverTemplate); abstract void createListBreadcrumb(); void setupListBreadcrumb(PlaceManager placeManager,
                                    String listLabel); void setupDetailBreadcrumb(PlaceManager placeManager,
                                      String listLabel,
                                      String detailLabel,
                                      String detailScreenId); void setUberfireBreadcrumbs(UberfireBreadcrumbs breadcrumbs); void setPerspectiveManager(PerspectiveManager perspectiveManager); void setPlaceManager(PlaceManager placeManager); void setEmptyResults(); }
AbstractScreenListPresenter extends AbstractListPresenter<T> { public void setupDetailBreadcrumb(PlaceManager placeManager, String listLabel, String detailLabel, String detailScreenId) { breadcrumbs.clearBreadcrumbs(getPerspectiveId()); breadcrumbs.addBreadCrumb(getPerspectiveId(), Constants.INSTANCE.Home(), () -> placeManager.goTo(PerspectiveIds.HOME)); breadcrumbs.addBreadCrumb(getPerspectiveId(), listLabel, () -> closeDetails(detailScreenId)); breadcrumbs.addBreadCrumb(getPerspectiveId(), detailLabel, Commands.DO_NOTHING); this.detailScreenId = detailScreenId; }  @WorkbenchPartTitle String getTitle(); @WorkbenchPartTitleDecoration IsWidget getTitleDecorator(); @OnOpen void onOpen(); void onDetailScreenClosed(@Observes ClosePlaceEvent closed); @OnFocus void onFocus(); @OnStartup void onStartup(final PlaceRequest place); String getPerspectiveId(); @Inject void setIdentity(final User identity); @Inject void setServerTemplateSelectorMenuBuilder(final ServerTemplateSelectorMenuBuilder serverTemplateSelectorMenuBuilder); void onServerTemplateSelected(@Observes final ServerTemplateSelected serverTemplateSelected); String getSelectedServerTemplate(); void setSelectedServerTemplate(final ServerTemplate serverTemplate); abstract void createListBreadcrumb(); void setupListBreadcrumb(PlaceManager placeManager,
                                    String listLabel); void setupDetailBreadcrumb(PlaceManager placeManager,
                                      String listLabel,
                                      String detailLabel,
                                      String detailScreenId); void setUberfireBreadcrumbs(UberfireBreadcrumbs breadcrumbs); void setPerspectiveManager(PerspectiveManager perspectiveManager); void setPlaceManager(PlaceManager placeManager); void setEmptyResults();  }