All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.gwtbootstrap.client.ui.Accordion Maven / Gradle / Ivy

The newest version!
package com.github.gwtbootstrap.client.ui;

import com.github.gwtbootstrap.client.ui.base.DivWidget;
import com.github.gwtbootstrap.client.ui.constants.Constants;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;

/**
 * Simple Accordion style widget.
 * 

* It's a container of {@link AccordionGroup}. *

*

UiBinder Usage:

*

*

 * {@code
 * 
 *     
 *         one
 *         two
 *     
 *     
 *     
 *         The default opened Accordion
 *     
 *     
 *     
 *         Icon style
 *     
 *     
 *     
 *         
 *             
 *         
 *         Custom Icon Style
 *     
 * 
 * }
 * 
* * @since 2.2.1.0 * @author ohashi keisuke * @see Accordion * @see Collapse * @see CollapseTrigger * @see Twitter Bootstrap document * */ public class Accordion extends DivWidget { /** * Create an empty widget. */ public Accordion() { super(Constants.ACCORDION); getElement().setId(DOM.createUniqueId()); } /** * {@inheritDoc} */ @Override public void add(IsWidget child) { if(child instanceof Collapse) { Collapse collapse = (Collapse)child; collapse.setParent("#" + getId()); } super.add(child); } /** * {@inheritDoc} */ @Override public void add(Widget w) { if(w instanceof AccordionGroup) { AccordionGroup accordionGroup = (AccordionGroup)w; accordionGroup.setParent("#" + getId()); } super.add(w); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy