public void changeSortOrder(Widget sender, int sortOrder) { if (sender instanceof DisplayColumnWidget) { DisplayColumnWidget displayColumnWidget = (DisplayColumnWidget) sender; SortColumnWidget sortWidget = sortColMap.get(displayColumnWidget); if (sortOrder != SortField.SORT_NULL) { if (sortWidget == null) { sortWidget = new SortColumnWidget(sortOrder, this); sortPanel.add(sortWidget); sortColMap.put(displayColumnWidget, sortWidget); dispColMap.put(sortWidget, displayColumnWidget); } else sortWidget.setSortOrder(sortOrder); sortWidget.setText(displayColumnWidget.getText()); } else if (sortPanel.getWidgetIndex(sortWidget) > -1) { sortPanel.remove(sortWidget); dispColMap.remove(sortColMap.remove(displayColumnWidget)); } } else if (sender instanceof SortColumnActionHyperlink) { SortColumnWidget sortWidget = (SortColumnWidget) sender.getParent().getParent(); sortWidget.setSortOrder(sortOrder); dispColMap.get(sortWidget).setSortOrder(sortOrder); } else dispColMap.get((SortColumnWidget) sender).setSortOrder(sortOrder); }
public void changeDisplayText(Widget sender, String text) { DisplayColumnWidget displayColumnWidget = (DisplayColumnWidget) sender; SortColumnWidget sortWidget = sortColMap.get(displayColumnWidget); if (sortWidget != null) sortWidget.setText(text); }