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.Model; 29 import com.iplanet.jato.model.ModelControlException; 30 import com.iplanet.jato.view.RequestHandlingViewBase; 31 import com.iplanet.jato.view.ContainerView; 32 import com.iplanet.jato.view.View; 33 import com.iplanet.jato.view.event.ChildDisplayEvent; 34 import com.iplanet.jato.view.event.ChildContentDisplayEvent; 35 import com.iplanet.jato.view.event.DisplayEvent; 36 37 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 38 39 40 public class DescriptorRequestHandlingViewBase extends RequestHandlingViewBase implements DescriptorContainerView { 41 42 45 public DescriptorRequestHandlingViewBase(RequestContext ctx, ContainerView container, String name, ViewDescriptor desc) { 46 this(ctx, container, name, desc, null); 47 } 48 49 53 public DescriptorRequestHandlingViewBase(RequestContext ctx, ContainerView container, String name, ViewDescriptor desc, Model model) { 54 super(container, name); 55 setRequestContext(ctx); 56 setViewDescriptor(desc); 57 if (model != null) { 58 setDefaultModel(model); 59 } 60 registerViewDescriptorChildren(); 61 } 62 63 64 69 public ViewDescriptor getViewDescriptor() { 70 return _viewDesc; 71 } 72 73 74 77 protected void setViewDescriptor(ViewDescriptor desc) { 78 _viewDesc = desc; 79 } 80 81 82 85 public void registerViewDescriptorChildren() { 86 DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this); 87 } 88 89 90 97 public View createChild(String name) { 98 return DescriptorViewHelper.createChild(this, name); 100 } 101 102 103 106 public RequestContext getRequestContext() { 107 return _reqCtx; 108 } 109 110 111 114 public void setRequestContext(RequestContext context) { 115 _reqCtx = context; 116 } 117 118 119 public void forwardTo(RequestContext requestContext) throws NavigationException { 120 getParentViewBean().forwardTo(requestContext); 121 } 122 123 124 125 129 137 public void beginDisplay(DisplayEvent event) throws ModelControlException { 138 DescriptorViewHelper.beginDisplay(this, event); 139 super.beginDisplay(event); 140 } 141 142 143 public boolean beginChildDisplay(ChildDisplayEvent event) throws ModelControlException { 144 return DescriptorViewHelper.beginChildDisplay(this, event); 145 } 146 147 148 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 149 return DescriptorViewHelper.endChildDisplay(this, event); 150 } 151 152 153 public void endDisplay(DisplayEvent event) { 154 DescriptorViewHelper.endDisplay(this, event); 155 super.endDisplay(event); 156 } 157 158 159 private RequestContext _reqCtx = null; 160 private ViewDescriptor _viewDesc = null; 161 } 162 | Popular Tags |