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