001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ui.util.table;
029
030import java.lang.annotation.Retention;
031import java.lang.annotation.RetentionPolicy;
032
033/**
034 * Annotation used to mark up bean properties with metadata for table columns.<p>
035 */
036@Retention(RetentionPolicy.RUNTIME)
037public @interface Column {
038
039    /**
040     * Expand ratio for the column (use negative values for no expand ratio).<p>
041     *
042     * @return the expand ratoio
043     */
044    float expandRatio() default -1.0f;
045
046    /**
047     * Flag indicating whether column should be filterable by default.
048     *
049     * @return true if the column should be filterable
050     */
051    boolean filterable() default true;
052
053    /**
054     * The message key for the column header (if no given message is found, will be used as a literal header).<p>
055     *
056     * @return the message key for the column header
057     */
058    String header();
059
060    /**
061     * The order key.<p>
062     *
063     * The ordering of columns is determined by the relative sizes of their order keys.<p>
064     *
065     * @return the order key
066     */
067    int order() default -1;
068
069    /**
070     * The style which should be used for a cell in this column.<p>
071     *
072     * @return the style
073     */
074    String styleName() default "";
075
076    /**
077     * The view in which the column should be displayed.<p>
078     *
079     * @return the view
080     */
081    String view() default "";
082
083    /**
084     * The width (use -1 to not set the width).<p>
085     *
086     * @return the width
087     */
088    int width() default -1;
089
090}