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.ContainerView; 31 import com.iplanet.jato.view.View; 32 import com.iplanet.jato.view.event.ChildDisplayEvent; 33 import com.iplanet.jato.view.event.ChildContentDisplayEvent; 34 import com.iplanet.jato.view.event.DisplayEvent; 35 36 import com.sun.enterprise.tools.guiframework.exception.ChildNotRegisteredException; 37 import com.sun.enterprise.tools.guiframework.exception.FrameworkException; 38 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 39 40 import com.sun.web.ui.model.CCActionTableModel; 41 import com.sun.web.ui.view.table.CCActionTable; 42 43 44 public class DescriptorCCActionTableTiledView extends DescriptorTiledView { 45 46 49 public DescriptorCCActionTableTiledView(RequestContext ctx, ContainerView container, String name, ViewDescriptor desc, Model model) { 50 super(ctx, container, name, desc); 51 setDefaultModel(model); } 53 54 55 62 public View createChild(String name) { 63 View child = null; 64 try { 65 child = DescriptorViewHelper.createChild(this, name); 67 } catch (ChildNotRegisteredException ex) { 68 View parent = getParent(); 70 while ((parent != null) && !(parent instanceof CCActionTable)) { 71 parent = parent.getParent(); 72 } 73 if (parent == null) { 74 throw new FrameworkException("Unable to create child '"+name+ 75 "'.", ex, getViewDescriptor().getChildDescriptor(name), this); 76 } 77 child = ((ContainerView)parent).getChild(name); 78 } 79 80 return child; 82 } 83 84 85 89 92 public boolean beginChildDisplay(ChildDisplayEvent event) throws ModelControlException { 93 if (getViewDescriptor().getChildDescriptor(event.getChildName()) == null) { 94 return DescriptorViewHelper.beginChildDisplay( 99 ((DescriptorContainerView)getParent()), event); 100 } 101 return DescriptorViewHelper.beginChildDisplay(this, event); 102 } 103 104 105 108 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 109 if (getViewDescriptor().getChildDescriptor(event.getChildName()) == null) { 110 return DescriptorViewHelper.endChildDisplay( 115 ((DescriptorContainerView)getParent()), event); 116 } 117 return DescriptorViewHelper.endChildDisplay(this, event); 118 } 119 } 120 | Popular Tags |