@Test public void libraryDoesNotLoadOnPerspectiveChangeEventFromOtherPerspectives() { when(perspectiveChangeEvent.getIdentifier()).thenReturn("dora"); perspective.perspectiveChangeEvent(perspectiveChangeEvent); verify(libraryPlaces, never()).refresh(any()); }
public void perspectiveChangeEvent(@Observes PerspectiveChange event) { if (event.getIdentifier().equals(LibraryPlaces.LIBRARY_PERSPECTIVE)) { if (refresh) { libraryPlaces.refresh(() -> { if (getRootPanel() != null) { libraryPlaces.goToLibrary(); } }); } else { libraryPlaces.refresh(() -> { }); } } }
LibraryPerspective { public void perspectiveChangeEvent(@Observes PerspectiveChange event) { if (event.getIdentifier().equals(LibraryPlaces.LIBRARY_PERSPECTIVE)) { if (refresh) { libraryPlaces.refresh(() -> { if (getRootPanel() != null) { libraryPlaces.goToLibrary(); } }); } else { libraryPlaces.refresh(() -> { }); } } } }
LibraryPerspective { public void perspectiveChangeEvent(@Observes PerspectiveChange event) { if (event.getIdentifier().equals(LibraryPlaces.LIBRARY_PERSPECTIVE)) { if (refresh) { libraryPlaces.refresh(() -> { if (getRootPanel() != null) { libraryPlaces.goToLibrary(); } }); } else { libraryPlaces.refresh(() -> { }); } } } LibraryPerspective(); @Inject  LibraryPerspective(final LibraryPlaces libraryPlaces,
                              final Event<WorkspaceProjectContextChangeEvent> projectContextChangeEvent); }
LibraryPerspective { public void perspectiveChangeEvent(@Observes PerspectiveChange event) { if (event.getIdentifier().equals(LibraryPlaces.LIBRARY_PERSPECTIVE)) { if (refresh) { libraryPlaces.refresh(() -> { if (getRootPanel() != null) { libraryPlaces.goToLibrary(); } }); } else { libraryPlaces.refresh(() -> { }); } } } LibraryPerspective(); @Inject  LibraryPerspective(final LibraryPlaces libraryPlaces,
                              final Event<WorkspaceProjectContextChangeEvent> projectContextChangeEvent); @Perspective PerspectiveDefinition buildPerspective(); @OnStartup void onStartup(final PlaceRequest placeRequest); void perspectiveChangeEvent(@Observes PerspectiveChange event); @OnClose void onClose(); PanelDefinition getRootPanel(); }
LibraryPerspective { public void perspectiveChangeEvent(@Observes PerspectiveChange event) { if (event.getIdentifier().equals(LibraryPlaces.LIBRARY_PERSPECTIVE)) { if (refresh) { libraryPlaces.refresh(() -> { if (getRootPanel() != null) { libraryPlaces.goToLibrary(); } }); } else { libraryPlaces.refresh(() -> { }); } } } LibraryPerspective(); @Inject  LibraryPerspective(final LibraryPlaces libraryPlaces,
                              final Event<WorkspaceProjectContextChangeEvent> projectContextChangeEvent); @Perspective PerspectiveDefinition buildPerspective(); @OnStartup void onStartup(final PlaceRequest placeRequest); void perspectiveChangeEvent(@Observes PerspectiveChange event); @OnClose void onClose(); PanelDefinition getRootPanel();  }