Package org.jbpm.designer.client.util
Class ListBoxValues
- java.lang.Object
-
- org.jbpm.designer.client.util.ListBoxValues
-
public class ListBoxValues extends Object
Class containing a list of values for a ValueListBox. This is used by the ListBoxes in the DataIOEditor to keep their drop-down lists up to date with updated with new values (CustomDataTypes / Constants) as the user adds them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceListBoxValues.ValueTester
-
Field Summary
Fields Modifier and Type Field Description protected List<String>acceptableValuesWithCustomValuesprotected List<String>acceptableValuesWithoutCustomValuesprotected StringcustomPromptprotected List<String>customValuesprotected static intDEFAULT_MAX_DISPLAY_LENGTHstatic StringEDIT_SUFFIXprotected StringeditPrefixprotected Map<String,String>mapDisplayValuesToValuesprotected intmaxDisplayLength
-
Constructor Summary
Constructors Constructor Description ListBoxValues(String customPrompt, String editPrefix, ListBoxValues.ValueTester valueTester)ListBoxValues(String customPrompt, String editPrefix, ListBoxValues.ValueTester valueTester, int maxDisplayLength)ListBoxValues(ListBoxValues copy, boolean copyCustomValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddCustomValue(String newValue, String oldValue)protected StringaddDisplayValue(String value)Function for handling values which are longer than MAX_DISPLAY_LENGTH such as very long string constants.voidaddValues(List<String> acceptableValues)protected voidclear()protected List<String>createDisplayValues(List<String> acceptableValues)List<String>getAcceptableValuesWithCustomValues()List<String>getAcceptableValuesWithoutCustomValues()StringgetEditPrefix()protected StringgetEditValuePrompt(String editPrefix)StringgetNonCustomValueForUserString(String userValue)StringgetValueForDisplayValue(String key)Returns real unquoted value for a DisplayValuebooleanisCustomValue(String value)StringtoString()List<String>update(String currentValue)
-
-
-
Field Detail
-
customPrompt
protected String customPrompt
-
editPrefix
protected String editPrefix
-
EDIT_SUFFIX
public static final String EDIT_SUFFIX
- See Also:
- Constant Field Values
-
maxDisplayLength
protected int maxDisplayLength
-
DEFAULT_MAX_DISPLAY_LENGTH
protected static final int DEFAULT_MAX_DISPLAY_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ListBoxValues
public ListBoxValues(String customPrompt, String editPrefix, ListBoxValues.ValueTester valueTester, int maxDisplayLength)
-
ListBoxValues
public ListBoxValues(String customPrompt, String editPrefix, ListBoxValues.ValueTester valueTester)
-
ListBoxValues
public ListBoxValues(ListBoxValues copy, boolean copyCustomValues)
-
-
Method Detail
-
getEditPrefix
public String getEditPrefix()
-
isCustomValue
public boolean isCustomValue(String value)
-
clear
protected void clear()
-
addDisplayValue
protected String addDisplayValue(String value)
Function for handling values which are longer than MAX_DISPLAY_LENGTH such as very long string constants.Creates display value for a value and adds it to the mapDisplayValuesToValues map. If display value already present in mapDisplayValuesToValues, returns it.
The first display value for values which are the same is of the form "\"abcdeabcde...\"" and subsequent display values are of the form "\"abcdeabcde...(01)\""
- Parameters:
value- the value- Returns:
- the displayValue for value
-
getValueForDisplayValue
public String getValueForDisplayValue(String key)
Returns real unquoted value for a DisplayValue- Parameters:
key-- Returns:
-
-