ItEr29S07CUConsultaModelosDePlanificacionItEr28S08: [Refactoring] WorkerFinder returns all elements that contain typed text

This commit is contained in:
Diego Pino Garcia 2009-10-07 12:12:44 +02:00 committed by Javier Moran Rua
parent 72197025c9
commit eb1478b100
2 changed files with 4 additions and 3 deletions

View file

@ -51,7 +51,7 @@ public abstract class Finder implements IFinder {
}
/**
* Returns true if entry starts with text
* Returns true if entry contains text partly
*
* @param entry
* Element from model
@ -60,7 +60,7 @@ public abstract class Finder implements IFinder {
*/
@Override
public boolean entryMatchesText(String entry, String text) {
return entry.toLowerCase().startsWith(text.toLowerCase());
return entry.toLowerCase().contains(text.toLowerCase());
}
/**

View file

@ -49,7 +49,8 @@ public class WorkerFinder extends Finder implements IFinder {
@Override
public String _toString(Object value) {
return ((Worker) value).getName();
final Worker worker = (Worker) value;
return worker.getName() + " - " + worker.getNif();
}
}