001/* Parameter specifying the target for an HTML link.
002
003 Copyright (c) 2011-2012 The Regents of the University of California.
004 All rights reserved.
005 Permission is hereby granted, without written agreement and without
006 license or royalty fees, to use, copy, modify, and distribute this
007 software and its documentation for any purpose, provided that the above
008 copyright notice and the following two paragraphs appear in all copies
009 of this software.
010
011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
015 SUCH DAMAGE.
016
017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
022 ENHANCEMENTS, OR MODIFICATIONS.
023
024 PT_COPYRIGHT_VERSION_2
025 COPYRIGHTENDKEY
026
027 */
028
029package ptolemy.vergil.basic.export.web;
030
031import ptolemy.data.expr.StringParameter;
032import ptolemy.kernel.util.IllegalActionException;
033import ptolemy.kernel.util.NameDuplicationException;
034import ptolemy.kernel.util.NamedObj;
035
036///////////////////////////////////////////////////////////////////
037//// LinkTarget
038/**
039 * Parameter specifying the target for an HTML link.
040 * The parameter offers the following possibilities:
041 *  <ul>
042 *  <li><b>_lightbox</b>: Open in a lightbox-style popup frame.
043 *  <li><b>_blank</b>: Open in a new window or tab.
044 *  <li><b>_self</b>: Open in the same frame as it was clicked.
045 *  <li><b>_parent</b>: Open in the parent frameset.
046 *  <li><b>_top</b>: Open in the full body of the window.
047 *  <li><b><i>framename</i></b>: Open in a named frame.
048 *  </ul>
049 *  The default is "_lightbox".
050 *
051 * @author Edward A. Lee
052 * @version $Id$
053 * @since Ptolemy II 10.0
054 * @Pt.ProposedRating Red (cxh)
055 * @Pt.AcceptedRating Red (cxh)
056 */
057public class LinkTarget extends StringParameter {
058
059    /** Create an instance of this parameter.
060     *  @param container The container.
061     *  @param name The name.
062     *  @exception IllegalActionException If the superclass throws it.
063     *  @exception NameDuplicationException If the superclass throws it.
064     */
065    public LinkTarget(NamedObj container, String name)
066            throws IllegalActionException, NameDuplicationException {
067        super(container, name);
068
069        addChoice("_lightbox");
070        addChoice("_blank");
071        addChoice("_self");
072        addChoice("_top");
073        setExpression("_lightbox");
074    }
075}