private SectionStack buildAvailableItemsStack() {
SectionStack availableSectionStack = new SectionStack();
availableSectionStack.setWidth("*");
availableSectionStack.setHeight100();
SectionStackSection availableSection = new SectionStackSection(getAvailableItemsGridTitle());
availableSection.setCanCollapse(false);
availableSection.setExpanded(true);
// Drag'n'Drop Settings
this.availableGrid.setCanReorderRecords(true);
this.availableGrid.setCanDragRecordsOut(true);
this.availableGrid.setDragDataAction(DragDataAction.MOVE);
if (getItemIcon() != null) {
this.availableGrid.setDragTrackerMode(DragTrackerMode.ICON);
this.availableGrid.setTrackerImage(new ImgProperties(getItemIcon(), 16, 16));
}
this.availableGrid.setCanAcceptDroppedRecords(true);
this.availableGrid.setLoadingMessage(MSG.common_msg_loading());
this.availableGrid.setEmptyMessage(MSG.common_msg_noItemsToShow());
List<ListGridField> availableFields = new ArrayList<ListGridField>();
String itemIcon = getItemIcon();
if (itemIcon != null) {
ListGridField iconField = new ListGridField("icon", 25);
iconField.setType(ListGridFieldType.ICON);
iconField.setCellIcon(itemIcon);
iconField.setShowDefaultContextMenu(false);
availableFields.add(iconField);
}
ListGridField nameField = new ListGridField(getNameField(), MSG.common_title_name());
if (supportsNameHoverCustomizer()) {
nameField.setShowHover(true);
nameField.setHoverCustomizer(getNameHoverCustomizer());
}
availableFields.add(nameField);
this.availableGrid.setFields(availableFields.toArray(new ListGridField[availableFields.size()]));
availableSection.setItems(this.availableGrid);
availableSectionStack.addSection(availableSection);
this.datasource = getDataSource();
this.datasource.setDataPageSize(getMaxAvailableRecords());
// Load data.