src/sap.ui.support/src/sap/ui/support/supportRules/ui/models/PresetsUtils.js
function (aSelectedRulesPlain) {
			// if we persist settings - load any selection presets, else use the default ones
			if (this.model.getProperty("/persistingSettings")) {
				var aPersistedPresets = Storage.getSelectionPresets();
				if (aPersistedPresets) {
					this.model.setProperty("/selectionPresets", aPersistedPresets);
				}
			}

			var aPresets = this.model.getProperty("/selectionPresets"),
				iLastSystemPresetPosition = 0;

			// add System Presets to Rule Presets Popover
			this.getSystemPresets().forEach(function (oSystemPreset) {
				var isFound = aPresets.some(function (oPreset) {
					if (oSystemPreset.id === oPreset.id) {
						if (!oPreset.isModified) {
							var bIsSelected = oPreset.selected;
							oPreset = jQuery.extend({}, oSystemPreset);
							oPreset.selected = bIsSelected;
							if (bIsSelected) {
								SelectionUtils.setSelectedRules(oPreset.selections);
							}
						}
						return true;
					}
				});

				if (!isFound) {
					var mSystemPresetConfig = {
						disableDelete: true,
						isSystemPreset: true
					};
					aPresets.splice(iLastSystemPresetPosition + 1, 0, jQuery.extend(mSystemPresetConfig, oSystemPreset));
				}

				iLastSystemPresetPosition++;
			});

			// find the selected preset
			var oSelectedPreset = null;
			aPresets.some(function (oCurrent) {
				if (oCurrent.selected) {
					oSelectedPreset = oCurrent;
					return true;
				}
			});

			// sync 'My Selections' with current selections
			if (oSelectedPreset.isMySelection) {
				oSelectedPreset.selections = aSelectedRulesPlain;
			}

			// need to init the current preset
			this.model.setProperty("/selectionPresetsCurrent", oSelectedPreset);
		}
function (aSelectedRulesPlain) {
			// if we persist settings - load any selection presets, else use the default ones
			if (this.model.getProperty("/persistingSettings")) {
				var aPersistedPresets = Storage.getSelectionPresets();
				if (aPersistedPresets) {
					this.model.setProperty("/selectionPresets", aPersistedPresets);
				}
			}

			var aPresets = this.model.getProperty("/selectionPresets"),
				iLastSystemPresetPosition = 0;

			// add System Presets to Rule Presets Popover
			this.getSystemPresets().forEach(function (oSystemPreset) {
				var isFound = aPresets.some(function (oPreset) {
					if (oSystemPreset.id === oPreset.id) {
						if (!oPreset.isModified) {
							var bIsSelected = oPreset.selected;
							oPreset = jQuery.extend({}, oSystemPreset);
							oPreset.selected = bIsSelected;
							if (bIsSelected) {
								SelectionUtils.setSelectedRules(oPreset.selections);
							}
						}
						return true;
					}
				});

				if (!isFound) {
					var mSystemPresetConfig = {
						disableDelete: true,
						isSystemPreset: true
					};
					aPresets.splice(iLastSystemPresetPosition + 1, 0, jQuery.extend(mSystemPresetConfig, oSystemPreset));
				}

				iLastSystemPresetPosition++;
			});

			// find the selected preset
			var oSelectedPreset = null;
			aPresets.some(function (oCurrent) {
				if (oCurrent.selected) {
					oSelectedPreset = oCurrent;
					return true;
				}
			});

			// sync 'My Selections' with current selections
			if (oSelectedPreset.isMySelection) {
				oSelectedPreset.selections = aSelectedRulesPlain;
			}

			// need to init the current preset
			this.model.setProperty("/selectionPresetsCurrent", oSelectedPreset);
		}
function ( aSelectedRulesPlain ) { // if we persist settings - load any selection presets, else use the default ones if ( this . model . getProperty ( "/persistingSettings" ) ) { var aPersistedPresets = Storage . getSelectionPresets ( ) ; if ( aPersistedPresets ) { this . model . setProperty ( "/selectionPresets" , aPersistedPresets ) ; } } var aPresets = this . model . getProperty ( "/selectionPresets" ) , iLastSystemPresetPosition = 0 ; // add System Presets to Rule Presets Popover this . getSystemPresets ( ) . forEach ( function ( oSystemPreset ) { var isFound = aPresets . some ( function ( oPreset ) { if ( oSystemPreset . id === oPreset . id ) { if ( ! oPreset . isModified ) { var bIsSelected = oPreset . selected ; oPreset = jQuery . extend ( { } , oSystemPreset ) ; oPreset . selected = bIsSelected ; if ( bIsSelected ) { SelectionUtils . setSelectedRules ( oPreset . selections ) ; } } return true ; } } ) ; if ( ! isFound ) { var mSystemPresetConfig = { disableDelete : true , isSystemPreset : true } ; aPresets . splice ( iLastSystemPresetPosition + 1 , 0 , jQuery . extend ( mSystemPresetConfig , oSystemPreset ) ) ; } iLastSystemPresetPosition ++ ; } ) ; // find the selected preset var oSelectedPreset = null ; aPresets . some ( function ( oCurrent ) { if ( oCurrent . selected ) { oSelectedPreset = oCurrent ; return true ; } } ) ; // sync 'My Selections' with current selections if ( oSelectedPreset . isMySelection ) { oSelectedPreset . selections = aSelectedRulesPlain ; } // need to init the current preset this . model . setProperty ( "/selectionPresetsCurrent" , oSelectedPreset ) ; }
Initializes the current selection preset
@param {Array} aSelectedRulesPlain The plain list of selected rules (same format as in the presets json file)
Initializes the current selection preset