Change the format of the matching results of a search in the workers list

and in the machine list.

FEA: ItEr75S09ImproveBandboxFinders
This commit is contained in:
Susana Montes Pedreira 2011-07-19 15:00:34 +02:00
parent b0860f98d0
commit 5585d5b26e
3 changed files with 13 additions and 13 deletions

View file

@ -152,18 +152,17 @@ public class ResourcesMultipleFiltersFinder extends MultipleFiltersFinder {
}
private void addCriterion(CriterionType type, Criterion criterion) {
String pattern = type.getName() + " :: " + criterion.getName();
getListMatching()
.add(
new FilterPair(ResourceFilterEnum.Criterion, pattern,
criterion));
String pattern = criterion.getName() + " ( " + type.getName() + " ) ";
getListMatching().add(
new FilterPair(ResourceFilterEnum.Criterion, type.getResource()
.toLowerCase(), pattern, criterion));
}
private void addCostCategory(CostCategory costCategory) {
String pattern = costCategory.getName();
getListMatching().add(
new FilterPair(ResourceFilterEnum.CostCategory,
pattern, costCategory));
new FilterPair(ResourceFilterEnum.CostCategory, pattern,
costCategory));
}
}

View file

@ -37,7 +37,7 @@ public class WorkerMultipleFiltersFinder extends MultipleFiltersFinder {
private IFilterEnum workerFilterEnum = new IFilterEnum() {
@Override
public String toString() {
return "worker";
return "Resource ( Worker )";
}
};
@ -54,8 +54,9 @@ public class WorkerMultipleFiltersFinder extends MultipleFiltersFinder {
Iterator<Worker> iteratorWorker = getListWorkers().iterator();
while(iteratorWorker.hasNext() && getListMatching().size() < 10) {
Worker worker = iteratorWorker.next();
getListMatching().add(new FilterPair(
workerFilterEnum, worker.getShortDescription(), worker));
getListMatching().add(
new FilterPair(workerFilterEnum, worker.getDescription(),
worker));
}
addNoneFilter();
return getListMatching();
@ -78,8 +79,8 @@ public class WorkerMultipleFiltersFinder extends MultipleFiltersFinder {
}
private void searchInWorkers(String filter) {
for (Worker worker : getListWorkers()) {
String name = StringUtils.deleteWhitespace(
worker.getShortDescription().toLowerCase());
String name = StringUtils.deleteWhitespace(worker.getDescription()
.toLowerCase());
if(name.contains(filter)) {
getListMatching().add(new FilterPair(
workerFilterEnum, worker.getShortDescription(), worker));

View file

@ -24,7 +24,7 @@
<!-- Multiple filter -->
<label value="${i18n:_('Filter by')}"
tooltiptext="${i18n:_('Select required criteria set and press filter button')}"/>
<bandboxMultipleSearch id="bdFilters" widthBandbox="285px" widthListbox="300px"
<bandboxMultipleSearch id="bdFilters" widthBandbox="285px" widthListbox="550px"
finder="resourcesMultipleFiltersFinder"/>
<!-- Personal details -->