001/*
002 *  Copyright 2016 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.core.ui.ribbonconfiguration;
017
018import java.util.List;
019
020import org.xml.sax.ContentHandler;
021import org.xml.sax.SAXException;
022
023/**
024 * An element in the ribbon
025 */
026public interface Element
027{
028    /**
029     * Retrieve the list of children elements in this element.
030     * @return The list of elements.
031     */
032    public List<Element> getChildren();
033    
034    /**
035     * Sax the the configuration of the element.
036     * @param handler The content handler where to sax
037     * @throws SAXException if an error occurs
038     */
039    public void toSAX(ContentHandler handler) throws SAXException;
040    
041    
042    /**
043     * Test if an element is equal to another element
044     * @param element The element to compare to
045     * @return True if equals
046     */
047    boolean isSame(Element element);
048    
049    /**
050     * Get the size taken by this element, in columns
051     * @return The size
052     */
053    public int getColumns();
054    
055    /**
056     * Set the size to take by this element
057     * @param size The size in number of columns
058     */
059    public void setColumns(int size);
060}
061