Coverage Report - org.seasar.uruma.renderer.impl.SashFormRenderer
 
Classes in this File Line Coverage Branch Coverage Complexity
SashFormRenderer
100%
14/14
67%
4/6
0
 
 1  
 /*
 2  
  * Copyright 2004-2008 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.uruma.renderer.impl;
 17  
 
 18  
 import org.eclipse.swt.custom.SashForm;
 19  
 import org.eclipse.swt.widgets.Control;
 20  
 import org.seasar.uruma.component.jface.SashFormComponent;
 21  
 import org.seasar.uruma.context.PartContext;
 22  
 import org.seasar.uruma.context.WidgetHandle;
 23  
 
 24  
 /**
 25  
  * {@link SashForm} のレンダリングを行うクラスです。<br />
 26  
  * 
 27  
  * @author bskuroneko
 28  
  */
 29  60
 public class SashFormRenderer extends
 30  
         AbstractCompositeRenderer<SashFormComponent, SashForm> {
 31  
 
 32  
     /*
 33  
      * @see org.seasar.uruma.renderer.impl.AbstractCompositeRenderer#doRenderComposite(org.seasar.uruma.component.jface.CompositeComponent,
 34  
      *      org.eclipse.swt.widgets.Composite)
 35  
      */
 36  
     @Override
 37  
     protected void doRenderComposite(final SashFormComponent controlComponent,
 38  
             final SashForm control) {
 39  
         // Do nothing.
 40  28
     }
 41  
 
 42  
     /*
 43  
      * @see org.seasar.uruma.renderer.impl.AbstractWidgetRenderer#doRenderAfter(org.eclipse.swt.widgets.Widget,
 44  
      *      org.seasar.uruma.component.UIComponent,
 45  
      *      org.seasar.uruma.context.WidgetHandle,
 46  
      *      org.seasar.uruma.context.PartContext)
 47  
      */
 48  
     @Override
 49  
     protected void doRenderAfter(final SashForm widget,
 50  
             final SashFormComponent uiComponent, final WidgetHandle parent,
 51  
             final PartContext context) {
 52  28
         setMaximizedControl(widget, uiComponent);
 53  28
     }
 54  
 
 55  
     private void setMaximizedControl(final SashForm widget,
 56  
             final SashFormComponent uiComponent) {
 57  28
         String id = uiComponent.maximizedControlId;
 58  28
         if (id == null) {
 59  24
             return;
 60  
         }
 61  
 
 62  4
         WidgetHandle handle = getContext().getWidgetHandle(id);
 63  4
         if (handle != null) {
 64  4
             if (handle.instanceOf(Control.class)) {
 65  4
                 Control control = handle.<Control> getCastWidget();
 66  4
                 widget.setMaximizedControl(control);
 67  
             }
 68  
         }
 69  4
     }
 70  
 
 71  
     /*
 72  
      * @see org.seasar.uruma.renderer.impl.AbstractWidgetRenderer#getWidgetType()
 73  
      */
 74  
     @Override
 75  
     protected Class<SashForm> getWidgetType() {
 76  84
         return SashForm.class;
 77  
     }
 78  
 }