/*
 * ICESOFT COMMERCIAL SOURCE CODE LICENSE V 1.1
 *
 * The contents of this file are subject to the ICEsoft Commercial Source
 * Code License Agreement V1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the
 * License at
 * http://www.icesoft.com/license/commercial-source-v1.1.html
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations under
 * the License.
 *
 * Copyright 2009-2015 ICEsoft Technologies Canada, Corp. All Rights Reserved.
 */
package com.icesoft.faces.facelets.component.expandabletable;

import javax.faces.event.ActionEvent;


/**
 * Interface that defines the methods used for the expandable table
 * custom component.
 */
public interface ExpandableRecordInterface {
    /**
     * Gets the renderable state of the contract/expand image toggle.
     *
     * @return true if images shoulc be drawn; otherwise, false.
     */
    public boolean isRenderImage();

    /**
     * Toggles the expanded state of this record.
     *
     * @param event JSF action event.
     */
    public void toggleSubGroupAction(ActionEvent event);

    /**
     * Adds a child sales record to this sales group.
     *
     * @param expandableRecord child record to add to this record.
     */
    public void addChildRecord(ExpandableRecord expandableRecord);

    /**
     * Removes the specified child record from this group.
     *
     * @param expandableRecord child record to remove.
     */
    public void removeChildRecord(ExpandableRecord expandableRecord);

    /**
     * Utility method to add all child nodes to the parent dataTable list.
     */
    public void expandNodeAction();

    /**
     * Utility method to remove all the child nodes from the parent
     * dataTable list.
     */
    public void contractNodeAction();

}
