src/main/java/ubu/digit/ui/views/HistoricProjectsView.java
private void applyFilter(String column, String valueChange) {
		LocalDate dateChange = null;
		dataFilteredGrid = new ArrayList<HistoricProject>();
		Iterator<HistoricProject> iterator = dataHistoricGrid.iterator();
		if(!valueChange.equals(" ")) {
			while (iterator.hasNext()) {
				HistoricProject historicProject = iterator.next();
				
				switch(column) {
					case "title":
						if(historicProject.getTitle().contains(valueChange)){
							dataFilteredGrid.add(historicProject);
						}
						break;
					case "tutor":
						if(historicProject.getTutors().contains(valueChange)){
							dataFilteredGrid.add(historicProject);
						}
						break;
					case "assignmentDate":
						dateChange = LocalDate.parse(valueChange, dateTimeFormatter);
						if(historicProject.getAssignmentDate().equals(dateChange)){
							dataFilteredGrid.add(historicProject);
						}
						break;
					case "presentationDate":
						dateChange = LocalDate.parse(valueChange, dateTimeFormatter);
						if(historicProject.getPresentationDate().equals(dateChange)){
						dataFilteredGrid.add(historicProject);
						}
						break;
				}
			}
			//Se establece los nuevos valores del grid
			gridHistoric.setItems(dataFilteredGrid);
		}
	}
/**
	 * Crea una nueva lista con los valores filtrados.
	 * 
	 * @param column
	 * @param valueChange
	 */
Crea una nueva lista con los valores filtrados.

@param column
@param valueChange
Crea una nueva lista con los valores filtrados . @param column @param valueChange
private void applyFilter(String column, String valueChange) {
		LocalDate dateChange = null;
		dataFilteredGrid = new ArrayList<HistoricProject>();
		Iterator<HistoricProject> iterator = dataHistoricGrid.iterator();
		if(!valueChange.equals(" ")) {
			while (iterator.hasNext()) {
				HistoricProject historicProject = iterator.next();
				switch(column) {
					case "title":
						if(historicProject.getTitle().contains(valueChange)){
							dataFilteredGrid.add(historicProject);
						}
						break;
					case "tutor":
						if(historicProject.getTutors().contains(valueChange)){
							dataFilteredGrid.add(historicProject);
						}
						break;
					case "assignmentDate":
						dateChange = LocalDate.parse(valueChange, dateTimeFormatter);
						if(historicProject.getAssignmentDate().equals(dateChange)){
							dataFilteredGrid.add(historicProject);
						}
						break;
					case "presentationDate":
						dateChange = LocalDate.parse(valueChange, dateTimeFormatter);
						if(historicProject.getPresentationDate().equals(dateChange)){
						dataFilteredGrid.add(historicProject);
						}
						break;
				}
			}
			gridHistoric.setItems(dataFilteredGrid);
		}
	}
private void applyFilter ( String column , String valueChange ) { LocalDate dateChange = null ; dataFilteredGrid = new ArrayList < HistoricProject > ( ) ; Iterator < HistoricProject > iterator = dataHistoricGrid . iterator ( ) ; if ( ! valueChange . equals ( " " ) ) { while ( iterator . hasNext ( ) ) { HistoricProject historicProject = iterator . next ( ) ; switch ( column ) { case "title" : if ( historicProject . getTitle ( ) . contains ( valueChange ) ) { dataFilteredGrid . add ( historicProject ) ; } break ; case "tutor" : if ( historicProject . getTutors ( ) . contains ( valueChange ) ) { dataFilteredGrid . add ( historicProject ) ; } break ; case "assignmentDate" : dateChange = LocalDate . parse ( valueChange , dateTimeFormatter ) ; if ( historicProject . getAssignmentDate ( ) . equals ( dateChange ) ) { dataFilteredGrid . add ( historicProject ) ; } break ; case "presentationDate" : dateChange = LocalDate . parse ( valueChange , dateTimeFormatter ) ; if ( historicProject . getPresentationDate ( ) . equals ( dateChange ) ) { dataFilteredGrid . add ( historicProject ) ; } break ; } } gridHistoric . setItems ( dataFilteredGrid ) ; } }
Crea una nueva lista con los valores filtrados.
Crea una nueva lista con los valores filtrados .
//Se establece los nuevos valores del grid