1 23 24 package com.sun.enterprise.tools.admingui.view; 25 26 import com.iplanet.jato.RequestContext; 27 import com.iplanet.jato.NavigationException; 28 import com.iplanet.jato.model.ModelControlException; 29 import com.iplanet.jato.command.Command; 30 import com.iplanet.jato.command.CommandEvent; 31 import com.iplanet.jato.command.CommandException; 32 import com.iplanet.jato.view.View; 33 import com.iplanet.jato.view.event.ChildContentDisplayEvent; 34 import com.iplanet.jato.view.event.ChildDisplayEvent; 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.exception.FrameworkException; 39 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor; 40 import com.sun.enterprise.tools.guiframework.view.DescriptorContainerView; 41 import com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper; 42 43 import com.sun.web.ui.servlet.help2.MastheadViewBean; 44 45 46 49 public class DescriptorCCHelp2MastheadViewBean extends MastheadViewBean implements DescriptorContainerView, Command { 50 51 58 public DescriptorCCHelp2MastheadViewBean(RequestContext ctx, String name, ViewDescriptor desc) { 59 super(); 60 setRequestContext(ctx); 61 setName(name); 62 setViewDescriptor(desc); 63 registerViewDescriptorChildren(); 64 } 65 66 67 68 72 82 public void execute(CommandEvent event) throws CommandException { 83 DescriptorViewHelper.execute( 84 getRequestContext(), (View)event.getSource(), event); 85 } 86 87 88 89 93 96 protected void setViewDescriptor(ViewDescriptor desc) { 97 _viewDesc = desc; 98 } 99 100 101 106 public ViewDescriptor getViewDescriptor() { 107 return _viewDesc; 108 } 109 110 111 public View createChild(String name) { 112 View child = null; 113 try { 114 child = DescriptorViewHelper.createChild(this, name); 116 } catch (ChildNotRegisteredException ex) { 117 child = super.createChild(name); 119 } 120 121 return child; 123 } 124 125 126 129 public void forwardTo(RequestContext requestContext) throws NavigationException { 130 super.forwardTo(requestContext); 131 } 132 133 134 135 139 147 public void beginDisplay(DisplayEvent event) throws ModelControlException { 148 DescriptorViewHelper.beginDisplay(this, event); 149 super.beginDisplay(event); 150 } 151 152 153 157 public boolean beginChildDisplay(ChildDisplayEvent event) { 158 try { 159 return DescriptorViewHelper.beginChildDisplay(this, event); 160 } catch (Exception ex) { 161 throw new FrameworkException(ex, getViewDescriptor(), this); 162 } 163 } 164 165 166 170 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 171 return DescriptorViewHelper.endChildDisplay(this, event); 172 } 173 174 175 179 public void endDisplay(DisplayEvent event) { 180 DescriptorViewHelper.endDisplay(this, event); 181 super.endDisplay(event); 182 } 183 184 185 203 public void registerViewDescriptorChildren() { 204 DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this); 205 } 206 207 208 private ViewDescriptor _viewDesc = null; 209 } 210 | Popular Tags |