CollapseMemberAction.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2011
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function CollapseMemberAction()
  13. {
  14. this.m_sAction = "ExpandCollapseMember";
  15. this.m_sExpandCollapseType="CollapseMember";
  16. }
  17. CollapseMemberAction.prototype = new ExpandCollapseMemberAction();
  18. CollapseMemberAction.baseclass = ExpandCollapseMemberAction.prototype;
  19. CollapseMemberAction.prototype.getUndoHint = function()
  20. {
  21. return RV_RES.IDS_JS_COLLAPSE_MEMBER;
  22. };
  23. CollapseMemberAction.prototype._canDisableMenu = function(oSectionController)
  24. {
  25. if (this._isSingleSelection(oSectionController) && !this._isExpanded() ) {
  26. return true;
  27. }
  28. return false;
  29. };
  30. CollapseMemberAction.prototype._canEnableMenu = function(oSectionController)
  31. {
  32. var selObj = this._getFirstSelectedObject(oSectionController);
  33. if (this._alwaysCanExpandCollapse(selObj)) {
  34. return true; //Expand/collapse cant be determined for complex sets...enable both items
  35. }
  36. return (this._isSingleSelection(oSectionController) && this._isExpanded(selObj));
  37. };