* {@inheritDoc}
*/
public void run()
{
IEntry entry = null;
if ( getInput() != null && getInput() instanceof IEntry )
{
entry = ( IEntry ) getInput();
}
else if ( getSelectedEntries().length > 0 )
{
entry = getSelectedEntries()[0];
}
else if ( getSelectedAttributes().length > 0 )
{
entry = getSelectedAttributes()[0].getEntry();
}
else if ( getSelectedValues().length > 0 )
{
entry = getSelectedValues()[0].getAttribute().getEntry();
}
if ( entry != null )
{
AttributeWizard wizard = new AttributeWizard( "New Attribute", true, true, null, entry );
WizardDialog dialog = new WizardDialog( getShell(), wizard );
dialog.setBlockOnOpen( true );
dialog.create();
if ( dialog.open() == WizardDialog.OK )
{
String newAttributeDescription = wizard.getAttributeDescription();
if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) )
{
try
{
IAttribute att = entry.getAttribute( newAttributeDescription );
if ( att == null )
{
att = new Attribute( entry, newAttributeDescription );
entry.addAttribute( att ) ;
}
att.addEmptyValue();
}
catch ( ModelModificationException mme )