View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.component;
21  
22  import org.apache.myfaces.tobago.component.OnComponentPopulated;
23  import org.apache.myfaces.tobago.component.Visual;
24  import org.apache.myfaces.tobago.internal.layout.LayoutUtils;
25  
26  import javax.faces.component.UIComponent;
27  import javax.faces.context.FacesContext;
28  import java.io.IOException;
29  
30  public abstract class AbstractUIPanelBase extends javax.faces.component.UIPanel
31      implements OnComponentPopulated, Visual {
32  
33    @Override
34    public void encodeBegin(final FacesContext facesContext) throws IOException {
35  
36      super.encodeBegin(facesContext);
37  
38      final UIComponent layoutManager = LayoutUtils.getLayoutManager(this);
39      if (layoutManager != null) {
40        layoutManager.encodeBegin(facesContext);
41      }
42    }
43  
44    @Override
45    public void encodeChildren(final FacesContext facesContext) throws IOException {
46  
47      final UIComponent layoutManager = LayoutUtils.getLayoutManager(this);
48      if (layoutManager != null) {
49        layoutManager.encodeChildren(facesContext);
50      } else {
51        super.encodeChildren(facesContext);
52      }
53    }
54  
55    @Override
56    public void encodeEnd(final FacesContext facesContext) throws IOException {
57  
58      final UIComponent layoutManager = LayoutUtils.getLayoutManager(this);
59      if (layoutManager != null) {
60        layoutManager.encodeEnd(facesContext);
61      }
62  
63      super.encodeEnd(facesContext);
64    }
65  
66    @Override
67    public void onComponentPopulated(final FacesContext facesContext, final UIComponent parent) {
68    }
69  
70    public abstract java.lang.String getTip();
71  }