@Test public void filterProjectsTest() { assertEquals(3, libraryScreen.libraryTiles.size()); assertEquals(1, libraryScreen.filterProjects("project1").size()); assertEquals(1, libraryScreen.filterProjects("roject1").size()); assertEquals(0, libraryScreen.filterProjects("unexistent").size()); }
public List<TileWidget<WorkspaceProject>> filterProjects(final String filter) { List<TileWidget<WorkspaceProject>> filteredProjects = libraryTiles.stream() .filter(p -> p.getContent().getName().toUpperCase().contains(filter.toUpperCase())) .collect(Collectors.toList()); updateView(filteredProjects); return filteredProjects; }
PopulatedLibraryScreen { public List<TileWidget<WorkspaceProject>> filterProjects(final String filter) { List<TileWidget<WorkspaceProject>> filteredProjects = libraryTiles.stream() .filter(p -> p.getContent().getName().toUpperCase().contains(filter.toUpperCase())) .collect(Collectors.toList()); updateView(filteredProjects); return filteredProjects; } }
PopulatedLibraryScreen { public List<TileWidget<WorkspaceProject>> filterProjects(final String filter) { List<TileWidget<WorkspaceProject>> filteredProjects = libraryTiles.stream() .filter(p -> p.getContent().getName().toUpperCase().contains(filter.toUpperCase())) .collect(Collectors.toList()); updateView(filteredProjects); return filteredProjects; } @Inject  PopulatedLibraryScreen(final View view,
                                  final LibraryPlaces libraryPlaces,
                                  final Caller<LibraryService> libraryService,
                                  final ProjectController projectController,
                                  final WorkspaceProjectContext projectContext,
                                  final ManagedInstance<TileWidget<WorkspaceProject>> tileWidgets,
                                  final AddProjectButtonPresenter addProjectButtonPresenter,
                                  final Event<ProjectCountUpdate> projectCountUpdateEvent); }
PopulatedLibraryScreen { public List<TileWidget<WorkspaceProject>> filterProjects(final String filter) { List<TileWidget<WorkspaceProject>> filteredProjects = libraryTiles.stream() .filter(p -> p.getContent().getName().toUpperCase().contains(filter.toUpperCase())) .collect(Collectors.toList()); updateView(filteredProjects); return filteredProjects; } @Inject  PopulatedLibraryScreen(final View view,
                                  final LibraryPlaces libraryPlaces,
                                  final Caller<LibraryService> libraryService,
                                  final ProjectController projectController,
                                  final WorkspaceProjectContext projectContext,
                                  final ManagedInstance<TileWidget<WorkspaceProject>> tileWidgets,
                                  final AddProjectButtonPresenter addProjectButtonPresenter,
                                  final Event<ProjectCountUpdate> projectCountUpdateEvent); @PostConstruct void setup(); List<TileWidget<WorkspaceProject>> filterProjects(final String filter); boolean userCanCreateProjects(); int getProjectsCount(); View getView(); void onNewProjectEvent(@Observes NewProjectEvent e); void onRepositoryRemovedEvent(@Observes RepositoryRemovedEvent e); void onAssetListUpdated(@Observes @Routed ProjectAssetListUpdated event); }
PopulatedLibraryScreen { public List<TileWidget<WorkspaceProject>> filterProjects(final String filter) { List<TileWidget<WorkspaceProject>> filteredProjects = libraryTiles.stream() .filter(p -> p.getContent().getName().toUpperCase().contains(filter.toUpperCase())) .collect(Collectors.toList()); updateView(filteredProjects); return filteredProjects; } @Inject  PopulatedLibraryScreen(final View view,
                                  final LibraryPlaces libraryPlaces,
                                  final Caller<LibraryService> libraryService,
                                  final ProjectController projectController,
                                  final WorkspaceProjectContext projectContext,
                                  final ManagedInstance<TileWidget<WorkspaceProject>> tileWidgets,
                                  final AddProjectButtonPresenter addProjectButtonPresenter,
                                  final Event<ProjectCountUpdate> projectCountUpdateEvent); @PostConstruct void setup(); List<TileWidget<WorkspaceProject>> filterProjects(final String filter); boolean userCanCreateProjects(); int getProjectsCount(); View getView(); void onNewProjectEvent(@Observes NewProjectEvent e); void onRepositoryRemovedEvent(@Observes RepositoryRemovedEvent e); void onAssetListUpdated(@Observes @Routed ProjectAssetListUpdated event);  }