001/* A StringParmeter that is not easily edited by the user. 002 003 Copyright (c) 2010-2013 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.data.expr; 030 031import ptolemy.kernel.util.IllegalActionException; 032import ptolemy.kernel.util.NameDuplicationException; 033import ptolemy.kernel.util.NamedObj; 034import ptolemy.kernel.util.Settable; 035 036////////////////////////////////////////////////////////////////////////// 037//// DBParameter 038 039/** 040 This class is identical to StringParameter except that its visibility 041 is set to "NOT_EDITABLE" by default. The visibility is not represented 042 in a MoML file, so if you want "NOT_EDITABLE" visibility to be persistent, 043 you must use this class. 044 045 @author Lyle Holsinger 046 @version $Id$ 047 @since Ptolemy II 10.0 048 @Pt.ProposedRating Yellow (lholsing) 049 @Pt.AcceptedRating Red (lholsing) 050 */ 051 052public class StringConstantParameter extends StringParameter { 053 /** Construct a parameter with the given name contained by the specified 054 * entity. The container argument must not be null, or a 055 * NullPointerException will be thrown. This parameter will use the 056 * workspace of the container for synchronization and version counts. 057 * If the name argument is null, then the name is set to the empty string. 058 * The object is not added to the list of objects in the workspace 059 * unless the container is null. 060 * Increment the version of the workspace. 061 * @param container The container. 062 * @param name The name of the parameter. 063 * @exception IllegalActionException If the parameter is not of an 064 * acceptable class for the container. 065 * @exception NameDuplicationException If the name coincides with 066 * a parameter already in the container. 067 */ 068 public StringConstantParameter(NamedObj container, String name) 069 throws IllegalActionException, NameDuplicationException { 070 super(container, name); 071 setVisibility(Settable.NOT_EDITABLE); 072 } 073}