ViewOriginalLabelAction.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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 ViewOriginalLabelAction() {}
  13. ViewOriginalLabelAction.prototype = new CognosViewerAction();
  14. ViewOriginalLabelAction.prototype.getCellRef = function() {
  15. return this.m_oCV.getSelectionController().getSelections()[0].getCellRef();
  16. };
  17. ViewOriginalLabelAction.prototype.updateMenu = function(jsonSpec) {
  18. if (this.getNumberOfSelections() == 1)
  19. {
  20. var selRef = this.getCellRef();
  21. if (selRef.getAttribute("rp_name"))
  22. {
  23. var menuItems = [];
  24. menuItems.push({ name: "originalLabel", label: selRef.getAttribute("rp_name"), iconClass: "", action: null, items: null });
  25. jsonSpec.items = menuItems;
  26. return jsonSpec;
  27. }
  28. }
  29. return "";
  30. };