*/
private void editProtectedItem()
{
ProtectedItemWrapper protectedItemWrapper = getSelectedProtectedItemWrapper();
AbstractDialogStringValueEditor valueEditor = protectedItemWrapper.getValueEditor();
if(valueEditor != null)
{
if(protectedItemWrapper.isMultivalued())
{
MultiValuedDialog dialog = new MultiValuedDialog( getShell(), protectedItemWrapper.getDisplayName(), protectedItemWrapper.getValues(), context, valueEditor );
dialog.open();
refreshTable();
}
else
{
List<String> values = protectedItemWrapper.getValues();
String oldValue = values.isEmpty() ? null : values.get( 0 );
if ( oldValue == null )
{
oldValue = "";
}
Object oldRawValue = valueEditor.getRawValue( context.getConnection(), oldValue );
CellEditor cellEditor = valueEditor.getCellEditor();
cellEditor.setValue( oldRawValue );
cellEditor.activate();
Object newRawValue = cellEditor.getValue();
if(newRawValue != null)
{
String newValue = (String) valueEditor.getStringOrBinaryValue( newRawValue );
values.clear();
values.add( newValue );
tableViewer.refresh();
}