ItEr56S11CUEscaladoPantallaCargaRecursosEmpresaItEr55S15: Allow the filter name to be used to filter criterions.

This commit is contained in:
Jacobo Aragunde Pérez 2010-04-30 14:12:43 +02:00 committed by Javier Moran Rua
parent b9458dc93d
commit bcca6dd4dd
3 changed files with 12 additions and 9 deletions

View file

@ -84,6 +84,7 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
private String feedBackMessage;
private Boolean filterbyResources;
private boolean refreshNameFilter = true;
private int filterByNamePosition = 0;
private int numberOfGroupsByName = 10;
@ -113,12 +114,12 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
if (filterby.equals(filterResources)) {
this.filterbyResources = true;
this.feedBackMessage = _("showing resources");
setNameFilterDisabled(false);
} else {
this.filterbyResources = false;
this.feedBackMessage = _("showing criterions");
setNameFilterDisabled(true);
}
refreshNameFilter = true;
filterByNamePosition = 0;
invalidatingChangeHappenedWithFeedback();
}
@ -289,9 +290,8 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
listZoomLevels = (Listbox) getFellow("listZoomLevels");
listZoomLevels.setSelectedIndex(timeTracker.getDetailLevel().ordinal());
Combobox filterByNameCombo = (Combobox) getFellow("filterByNameCombo");
if(filterByNameCombo.getChildren().isEmpty()) {
setupNameFilter(filterByNameCombo);
if(refreshNameFilter) {
setupNameFilter();
}
}
@ -317,7 +317,9 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
resourceLoadList.addSeeScheduledOfListener(seeScheduledOfListener);
}
private void setupNameFilter(Combobox filterByNameCombo) {
private void setupNameFilter() {
Combobox filterByNameCombo = (Combobox) getFellow("filterByNameCombo");
filterByNameCombo.getChildren().clear();
int size = groups.size();
if(size > numberOfGroupsByName) {
@ -346,11 +348,12 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
Comboitem lastItem = new Comboitem();
lastItem.setLabel(_("All"));
lastItem.setDescription(_("Show all resources"));
lastItem.setDescription(_("Show all elements"));
lastItem.setValue(new Integer(-1));
filterByNameCombo.appendChild(lastItem);
filterByNameCombo.setSelectedIndex(0);
refreshNameFilter = false;
}
/**

View file

@ -44,7 +44,7 @@ resourcesLoadPanel = self;
onSelect="resourcesLoadPanel.setFilter(self.selectedItem.value);">
</listbox>
<separator/>
${i18n:_('Show resources between')}:
${i18n:_('Show elements between')}:
<combobox id="filterByNameCombo"
onChange="resourcesLoadPanel.onSelectFilterByName(self.selectedItemApi.value)" />
<separator/>

View file

@ -175,7 +175,7 @@ public class ResourceLoadController implements Composer {
if (resourcesLoadPanel != null) {
resourcesLoadPanel.init(resourceLoadModel.getLoadTimeLines(),
timeTracker);
if(bandBox != null && resourcesLoadPanel.getFilter()) {
if(bandBox != null) {
//if the worker bandbox filter is active, we disable the name filter
resourcesLoadPanel.setNameFilterDisabled(
!bandBox.getSelectedElements().isEmpty());