ItEr29S07CUConsultaModelosDePlanificacionItEr28S08: [Refactoring] WorkerFinder returns all elements that contain typed text
This commit is contained in:
parent
72197025c9
commit
eb1478b100
2 changed files with 4 additions and 3 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue