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 interface
ListBoxValues.ValueTester
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
acceptableValuesWithCustomValues
protected List<String>
acceptableValuesWithoutCustomValues
protected String
customPrompt
protected List<String>
customValues
protected static int
DEFAULT_MAX_DISPLAY_LENGTH
static String
EDIT_SUFFIX
protected String
editPrefix
protected Map<String,String>
mapDisplayValuesToValues
protected int
maxDisplayLength
-
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 String
addCustomValue(String newValue, String oldValue)
protected String
addDisplayValue(String value)
Function for handling values which are longer than MAX_DISPLAY_LENGTH such as very long string constants.void
addValues(List<String> acceptableValues)
protected void
clear()
protected List<String>
createDisplayValues(List<String> acceptableValues)
List<String>
getAcceptableValuesWithCustomValues()
List<String>
getAcceptableValuesWithoutCustomValues()
String
getEditPrefix()
protected String
getEditValuePrompt(String editPrefix)
String
getNonCustomValueForUserString(String userValue)
String
getValueForDisplayValue(String key)
Returns real unquoted value for a DisplayValueboolean
isCustomValue(String value)
String
toString()
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:
-
-