'use strict'; /** * Licensed Materials - Property of IBM * * IBM Cognos Products: BI Cloud * * (C) Copyright IBM Corp. 2014, 2017 * * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['../../lib/@waca/core-client/js/core-client/ui/core/Events'], function (Events) { var SelectionModel = null; /** * This class provides Selection Model (API). */ SelectionModel = Events.extend({ _bSelectionModeOn: false, init: function init() { SelectionModel.inherited('init', this, arguments); }, inSelectionMode: function inSelectionMode() { return this._bSelectionModeOn; }, /** * Usually invoked by user gesture handler on data view * * This fires SelectionModeOn event. * Usually a controller listens it and invokes contextbar.show */ turnOnSelectionMode: function turnOnSelectionMode(event) { this._bSelectionModeOn = true; this.trigger('selectionMode:ON', { 'payload': event }); }, /** * Usually invoked by user gesture handler on data view * * This fires SelectionModeOn event. * Usually a controller listens it and invokes contextbar.hide */ turnOffSelectionMode: function turnOffSelectionMode(event) { this._bSelectionModeOn = false; this.trigger('selectionMode:OFF', { 'payload': event }); }, /** * Usually invoked by controller * i.e) user clicks close button on context bar */ stopSelectionMode: function stopSelectionMode() { this._bSelectionModeOn = false; this.unselectAll(); }, /** * Usually invoked by controller * i.e) user clicks multi-select button on context bar */ startSelectionMode: function startSelectionMode() { this._bSelectionModeOn = true; this.unselectAll(); }, /* * abstracts functions */ getSelections: function getSelections() { return []; }, unselectAll: function unselectAll() { return; } }); return SelectionModel; }); //# sourceMappingURL=SelectionModel.js.map