/** @generated */
 @Override
 public void run(IAction action) {
   TransactionalEditingDomain editingDomain =
       WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
   ResourceSet resourceSet = editingDomain.getResourceSet();
   EObject diagramRoot = null;
   try {
     Resource resource = resourceSet.getResource(domainModelURI, true);
     diagramRoot = resource.getContents().get(0);
   } catch (WrappedException ex) {
     UMLDiagramEditorPlugin.getInstance()
         .logError("Unable to load resource: " + domainModelURI, ex); // $NON-NLS-1$
   }
   if (diagramRoot == null) {
     MessageDialog.openError(
         getShell(),
         Messages.InitDiagramFile_ResourceErrorDialogTitle,
         Messages.InitDiagramFile_ResourceErrorDialogMessage);
     return;
   }
   Wizard wizard = new UMLNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
   wizard.setWindowTitle(
       NLS.bind(Messages.InitDiagramFile_WizardTitle, ActivityDiagramEditPart.MODEL_ID));
   UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); // $NON-NLS-1$
 }
  public TransactionalEditingDomain createTransactionalEditingDomain(ResourceSet resourceSet) {
    NotifyingWorkspaceCommandStack stack =
        new NotifyingWorkspaceCommandStack(CheckedOperationHistory.getInstance());
    stack.setResourceUndoContextPolicy(IResourceUndoContextPolicy.DEFAULT);

    TransactionalEditingDomain result =
        new PapyrusROTransactionalEditingDomain(
            new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE),
            stack,
            resourceSet);

    WorkspaceEditingDomainFactory.INSTANCE.mapResourceSet(result);

    return result;
  }
 /**
  * Create a new transactional editing domain.
  *
  * <p>In this case a WorkspaceEditingDomainFactory which is a subtype of
  * TransactionalEditingDomain.
  */
 @Override
 public TransactionalEditingDomain createEditingDomain() {
   TransactionalEditingDomain result =
       WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
   return result;
 }