application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/selection/ChartSelection.java [73:132]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
			this.rangeFilter = null;
			// If the range filter isn't present, the selection will be the entire row
			this.selectedRowsItems = selectedItems;
		}
	}

	/*
	 * This is the same implementation as RangedChartSelection, could break out to abstract super
	 * class, but waiting with that to make review easier.
	 */
	@Override
	public Stream<IItemStreamFlavor> getFlavors(
		IItemFilter dstFilter, IItemCollection items, List<IAttribute<?>> dstAttributes) {
		IItemCollection dstItems = ItemCollectionToolkit.filterIfNotNull(items, dstFilter);
		boolean itemsApplicableOnPage = ItemCollectionToolkit.filterIfNotNull(selectedRowsItems, dstFilter).hasItems();
		Builder<IItemStreamFlavor> builder = Stream.builder();
		Predicate<IAttribute<?>> includeAttributes = a -> true;

		IItemStreamFlavor selectedItemsFlavor = IItemStreamFlavor.build(MessageFormat
				.format(Messages.FLAVOR_SELECTED_EVENTS, ItemCollectionToolkit.getDescription(selectedRowsItems)),
				selectedRowsItems);

		if (rangeFilter != null) {
			IPropertyFlavor selectedRangeFlavor = buildRange(MessageFormat.format(Messages.FLAVOR_SELECTED_RANGE,
					IPropertyFlavor.getIntervalDescription(xAttribute, range)), items);

			if (!itemsApplicableOnPage) {
				// prio1: Selected range
				builder.accept(selectedRangeFlavor);
			}
			if (selectedRowsItems.hasItems()) {
				// prio1/2: All selected items
				builder.accept(selectedItemsFlavor);
				selectedItemsFlavor = null;
			}
			if (itemsApplicableOnPage) {
				// prio2: Selected range
				builder.accept(selectedRangeFlavor);
			}

			// Skip the x attribute, plus skip start time and end time if the x attribute is life time (more likely in the ranged chart case)
			includeAttributes = a -> !a.equals(xAttribute) && !(xAttribute.equals(JfrAttributes.LIFETIME)
					&& (a.equals(JfrAttributes.START_TIME) || a.equals(JfrAttributes.END_TIME)));

		} else if (selectedRowsItems.hasItems()) {
			if (itemsApplicableOnPage) {
				// prio1/2: All selected items
				builder.accept(selectedItemsFlavor);
				selectedItemsFlavor = null;
			}
		}

		// prio3: Destination items with properties shared with the selected items
		JfrPropertySheet
				.calculatePersistableFilterFlavors(selectedRowsItems, dstItems, items, dstAttributes, includeAttributes)
				.forEach(builder::accept);
		if (selectedItemsFlavor != null) {
			builder.accept(selectedItemsFlavor);
		}
		return builder.build();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/selection/RangedChartSelection.java [72:134]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
			this.rangeFilter = null;
			// If the range filter isn't present, the selection will be the entire row
			this.selectedRowsItems = selectedItems;
		}
	}

	/*
	 * This is the same implementation as ChartSelection, could break out to abstract super class,
	 * but waiting with that to make review easier.
	 */
	@Override
	public Stream<IItemStreamFlavor> getFlavors(
		IItemFilter dstFilter, IItemCollection items, List<IAttribute<?>> dstAttributes) {
		IItemCollection dstItems = ItemCollectionToolkit.filterIfNotNull(items, dstFilter);
		boolean itemsApplicableOnPage = ItemCollectionToolkit.filterIfNotNull(selectedRowsItems, dstFilter).hasItems();
		Builder<IItemStreamFlavor> builder = Stream.builder();
		Predicate<IAttribute<?>> includeAttributes = a -> true;

		IItemStreamFlavor selectedItemsFlavor = IItemStreamFlavor.build(MessageFormat
				.format(Messages.FLAVOR_SELECTED_EVENTS, ItemCollectionToolkit.getDescription(selectedRowsItems)),
				selectedRowsItems);

		if (rangeFilter != null) {
			IPropertyFlavor selectedRangeFlavor = buildRange(MessageFormat.format(Messages.FLAVOR_SELECTED_RANGE,
					IPropertyFlavor.getIntervalDescription(xAttribute, range)), items);

			if (!itemsApplicableOnPage) {
				// prio1: Selected range
				builder.accept(selectedRangeFlavor);
			}
			if (selectedRowsItems.hasItems()) {
				// prio1/2: All selected items
				builder.accept(selectedItemsFlavor);
				selectedItemsFlavor = null;
			}
			if (itemsApplicableOnPage) {
				// prio2: Selected range
				builder.accept(selectedRangeFlavor);
			}

			/*
			 * Skip the x attribute, plus skip start time and end time if the x attribute is life
			 * time (more likely in the ranged chart case)
			 */
			includeAttributes = a -> !a.equals(xAttribute) && !(xAttribute.equals(JfrAttributes.LIFETIME)
					&& (a.equals(JfrAttributes.START_TIME) || a.equals(JfrAttributes.END_TIME)));

		} else if (selectedRowsItems.hasItems()) {
			if (itemsApplicableOnPage) {
				// prio1/2: All selected items
				builder.accept(selectedItemsFlavor);
				selectedItemsFlavor = null;
			}
		}

		// prio3: Destination items with properties shared with the selected items
		JfrPropertySheet
				.calculatePersistableFilterFlavors(selectedRowsItems, dstItems, items, dstAttributes, includeAttributes)
				.forEach(builder::accept);
		if (selectedItemsFlavor != null) {
			builder.accept(selectedItemsFlavor);
		}
		return builder.build();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



