public void run() {
Shell shell = XMLUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
if (validateEdit(manager.getModel(), shell)) {
manager.beginNodeAction(this);
EditAttributeDialog dialog = new EditAttributeDialog(shell, ownerElement, attr);
dialog.create();
dialog.getShell().setText(title);
dialog.setBlockOnOpen(true);
dialog.open();
if (dialog.getReturnCode() == Window.OK) {
if (attr != null) {
ownerElement.removeAttributeNode(attr);
}
Document document = ownerElement.getOwnerDocument();
Attr newAttribute = document.createAttribute(dialog.getAttributeName());
newAttribute.setValue(dialog.getAttributeValue());
ownerElement.setAttributeNode(newAttribute);
manager.setViewerSelection(newAttribute);
}
manager.endNodeAction(this);
}