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.model.*; 32 import com.iplanet.jato.view.DisplayField; 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.exception.ChildNotRegisteredException; 38 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 39 40 import com.sun.web.ui.model.CCAddRemoveModelInterface; 41 import com.sun.web.ui.view.addremove.CCAddRemove; 42 import javax.servlet.http.*; 43 44 public class DescriptorCCAddRemove extends CCAddRemove implements DescriptorContainerView { 45 46 49 public DescriptorCCAddRemove(RequestContext ctx, ContainerView container, 50 String pageName, ViewDescriptor desc, CCAddRemoveModelInterface model) 51 { 52 super(container, model, pageName); 53 setDefaultModel((Model)model); 55 setRequestContext(ctx); 56 setViewDescriptor(desc); 57 registerViewDescriptorChildren(); 58 } 59 60 65 public ViewDescriptor getViewDescriptor() { 66 return _viewDesc; 67 } 68 69 72 protected void setViewDescriptor(ViewDescriptor desc) { 73 _viewDesc = desc; 74 } 75 76 79 public void registerViewDescriptorChildren() { 80 DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this); 81 } 82 83 90 public View createChild(String name) { 91 View child = null; 93 try { 94 child = DescriptorViewHelper.createChild(this, name); 95 } catch (ChildNotRegisteredException ex) { 96 child = super.createChild(name); 98 } 99 100 return child; 102 } 103 104 107 public RequestContext getRequestContext() { 108 return _reqCtx; 109 } 110 111 114 public void setRequestContext(RequestContext context) { 115 _reqCtx = context; 116 } 117 118 public void forwardTo(RequestContext requestContext) throws NavigationException { 119 getParentViewBean().forwardTo(requestContext); 120 } 121 122 126 134 public void beginDisplay(DisplayEvent event) throws ModelControlException { 135 DescriptorViewHelper.beginDisplay(this, event); 136 super.beginDisplay(event); 137 } 138 139 public boolean beginChildDisplay(ChildDisplayEvent event) throws ModelControlException { 140 return DescriptorViewHelper.beginChildDisplay(this, event); 141 } 142 143 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 144 return DescriptorViewHelper.endChildDisplay(this, event); 145 } 146 147 public void endDisplay(DisplayEvent event) { 148 DescriptorViewHelper.endDisplay(this, event); 149 super.endDisplay(event); 150 } 151 152 private RequestContext _reqCtx = null; 153 private ViewDescriptor _viewDesc = null; 154 } 155 | Popular Tags |