1 23 24 package com.sun.enterprise.tools.guiframework.view; 25 26 import com.iplanet.jato.RequestContext; 27 import com.iplanet.jato.view.ViewBean; 28 import com.iplanet.jato.view.event.RequestInvocationEvent; 29 30 import com.sun.enterprise.tools.guiframework.exception.FrameworkException; 31 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 32 import com.sun.enterprise.tools.guiframework.view.descriptors.CCTabsDescriptor; 33 34 import com.sun.web.ui.view.tabs.CCNodeEventHandlerInterface; 35 36 import java.util.Iterator ; 37 38 39 public class CCNodeEventHandlerViewBeanBase extends DescriptorViewBeanBase implements CCNodeEventHandlerInterface { 40 43 public CCNodeEventHandlerViewBeanBase(RequestContext context, String pageName, ViewDescriptor desc) { 44 super(context, pageName, desc); 45 } 46 47 48 58 public void nodeClicked(RequestInvocationEvent event, int nodeID) { 59 CCTabsDescriptor tabDesc = 61 (CCTabsDescriptor)getViewDescriptor().getChildDescriptor("Tabs"); 62 63 if (tabDesc == null) { 65 Iterator it = getViewDescriptor().getChildDescriptors().iterator(); 68 ViewDescriptor desc = null; 69 while (it.hasNext()) { 70 desc = (ViewDescriptor)it.next(); 71 if (desc instanceof CCTabsDescriptor) { 72 tabDesc = (CCTabsDescriptor)desc; 73 break; 74 } 75 } 76 } 77 78 if (tabDesc == null) { 80 throw new FrameworkException("No tabs defined for this page: "+ 82 getName(), getViewDescriptor(), this); 83 } 84 85 String viewBeanName = tabDesc.getViewBean(getRequestContext(), nodeID); 87 if (viewBeanName != null) { 88 ViewBean next = getViewBean(viewBeanName); 89 next.forwardTo(getRequestContext()); 90 return; 91 } else { 92 throw new FrameworkException("No nextPage defined for tab: "+ 94 tabDesc.getName(), getViewDescriptor(), this); 95 } 96 } 97 } 98 | Popular Tags |