123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- /****************************************************************************************************************************
- Licensed Materials - Property of IBM
- BI and PM: QFW
- © Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *****************************************************************************************************************************/
- function C_QanEPNode_PropPane( divNodeDetailsContainer )
- {
- this.m_divContainer = divNodeDetailsContainer;
- };
- C_QanEPNode_PropPane.prototype.F_Init = function()
- {
- if (!this.m_divContainer)
- return;
-
- var v_divHeader = this.m_divContainer.document.createElement( "div" );
- v_divHeader.className = "planDetailHeader";
- this.m_divContainer.appendChild( v_divHeader );
-
- var v_tblPropTitles = this.m_divContainer.document.createElement("table");
- v_tblPropTitles.className = "planPropTable";
- v_tblPropTitles.cellPadding = 0;
- v_tblPropTitles.cellSpacing = 0;
- v_tblPropTitles.width = "100%";
- v_divHeader.appendChild( v_tblPropTitles );
-
- this.m_trPropTitles = v_tblPropTitles.insertRow();
-
- this.m_divValueContainer = this.m_divContainer.document.createElement( "div" );
- this.m_divValueContainer.className = "planPropValue";
- this.m_divContainer.appendChild( this.m_divValueContainer );
- this.m_divValueContainer.innerText = " <Click on a node to show its properties> ";
- };
- C_QanEPNode_PropPane.prototype.F_SetProperties4Node = function( oPlanNode )
- {
- for( ; this.m_trPropTitles.cells.length > 0; this.m_trPropTitles.deleteCell() );
- if (!oPlanNode)
- return;
- //this.m_sNodeType = oPlanNode.F_GetCommandType();
- this.m_sNodeType = oPlanNode.F_GetOperationName();
- var v_tdType = this.m_trPropTitles.insertCell();
- v_tdType.className = "planNodeType";
- v_tdType.noWrap = "true";
- v_tdType.innerText = (this.m_sNodeType)? this.m_sNodeType: " ";
- var v_oParser = new C_QanParser();
- this.m_aPropName2Value = [];
- if( oPlanNode.F_GetNativeCommand() )
- {
- var v_tdSpacer = this.m_trPropTitles.insertCell();
- v_tdSpacer.innerText = " ";
- v_tdSpacer.width = "3px";
- var v_tdProp = this.m_trPropTitles.insertCell();
- v_tdProp.innerText = "native";
- // this.m_aPropName2Value["native"] = oPlanNode.F_GetNativeCommand();
- this.m_aPropName2Value["native"] =
- '<div class="formatted">' +
- v_oParser.F_TransformToHTML(
- v_oParser.F_TransformToXML( oPlanNode.F_GetNativeCommand(), this.m_sNodeType ) );
- '</div>';
- v_tdProp.onclick = this.f_title_onclick.F_CreateMethodCallback( this );
- }
-
- if( oPlanNode.F_GetCognosCommand() )
- {
- var v_tdSpacer = this.m_trPropTitles.insertCell();
- v_tdSpacer.innerText = " ";
- v_tdSpacer.width = "3px";
- var v_tdProp = this.m_trPropTitles.insertCell();
- v_tdProp.innerText = "Cognos";
-
- // this.m_aPropName2Value["Cognos"] = oPlanNode.F_GetCognosCommand();
- this.m_aPropName2Value["Cognos"] =
- '<div class="formatted">' +
- v_oParser.F_TransformToHTML(
- v_oParser.F_TransformToXML( oPlanNode.F_GetCognosCommand() ) );
- '</div>';
-
- v_tdProp.onclick = this.f_title_onclick.F_CreateMethodCallback( this );
- }
-
- var v_tdRemainder = this.m_trPropTitles.insertCell();
- v_tdRemainder.width = "100%";
- v_tdRemainder.innerText = " ";
- if( this.m_trPropTitles.children.length > 3 )
- this.f_showPropertyValue( this.m_trPropTitles.children[2], oPlanNode.F_GetName() );
- else
- this.m_divValueContainer.innerHTML = " No properties to show ";
- }
- C_QanEPNode_PropPane.prototype.f_showPropertyValue = function( tdProp, sNodeName )
- {
- var v_sPropName = tdProp.innerText;
-
- tdProp.className = "planActiveProperty";
- for( var i = 2; i < this.m_trPropTitles.children.length - 1; i += 2 )
- if( this.m_trPropTitles.children[i] != tdProp )
- this.m_trPropTitles.children[i].className = "planProperty";
-
- var v_divPropValue;
- var v_sPropKey = sNodeName + v_sPropName;
-
- var v_divChild = this.m_divValueContainer.firstChild;
- if( v_divChild.nodeType == 3 )
- this.m_divValueContainer.removeChild( v_divChild );
-
- for( v_divChild = this.m_divValueContainer.firstChild;
- v_divChild; v_divChild = v_divChild.nextSibling )
- {
- if( v_divChild.property == v_sPropKey )
- v_divPropValue = v_divChild;;
-
- if( !v_divChild.style )
- continue;
- v_divChild.style.display = "none";
- }
-
-
- if( !v_divPropValue )
- {
- var v_divPropValue = this.m_divContainer.document.createElement( "div" );
- this.m_divValueContainer.appendChild( v_divPropValue );
- v_divPropValue.property = v_sPropKey;
- v_divPropValue.innerHTML = this.m_aPropName2Value[ v_sPropName ];
- }
- else
- v_divPropValue.style.display = "block";
- this.m_divValueContainer.onclick =
- this.f_selectBlockTitle_onclick.F_CreateMethodCallback( this );
- }
- C_QanEPNode_PropPane.prototype.f_title_onclick = function()
- {
- this.f_showPropertyValue( G_QanApp.F_GetLoggingView().event.srcElement );
- }
- C_QanEPNode_PropPane.prototype.f_selectBlockTitle_onclick = function()
- {
- G_QanPrettyPrint.F_OnClick( G_QanApp.F_GetLoggingView().event.srcElement, null, this.m_sNodeType );
- }
|