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.custom.toggle;
21
22 import javax.faces.component.behavior.ClientBehaviorHolder;
23 import javax.faces.component.html.HtmlPanelGroup;
24
25 import org.apache.myfaces.component.EventAware;
26 import org.apache.myfaces.component.UniversalProperties;
27
28 /**
29 * Container class allows user to toggle between view/edit mode.
30 *
31 * Extends PanelGroup. Allows user to have several toggleLink in a group.
32 * When the togglePanel is toggled, the toggleGroup will be hidden.
33 *
34 * @JSFComponent
35 * name = "t:toggleGroup"
36 * class = "org.apache.myfaces.custom.toggle.ToggleGroup"
37 * tagClass = "org.apache.myfaces.custom.toggle.ToggleGroupTag"
38 *
39 * @author Sharath
40 *
41 */
42 public abstract class AbstractToggleGroup extends HtmlPanelGroup
43 implements EventAware, UniversalProperties, ClientBehaviorHolder
44 {
45 public static final String COMPONENT_TYPE = "org.apache.myfaces.ToggleGroup";
46 public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.ToggleGroup";
47
48 public AbstractToggleGroup()
49 {
50 super();
51 setRendererType(AbstractToggleGroup.DEFAULT_RENDERER_TYPE);
52 }
53
54 /**
55 * HTML: Flag to define the toggle status.
56 *
57 * @JSFProperty
58 */
59 public abstract boolean isToggled();
60
61 public abstract void setToggled(boolean toggleMode);
62
63 }