diff options
Diffstat (limited to 'plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomainProvider.java')
-rw-r--r-- | plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomainProvider.java | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomainProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomainProvider.java index 74cf0fee03c..e31c6bbf1f3 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomainProvider.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.readonly/src/org/eclipse/papyrus/infra/emf/readonly/PapyrusROTransactionalEditingDomainProvider.java @@ -1,46 +1,46 @@ -/*****************************************************************************
- * Copyright (c) 2011, 2014 Atos Origin, CEA, and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- * Christian W. Damus (CEA) - bug 402525
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.readonly;
-
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.IResourceUndoContextPolicy;
-import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory;
-import org.eclipse.papyrus.commands.CheckedOperationHistory;
-import org.eclipse.papyrus.commands.NestingNotifyingWorkspaceCommandStack;
-import org.eclipse.papyrus.commands.NotifyingWorkspaceCommandStack;
-import org.eclipse.papyrus.infra.core.resource.ITransactionalEditingDomainProvider;
-
-/**
- * Editing Domain created using this provider will use handlers registered on readOnlyHandler extension
- * to determine if a resource is read only.
- *
- * @author mvelten
- *
- */
-public class PapyrusROTransactionalEditingDomainProvider implements ITransactionalEditingDomainProvider {
-
- public TransactionalEditingDomain createTransactionalEditingDomain(ResourceSet resourceSet) {
- NotifyingWorkspaceCommandStack stack = new NestingNotifyingWorkspaceCommandStack(CheckedOperationHistory.getInstance());
- stack.setResourceUndoContextPolicy(IResourceUndoContextPolicy.DEFAULT);
-
- TransactionalEditingDomain result = new PapyrusROTransactionalEditingDomain(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), stack, resourceSet);
-
- WorkspaceEditingDomainFactory.INSTANCE.mapResourceSet(result);
-
- return result;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2011, 2014 Atos Origin, CEA, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation + * Christian W. Damus (CEA) - bug 402525 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.emf.readonly; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.IResourceUndoContextPolicy; +import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; +import org.eclipse.papyrus.infra.core.resource.ITransactionalEditingDomainProvider; +import org.eclipse.papyrus.infra.emf.gmf.command.CheckedOperationHistory; +import org.eclipse.papyrus.infra.emf.gmf.command.NestingNotifyingWorkspaceCommandStack; +import org.eclipse.papyrus.infra.emf.gmf.command.NotifyingWorkspaceCommandStack; + +/** + * Editing Domain created using this provider will use handlers registered on readOnlyHandler extension + * to determine if a resource is read only. + * + * @author mvelten + * + */ +public class PapyrusROTransactionalEditingDomainProvider implements ITransactionalEditingDomainProvider { + + public TransactionalEditingDomain createTransactionalEditingDomain(ResourceSet resourceSet) { + NotifyingWorkspaceCommandStack stack = new NestingNotifyingWorkspaceCommandStack(CheckedOperationHistory.getInstance()); + stack.setResourceUndoContextPolicy(IResourceUndoContextPolicy.DEFAULT); + + TransactionalEditingDomain result = new PapyrusROTransactionalEditingDomain(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE), stack, resourceSet); + + WorkspaceEditingDomainFactory.INSTANCE.mapResourceSet(result); + + return result; + } + +} |