318 IMemberAccessor<?, IItem> accessor = ItemToolkit.accessor(a);
319 // FIXME: This is duplicated in JfrPropertySheet, where we also create a tooltip for an attribute.
320 itemListBuilder.addColumn(combinedId, a.getName(),
321 NLS.bind(Messages.ATTRIBUTE_ID_LABEL, a.getIdentifier()) + System.getProperty("line.separator") //$NON-NLS-1$
322 + NLS.bind(Messages.ATTRIBUTE_DESCRIPTION_LABEL, a.getDescription()),
323 contentType instanceof LinearKindOfQuantity, accessor);
324 if (combinedId.equals(listOrderBy)) {
325 // the list now has the most current order, to allow the list to clear it
326 listOrderBy = null;
327 }
328 if (!existingColumnIds.contains(combinedId)) {
329 newColumns.add(0, new ColumnSettings(combinedId, false, null, null));
330 }
331 });
332 listColumns.addAll(0, newColumns);
333
334 Control oldListControl = list.getManager().getViewer().getControl();
335 Composite parent = oldListControl.getParent();
336 oldListControl.dispose();
337 list = DataPageToolkit.createSimpleItemList(parent, itemListBuilder, container,
338 new TableSettings(orderBy, listColumns), Messages.EventBrowserPage_EVENT_BROWSER_SELECTION);
339 parent.layout();
340 list.show(filteredItems);
341 }
342
343 private void mergeListSettings() {
344 TableSettings settings = list.getManager().getSettings();
345 Set<String> columns = settings.getColumns().stream().map(ColumnSettings::getId).collect(Collectors.toSet());
346 List<Integer> replaceIndexs = new ArrayList<>(columns.size());
347 for (int i = 0; i < listColumns.size(); i++) {
348 if (columns.contains(listColumns.get(i).getId())) {
349 replaceIndexs.add(i);
350 }
351 }
352 Iterator<ColumnSettings> replacements = settings.getColumns().iterator();
353 Iterator<Integer> indexs = replaceIndexs.iterator();
354 while (indexs.hasNext() && replacements.hasNext()) {
355 listColumns.set(indexs.next(), replacements.next());
356 }
357 if (settings.getOrderBy() != null) {
358 listOrderBy = settings.getOrderBy();
|
318 IMemberAccessor<?, IItem> accessor = ItemToolkit.accessor(a);
319 // FIXME: This is duplicated in JfrPropertySheet, where we also create a tooltip for an attribute.
320 itemListBuilder.addColumn(combinedId, a.getName(),
321 NLS.bind(Messages.ATTRIBUTE_ID_LABEL, a.getIdentifier()) + System.getProperty("line.separator") //$NON-NLS-1$
322 + NLS.bind(Messages.ATTRIBUTE_DESCRIPTION_LABEL, a.getDescription()),
323 contentType instanceof LinearKindOfQuantity, accessor);
324 if (combinedId.equals(listOrderBy)) {
325 // the list now has the most current order, to allow the list to clear it
326 listOrderBy = null;
327 }
328 if (!existingColumnIds.contains(combinedId)) {
329 newColumns.add(0, new ColumnSettings(combinedId, false, null, null));
330 }
331 });
332 listColumns.addAll(0, newColumns);
333
334 Control oldListControl = list.getManager().getViewer().getControl();
335 Composite parent = oldListControl.getParent();
336 oldListControl.dispose();
337 list = DataPageToolkit.createSimpleItemList(parent, itemListBuilder, container,
338 DataPageToolkit.createTableSettingsByOrderByAndColumnsWithDefaultOrdering(orderBy, listColumns),
339 Messages.EventBrowserPage_EVENT_BROWSER_SELECTION);
340 parent.layout();
341 list.show(filteredItems);
342 }
343
344 private void mergeListSettings() {
345 TableSettings settings = list.getManager().getSettings();
346 Set<String> columns = settings.getColumns().stream().map(ColumnSettings::getId).collect(Collectors.toSet());
347 List<Integer> replaceIndexs = new ArrayList<>(columns.size());
348 for (int i = 0; i < listColumns.size(); i++) {
349 if (columns.contains(listColumns.get(i).getId())) {
350 replaceIndexs.add(i);
351 }
352 }
353 Iterator<ColumnSettings> replacements = settings.getColumns().iterator();
354 Iterator<Integer> indexs = replaceIndexs.iterator();
355 while (indexs.hasNext() && replacements.hasNext()) {
356 listColumns.set(indexs.next(), replacements.next());
357 }
358 if (settings.getOrderBy() != null) {
359 listOrderBy = settings.getOrderBy();
|