1 23 24 package com.sun.enterprise.tools.guiframework.view; 25 26 import com.iplanet.jato.NavigationException; 27 import com.iplanet.jato.RequestContext; 28 import com.iplanet.jato.model.ModelControlException; 29 import com.iplanet.jato.view.ContainerView; 30 import com.iplanet.jato.view.View; 31 import com.iplanet.jato.view.event.ChildDisplayEvent; 32 import com.iplanet.jato.view.event.ChildContentDisplayEvent; 33 import com.iplanet.jato.view.event.DisplayEvent; 34 35 import com.sun.enterprise.tools.guiframework.exception.ChildNotRegisteredException; 36 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 37 38 import com.sun.web.ui.model.CCMastheadModelInterface; 39 import com.sun.web.ui.view.masthead.CCPrimaryMasthead; 40 41 42 public class DescriptorCCPrimaryMasthead extends CCPrimaryMasthead implements DescriptorContainerView { 43 44 47 public DescriptorCCPrimaryMasthead(RequestContext ctx, ContainerView container, String name, ViewDescriptor desc, CCMastheadModelInterface model) { 48 super(container, model, name); 49 setDefaultModel(model); 51 setRequestContext(ctx); 52 setViewDescriptor(desc); 53 registerViewDescriptorChildren(); 54 } 55 56 61 public ViewDescriptor getViewDescriptor() { 62 return _viewDesc; 63 } 64 65 68 protected void setViewDescriptor(ViewDescriptor desc) { 69 _viewDesc = desc; 70 } 71 72 75 public void registerViewDescriptorChildren() { 76 DescriptorViewHelper.registerViewDescriptorChildren( 77 getViewDescriptor(), this); 78 } 79 80 87 public View createChild(String name) { 88 View child = null; 90 try { 91 child = DescriptorViewHelper.createChild(this, name); 92 } catch (ChildNotRegisteredException ex) { 93 child = super.createChild(name); 95 } 96 97 return child; 99 } 100 101 104 public RequestContext getRequestContext() { 105 return _reqCtx; 106 } 107 108 111 public void setRequestContext(RequestContext context) { 112 _reqCtx = context; 113 } 114 115 public void forwardTo(RequestContext requestContext) throws NavigationException { 116 getParentViewBean().forwardTo(requestContext); 117 } 118 119 123 131 public void beginDisplay(DisplayEvent event) throws ModelControlException { 132 DescriptorViewHelper.beginDisplay(this, event); 133 super.beginDisplay(event); 134 } 135 136 public boolean beginChildDisplay(ChildDisplayEvent event) throws ModelControlException { 137 return DescriptorViewHelper.beginChildDisplay(this, event); 138 } 139 140 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 141 return DescriptorViewHelper.endChildDisplay(this, event); 142 } 143 144 public void endDisplay(DisplayEvent event) { 145 DescriptorViewHelper.endDisplay(this, event); 146 super.endDisplay(event); 147 } 148 149 private RequestContext _reqCtx = null; 150 private ViewDescriptor _viewDesc = null; 151 } 152 | Popular Tags |