001/*
002 *  Copyright 2018 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.runtime.model;
017
018import java.util.List;
019
020/**
021 * Interface for view item containers
022 */
023public interface ViewItemContainer
024{
025    /**
026     * Retrieves all the view items of this container
027     * @return the view items
028     */
029    public List<ViewItem> getViewItems();
030    
031    /**
032     * Checks if there is a view item with the given name
033     * @param itemName the name of the item
034     * @return <code>true</code> if the container contains an item with the given name, <code>false</code> otherwise 
035     */
036    public boolean hasViewItem(String itemName);
037    
038    /**
039     * Add a view item in the container
040     * @param item the item to add
041     */
042    public void addViewItem(ViewItem item);
043    
044    /**
045     * Insert a view item in the container at the given index
046     * @param item the item to insert
047     * @param index index at which the item has to be inserted
048     */
049    public void insertViewItem(ViewItem item, int index);
050}