private int getMinTableItemHeight(Table table) { // Hack to get around Linux GTK problem. // On Linux GTK, table items have variable item height as // carriage returns are actually shown in a cell. Some rows will be // taller than others. When calculating number of visible lines, we // need to find the smallest table item height. Otherwise, the rendering // underestimates the number of visible lines. As a result the rendering // will not be able to get more memory as needed. if (MemoryViewUtil.isLinuxGTK()) { // check each of the items and find the minimum TableItem[] items = table.getItems(); int minHeight = table.getItemHeight(); for (int i = 0; i < items.length; i++) { if (items[i].getData() != null) minHeight = Math.min(items[i].getBounds(0).height, minHeight); } return minHeight; } return table.getItemHeight(); }