1 23 24 29 30 package com.sun.enterprise.tools.guiframework.view; 31 32 import com.iplanet.jato.NavigationException; 33 import com.iplanet.jato.RequestContext; 34 import com.iplanet.jato.model.ModelControlException; 35 import com.iplanet.jato.view.ContainerView; 36 import com.iplanet.jato.view.View; 37 import com.iplanet.jato.view.event.ChildDisplayEvent; 38 import com.iplanet.jato.view.event.ChildContentDisplayEvent; 39 import com.iplanet.jato.view.event.DisplayEvent; 40 import com.iplanet.jato.view.ViewBeanBase; 41 42 import com.sun.enterprise.tools.guiframework.exception.ChildNotRegisteredException; 43 import com.sun.enterprise.tools.guiframework.exception.FrameworkException; 44 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 45 46 import com.sun.web.ui.view.tree.CCDynamicTree; 47 import com.sun.web.ui.view.tree.CCTreeEventHandlerInterface; 48 import com.sun.web.ui.model.CCTreeModelInterface ; 49 50 54 public class DescriptorCCDynamicTree extends CCDynamicTree implements DescriptorContainerView { 55 56 57 public DescriptorCCDynamicTree(RequestContext ctx, ContainerView container, String pageName, 58 ViewDescriptor desc, CCTreeModelInterface model) { 59 60 super(container, pageName, model ); 61 setRequestContext(ctx); 63 setViewDescriptor(desc); 65 registerViewDescriptorChildren(); 66 } 67 68 69 74 public ViewDescriptor getViewDescriptor() { 75 return _viewDesc; 76 } 77 78 79 82 protected void setViewDescriptor(ViewDescriptor desc) { 83 _viewDesc = desc; 84 } 85 86 87 90 public void registerViewDescriptorChildren() { 91 DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this); 92 } 93 94 95 96 103 public View createChild(String name) { 104 View child = null; 105 try { 106 child = DescriptorViewHelper.createChild(this, name); 108 } catch (ChildNotRegisteredException ex) { 109 child = super.createChild(name); 111 } catch (ChildNullException ex) { 112 try { 114 child = super.createChild(name); 115 if (child == null) { 116 throw ex; 117 } 118 } catch (Exception ex2) { 119 throw ex; 122 } 123 } 124 125 return child; 127 } 128 129 132 public RequestContext getRequestContext() { 133 return _reqCtx; 134 } 135 136 137 140 public void setRequestContext(RequestContext context) { 141 _reqCtx = context; 142 } 143 144 145 public void forwardTo(RequestContext requestContext) throws NavigationException { 146 getParentViewBean().forwardTo(requestContext); 147 } 148 149 150 151 155 163 public void beginDisplay(DisplayEvent event) throws ModelControlException { 164 DescriptorViewHelper.beginDisplay(this, event); 165 super.beginDisplay(event); 166 } 167 168 169 public boolean beginChildDisplay(ChildDisplayEvent event) throws ModelControlException { 170 return DescriptorViewHelper.beginChildDisplay(this, event); 171 } 172 173 174 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 175 return DescriptorViewHelper.endChildDisplay(this, event); 176 } 177 178 179 public void endDisplay(DisplayEvent event) { 180 DescriptorViewHelper.endDisplay(this, event); 181 super.endDisplay(event); 182 } 183 184 185 private RequestContext _reqCtx = null; 186 private ViewDescriptor _viewDesc = null; 187 188 } 189 | Popular Tags |