You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2007/06/22 01:30:15 UTC

svn commit: r549663 - /incubator/xap/trunk/codebase/src/xap/taghandling/AbstractTagImpl.js

Author: jmargaris
Date: Thu Jun 21 18:30:14 2007
New Revision: 549663

URL: http://svn.apache.org/viewvc?view=rev&rev=549663
Log:
Removed commented out addInvokerInfo code and added a TODO in its place.

Modified:
    incubator/xap/trunk/codebase/src/xap/taghandling/AbstractTagImpl.js

Modified: incubator/xap/trunk/codebase/src/xap/taghandling/AbstractTagImpl.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/taghandling/AbstractTagImpl.js?view=diff&rev=549663&r1=549662&r2=549663
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/taghandling/AbstractTagImpl.js (original)
+++ incubator/xap/trunk/codebase/src/xap/taghandling/AbstractTagImpl.js Thu Jun 21 18:30:14 2007
@@ -407,78 +407,15 @@
 	
 	
 	
-	//addInvokerInfo(clientEvent,eventElement);
+	//TODO move onCommand code from MenuItemBridge to here so that we fill in invoker info
+	//for all events that take place in a popup
+	//fillInInvokerInfo()
+	
 	return session.getEventHandler().fireEvent( eventName, eventValue,
 												eventElement,clientEvent );	
 }
 
 
-//	/**
-//	 * If an event like onCommand takes place, it may take place on a menuItem
-//	 * that was inside a popupMenu, and you would like to know what the
-//	 * menu was currently attached to. This does that by
-//	 * adding the "invoker" field with the proper ID.
-//	 * @param event
-//	 * @param sourceComponent
-//	 */
-//	private void addInvokerInfo(ClientEvent event, Element sourceElement){
-//		xap.taghandling.AbstractTagImpl tag = getUiContentHandler().getHandlerForElement(sourceElement);
-//		if (! (tag instanceof AwtComponentBridge)) return;
-//		Component parent = ((AwtComponentBridge)tag).getUiComponent();
-//		
-//		for(;;){
-//			if (parent==null) break;
-//			
-//			if (parent instanceof NPopup){
-//				
-//				//get the reference of the popup, if that doesn't work
-//				//get the actual Component invoker.
-//				Object reference = ((NPopup)parent).getReference();
-//				if (reference==null) reference = ((NPopup)parent).getInvoker();
-//				
-//				//if we found something, see if it has a handler,
-//				//and if so plug in that ID and name.
-//				if (reference!=null){
-//					Element referenceElement = null;
-//					
-//					//in the case of cell there is no mapping of peer
-//					//to to bridge, so the reference is just to the cell 
-//					//element itself
-//					if (reference instanceof Element){
-//						referenceElement = (Element) reference;
-//					}
-//					else{
-//						
-//						//problem: we get the handler for the peer, but this
-//						//could be either <valueComboBox> or the underlying
-//						//<comboBox>. Right now we return than handler for
-//						//comboBox itself. However, the NAME and ID
-//						//of the <comboBox> should be the same as for 
-//						//<valueComboBox>
-//						tag = getUiContentHandler().getHandlerForPeer(reference);
-//						if (tag!=null){
-//							referenceElement = tag.getElement();
-//						}
-//					}
-//					
-//					if (referenceElement!=null){
-//						event.setParameter("invoker",referenceElement.getAttribute("id"));
-//						String name = referenceElement.getAttribute("name");
-//						if (name==null) name = "";	
-//						event.setParameter("invokerName",name);
-//					}	
-//				}
-//			}
-//			if (parent instanceof NPanel){
-//				parent = ((NPanel)parent).getLogicalParent();
-//			}
-//			else{
-//				parent = parent.getParent();
-//			}
-//			
-//		}	
-//	}
-//		
 /**
  * Returns the UiContentHandler. This handler can be used to 
  * look up a tag by element, or an element by tag, as well as to parse