1 /* 2 * File : Parameter.java 3 * Created : 30 nov. 2003 4 * By : Olivier 5 * 6 * Azureus - a Java Bittorrent client 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details ( see the LICENSE file ). 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 */ 22 23 package org.gudy.azureus2.plugins.ui.config; 24 25 import org.gudy.azureus2.plugins.config.ConfigParameter; 26 27 /** 28 * represents a generic parameter description 29 * @author Olivier 30 * 31 */ 32 public interface 33 Parameter 34 extends ConfigParameter 35 { 36 public static final int MODE_BEGINNER = 0; 37 public static final int MODE_INTERMEDIATE = 1; 38 public static final int MODE_ADVANCED = 2; 39 40 /** 41 * Sets whether the UI object for this parameter is enabled (changeable) or 42 * disabled (not changeable, and usually grayed out) 43 * 44 * @param enabled The new enabled state 45 * 46 * @since 2.3.0.0 47 */ 48 public void setEnabled( boolean enabled )49 setEnabled( 50 boolean enabled ); 51 52 /** 53 * Retrieves the enabled state for the UI object for this parameter 54 * 55 * @return The enabled state 56 * 57 * @since 2.3.0.0 58 */ 59 public boolean isEnabled()60 isEnabled(); 61 62 /** 63 * Gets the lowest user mode required for this parameter to be displayed. 64 * 65 * @return MODE_ constants above 66 * @since 3.0.5.3 67 */ 68 public int getMinimumRequiredUserMode()69 getMinimumRequiredUserMode(); 70 71 /** 72 * Sets the lowest user mode required for this parameter to be displayed. 73 * 74 * @param mode see MODE_ constants defined above 75 * @since 3.0.5.3 76 */ 77 78 public void setMinimumRequiredUserMode( int mode )79 setMinimumRequiredUserMode( 80 int mode ); 81 82 /** 83 * Sets whether the UI object for this parameter is visible to the user 84 * 85 * @param visible The new visibility state 86 * 87 * @since 2.3.0.4 88 */ 89 public void setVisible( boolean visible )90 setVisible( 91 boolean visible ); 92 93 /** 94 * Retrieves the visiblility state for the UI object for this parameter 95 * 96 * @return The visibility state 97 * 98 * @since 2.3.0.4 99 */ 100 public boolean isVisible()101 isVisible(); 102 103 /** 104 * Controls whether or not 'parameter change' events are fired for each incremental value change 105 * @param b 106 * 107 * @since 3.0.5.1 108 */ 109 110 public void setGenerateIntermediateEvents( boolean b )111 setGenerateIntermediateEvents( 112 boolean b ); 113 114 /** 115 * 116 * @return 117 * 118 * @since 3.0.5.1 119 */ 120 121 public boolean getGenerateIntermediateEvents()122 getGenerateIntermediateEvents(); 123 124 /** 125 * Adds a listener triggered when the parameter is changed by the user 126 * 127 * @param l Listener to add 128 * 129 * @since 2.1.0.2 130 */ 131 public void addListener( ParameterListener l )132 addListener( 133 ParameterListener l ); 134 135 /** 136 * Removes a previously added listener 137 * 138 * @param l Listener to remove. 139 * 140 * @since 2.1.0.2 141 */ 142 public void removeListener( ParameterListener l )143 removeListener( 144 ParameterListener l ); 145 146 /** 147 * Retrieve the actual text of the label associated with this parameter. 148 * This is the text after it has been looked up in the language bundle. 149 * 150 * @return The label's text 151 * 152 * @since 2.3.0.6 153 */ getLabelText()154 public String getLabelText(); 155 156 /** 157 * Set the text of the label associated to with this parameter to the literal 158 * text supplied. 159 * 160 * @param sText The actual text to assign to the label 161 * 162 * @since 2.3.0.6 163 */ setLabelText(String sText)164 public void setLabelText(String sText); 165 166 /** 167 * Retrieve the language bundle key for the label associated with this 168 * parameter. 169 * 170 * @return The language bundle key, or null if the label is using literal 171 * text 172 * 173 * @since 2.3.0.6 174 */ getLabelKey()175 public String getLabelKey(); 176 177 /** 178 * Set the label to use the supplied language bundle key for the label 179 * associated with this parameter 180 * 181 * @param sLabelKey The language bundle key to use. 182 * 183 * @since 2.3.0.6 184 */ setLabelKey(String sLabelKey)185 public void setLabelKey(String sLabelKey); 186 getConfigKeyName()187 public String getConfigKeyName(); 188 189 public boolean hasBeenSet()190 hasBeenSet(); 191 } 192