ItEr51S09CUAsignacionGrupoRecursosAPlanificacionItEr50S12: Vertical pagination in advanced assignment without selection listboxes
This commit is contained in:
parent
a8031638b4
commit
934307a771
5 changed files with 63 additions and 8 deletions
|
|
@ -136,6 +136,7 @@ public class TimeTrackedTableWithLeftPane<A, B> {
|
|||
|
||||
public void reload() {
|
||||
timeTrackedTable.recreate();
|
||||
loadModelForLeftPane();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,6 +370,8 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
private static final int VERTICAL_MAX_ELEMENTS = 25;
|
||||
|
||||
private IMessagesForUser messages;
|
||||
private LayoutRegion insertionPointTimetracker;
|
||||
private Div insertionPointLeftPanel;
|
||||
|
|
@ -378,6 +380,9 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
private Button paginationDownButton;
|
||||
private Button paginationUpButton;
|
||||
|
||||
private Button verticalPaginationUpButton;
|
||||
private Button verticalPaginationDownButton;
|
||||
|
||||
private TimeTracker timeTracker;
|
||||
|
||||
private PaginatorFilter paginatorFilter;
|
||||
|
|
@ -676,10 +681,11 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
private Component normalLayout;
|
||||
private Component noDataLayout;
|
||||
private TimeTrackedTableWithLeftPane<Row, Row> timeTrackedTableWithLeftPane;
|
||||
private int verticalIndex = 0;
|
||||
|
||||
private List<Row> getRows() {
|
||||
if (rowsCached != null) {
|
||||
return rowsCached;
|
||||
return filterRows(rowsCached);
|
||||
}
|
||||
rowsCached = new ArrayList<Row>();
|
||||
for (AllocationInput allocationInput : allocationInputs) {
|
||||
|
|
@ -693,9 +699,33 @@ public class AdvancedAllocationController extends GenericForwardComposer {
|
|||
groupingRow.listenTo(specificRows);
|
||||
rowsCached.addAll(specificRows);
|
||||
}
|
||||
return rowsCached;
|
||||
return filterRows(rowsCached);
|
||||
}
|
||||
|
||||
private List<Row> filterRows(List<Row> rows) {
|
||||
verticalPaginationUpButton.setDisabled(verticalIndex <= 0);
|
||||
verticalPaginationDownButton
|
||||
.setDisabled((verticalIndex + VERTICAL_MAX_ELEMENTS) >= rows
|
||||
.size());
|
||||
return rows.subList(verticalIndex, Math.min(rows.size(),
|
||||
verticalIndex + VERTICAL_MAX_ELEMENTS));
|
||||
}
|
||||
|
||||
public void verticalPagedown() {
|
||||
verticalIndex = verticalIndex + VERTICAL_MAX_ELEMENTS;
|
||||
timeTrackedTableWithLeftPane.reload();
|
||||
}
|
||||
|
||||
public void setVerticalPagedownButtonDisabled(boolean disabled) {
|
||||
verticalPaginationUpButton.setDisabled(disabled);
|
||||
}
|
||||
|
||||
public void verticalPageup() {
|
||||
verticalIndex = Math.max(verticalIndex - VERTICAL_MAX_ELEMENTS, 0);
|
||||
timeTrackedTableWithLeftPane.reload();
|
||||
}
|
||||
|
||||
|
||||
private List<Row> specificRows(AllocationInput allocationInput) {
|
||||
List<Row> result = new ArrayList<Row>();
|
||||
for (SpecificResourceAllocation specificResourceAllocation : allocationInput.getAggregate()
|
||||
|
|
@ -980,8 +1010,10 @@ class Row {
|
|||
if (isGroupingRow()) {
|
||||
Label label = (Label) allHoursInput;
|
||||
int totalHours = aggregate.getTotalHours();
|
||||
label.setValue(totalHours + "");
|
||||
Clients.closeErrorBox(label);
|
||||
if (label != null) {
|
||||
label.setValue(totalHours + "");
|
||||
Clients.closeErrorBox(label);
|
||||
}
|
||||
if (restriction.isInvalidTotalHours(totalHours)) {
|
||||
restriction.showInvalidHours(messages, totalHours);
|
||||
}
|
||||
|
|
|
|||
BIN
navalplanner-webapp/src/main/webapp/common/img/ico_down.png
Normal file
BIN
navalplanner-webapp/src/main/webapp/common/img/ico_down.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 662 B |
|
|
@ -42,15 +42,32 @@
|
|||
<button image="/common/img/ico_save.png" tooltiptext="${i18n:_('Accept')}" id="saveButton" class="planner-command"
|
||||
if="${!(advancedAllocationController.advancedAllocationOfSingleTask)}" />
|
||||
<separator/>
|
||||
<button tooltiptext="Page down" image="/common/img/ico_left.png" id="paginationDownButton"
|
||||
onClick="advancedAllocationController.paginationDown();" disabled="true" />
|
||||
<label>${i18n:_('Zoom level')}:</label>
|
||||
<listbox mold="select" rows="1" id="advancedAllocationZoomLevel"
|
||||
model="${advancedAllocationController.zoomLevels}"
|
||||
onSelect="advancedAllocationController.setZoomLevel(self.selectedItem.value);" >
|
||||
</listbox>
|
||||
<button tooltiptext="Page up" image="/common/img/ico_right.png" id="paginationUpButton" onClick="advancedAllocationController.paginationUp();" />
|
||||
|
||||
<separator/>
|
||||
<label>${i18n:_('Pagination')}:</label>
|
||||
<button tooltiptext="Page down" image="/common/img/ico_left.png" id="paginationDownButton"
|
||||
onClick="advancedAllocationController.paginationDown();" disabled="true" />
|
||||
<listbox mold="select" rows="1" visible="false" id="advancedAllocationHorizontalPagination">
|
||||
<listitem><listcell label="${i18n:_('Dates range')}" /><listcell label="Date Range 2" /><listcell label="Date Range 3 ..." /></listitem>
|
||||
</listbox>
|
||||
<button tooltiptext="Page up" image="/common/img/ico_right.png" id="paginationUpButton"
|
||||
onClick="advancedAllocationController.paginationUp();" />
|
||||
|
||||
<separator/>
|
||||
|
||||
<button tooltiptext="Vertical Page up" image="/common/img/ico_up.png" id="verticalPaginationUpButton"
|
||||
onClick="advancedAllocationController.verticalPageup();" disabled="true" />
|
||||
<listbox mold="select" rows="1" visible="false" id="advancedAllocationVerticalPagination">
|
||||
<listitem><listcell label="${i18n:_('Vertical interval')}" /><listcell label="21-40" /><listcell label="40-" /></listitem>
|
||||
</listbox>
|
||||
<button tooltiptext="Vertical Page down" image="/common/img/ico_down.png" id="verticalPaginationDownButton"
|
||||
onClick="advancedAllocationController.verticalPagedown();" disabled="true" />
|
||||
|
||||
<div id="messages" />
|
||||
</hbox>
|
||||
</north>
|
||||
|
|
|
|||
|
|
@ -921,4 +921,9 @@ body .perspectives-column {
|
|||
#timeTracker .second_level_ {
|
||||
border-left: solid 2px #9EB6CE;
|
||||
border-right: solid 2px #9EB6CE;
|
||||
}
|
||||
}
|
||||
|
||||
.advanced-assignment-area .timeTrackedTableWithLeftPane div.z-grid {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue