1 23 24 package com.sun.enterprise.tools.guiframework.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 41 import com.sun.web.ui.model.wizard.WizardInterface; 42 import com.sun.web.ui.servlet.wizard.WizardWindowViewBean; 43 44 45 48 public class DescriptorWizardWindowViewBean extends WizardWindowViewBean implements DescriptorContainerView, Command { 49 50 57 public DescriptorWizardWindowViewBean(RequestContext ctx, String name, ViewDescriptor desc) { 58 super(ctx); 59 setName(name); 60 setViewDescriptor(desc); 61 registerViewDescriptorChildren(); 62 } 63 64 65 66 70 80 public void execute(CommandEvent event) throws CommandException { 81 DescriptorViewHelper.execute( 82 getRequestContext(), (View)event.getSource(), event); 83 } 84 85 86 87 91 94 protected void setViewDescriptor(ViewDescriptor desc) { 95 _viewDesc = desc; 96 } 97 98 99 104 public ViewDescriptor getViewDescriptor() { 105 return _viewDesc; 106 } 107 108 109 public View createChild(String name) { 110 View child = null; 111 try { 112 child = DescriptorViewHelper.createChild(this, name); 114 } catch (ChildNotRegisteredException ex) { 115 child = super.createChild(name); 117 } 118 119 return child; 121 } 122 123 124 127 public void forwardTo(RequestContext requestContext) throws NavigationException { 128 super.forwardTo(requestContext); 129 } 130 131 132 133 137 145 public void beginDisplay(DisplayEvent event) throws ModelControlException { 146 DescriptorViewHelper.beginDisplay(this, event); 147 super.beginDisplay(event); 148 } 149 150 151 155 public boolean beginChildDisplay(ChildDisplayEvent event) { 156 try { 157 return DescriptorViewHelper.beginChildDisplay(this, event); 158 } catch (Exception ex) { 159 throw new FrameworkException(ex, getViewDescriptor(), this); 160 } 161 } 162 163 164 168 public String endChildDisplay(ChildContentDisplayEvent event) throws ModelControlException { 169 return DescriptorViewHelper.endChildDisplay(this, event); 170 } 171 172 173 177 public void endDisplay(DisplayEvent event) { 178 DescriptorViewHelper.endDisplay(this, event); 179 super.endDisplay(event); 180 } 181 182 183 201 public void registerViewDescriptorChildren() { 202 DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this); 203 } 204 205 206 private ViewDescriptor _viewDesc = null; 207 } 208 | Popular Tags |