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