use of com.intellij.util.ui.TableViewModel in project intellij-community by JetBrains.
the class FileHistoryPanelImpl method setupDualView.
private void setupDualView(@NotNull DefaultActionGroup group) {
myDualView.setShowGrid(true);
PopupHandler.installPopupHandler(myDualView.getTreeView(), group, ActionPlaces.UPDATE_POPUP, ActionManager.getInstance());
PopupHandler.installPopupHandler(myDualView.getFlatView(), group, ActionPlaces.UPDATE_POPUP, ActionManager.getInstance());
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
IdeFocusManager.getGlobalInstance().requestFocus(myDualView, true);
});
myDualView.addListSelectionListener(e -> updateMessage());
myDualView.setRootVisible(false);
myDualView.expandAll();
final TreeCellRenderer defaultCellRenderer = myDualView.getTree().getCellRenderer();
final Getter<VcsHistorySession> sessionGetter = () -> myHistorySession;
myDualView.setTreeCellRenderer(new MyTreeCellRenderer(defaultCellRenderer, sessionGetter));
myDualView.setCellWrapper(new MyCellWrapper(sessionGetter));
myDualView.installDoubleClickHandler(new MyDiffAction());
final TableView flatView = myDualView.getFlatView();
TableViewModel sortableModel = flatView.getTableViewModel();
sortableModel.setSortable(true);
final RowSorter<? extends TableModel> rowSorter = flatView.getRowSorter();
if (rowSorter != null) {
rowSorter.setSortKeys(Collections.singletonList(new RowSorter.SortKey(0, SortOrder.DESCENDING)));
}
}
Aggregations