private void editSelectedContextEntry()
{
StructuredSelection selection = ( StructuredSelection ) contextEntryTableViewer.getSelection();
if ( !selection.isEmpty() )
{
AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
String oldId = attributeValueObject.getAttribute();
Object oldValue = attributeValueObject.getValue();
AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
if ( Dialog.OK == dialog.open() && dialog.isDirty() )
{
Attribute attribute = contextEntry.get( oldId );
if ( attribute != null )
{
attribute.remove( oldValue );
}
AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
if ( attribute != null )
{
attribute.add( newAttributeValueObject.getValue() );
}
else
{
contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
newAttributeValueObject.getValue() ) );
}
contextEntryTableViewer.refresh();
resizeContextEntryTableColumnsToFit();
masterDetailsBlock.setEditorDirty();