001/*
002 * $Id: TipOfTheDayModel.java 542 2005-10-10 18:03:15Z rbair $
003 *
004 * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
005 * Santa Clara, California 95054, U.S.A. All rights reserved.
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 * You should have received a copy of the GNU Lesser General Public
018 * License along with this library; if not, write to the Free Software
019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
020 */
021package org.jdesktop.swingx.tips;
022
023import org.jdesktop.swingx.JXTipOfTheDay;
024
025/**
026 * A model for {@link org.jdesktop.swingx.JXTipOfTheDay}.<br>
027 * 
028 * @author <a href="mailto:fred@L2FProd.com">Frederic Lavigne</a>
029 */
030public interface TipOfTheDayModel {
031
032  /**
033   * @return the number of tips in this model
034   */
035  int getTipCount();
036
037  /**
038   * @param index
039   * @return the tip at <code>index</code>
040   * @throws IndexOutOfBoundsException
041   *           if the index is out of range (index &lt; 0 || index &gt;=
042   *           getTipCount()).
043   */
044  Tip getTipAt(int index);
045
046  /**
047   * A tip.<br>
048   */
049  interface Tip {
050
051    /**
052     * @return very short (optional) text describing the tip
053     */
054    String getTipName();
055
056    /**
057     * The tip object to show. See {@link JXTipOfTheDay} for supported object
058     * types.
059     * 
060     * @return the tip to display
061     */
062    Object getTip();
063  }
064
065}