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.CCPageTitleModel; 39 import com.sun.web.ui.view.pagetitle.CCPageTitle; 40 41 42 public class DescriptorCCPageTitle extends CCPageTitle implements DescriptorContainerView { 43 44 47 public DescriptorCCPageTitle(RequestContext ctx, ContainerView container, String pageName, 48 ViewDescriptor desc, CCPageTitleModel model) 49 { 50 super(container, model, pageName); 51 setRequestContext(ctx); 52 setContainerView(this); 53 setViewDescriptor(desc); 54 registerViewDescriptorChildren(); 55 } 56 57 58 63 public ViewDescriptor getViewDescriptor() { 64 return _viewDesc; 65 } 66 67 68 71 protected void setViewDescriptor(ViewDescriptor desc) { 72 _viewDesc = desc; 73 } 74 75 76 79 public void registerViewDescriptorChildren() { 80 DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this); 81 } 82 83 84 91 public View createChild(String name) { 92 View child = null; 94 try { 95 child = DescriptorViewHelper.createChild(this, name); 96 } catch (ChildNotRegisteredException ex) { 97 child = super.createChild(name); 99 } 100 101 return child; 103 } 104 105 106 109 public RequestContext getRequestContext() { 110 return _reqCtx; 111 } 112 113 114 117 public void setRequestContext(RequestContext context) { 118 _reqCtx = context; 119 } 120 121 122 public void forwardTo(RequestContext requestContext) throws NavigationException { 123 getParentViewBean().forwardTo(requestContext); 124 } 125 126 127 128 132 140 public void beginDisplay(DisplayEvent event) throws ModelControlException { 141 DescriptorViewHelper.beginDisplay(this, event); 142 super.beginDisplay(event); 143 } 144 145 146 public boolean beginChildDisplay(ChildDisplayEvent event) throws ModelControlException { 147 return DescriptorViewHelper.beginChildDisplay(this, event); 148 } 149 150 151 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 152 return DescriptorViewHelper.endChildDisplay(this, event); 153 } 154 155 156 public void endDisplay(DisplayEvent event) { 157 DescriptorViewHelper.endDisplay(this, event); 158 super.endDisplay(event); 159 } 160 161 162 private RequestContext _reqCtx = null; 163 private ViewDescriptor _viewDesc = null; 164 } 165 | Popular Tags |