| /***************************************************************************** |
| * Copyright (c) 2013, 2017 CEA LIST and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| * Eike Stepper (CEA) - bug 466520 |
| *****************************************************************************/ |
| package org.eclipse.papyrus.cdo.core.resource; |
| |
| import org.eclipse.emf.cdo.eresource.impl.CDOResourceFactoryImpl; |
| import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl; |
| import org.eclipse.emf.common.util.URI; |
| |
| /** |
| * This is the PapyrusCDOResourceFactory type. Enjoy. |
| */ |
| public class PapyrusCDOResourceFactory |
| extends CDOResourceFactoryImpl { |
| |
| private final CDOAwareModelSet modelSet; |
| |
| public PapyrusCDOResourceFactory(CDOAwareModelSet modelSet) { |
| super(); |
| |
| this.modelSet = modelSet; |
| } |
| |
| @Override |
| protected boolean isGetResource() { |
| return modelSet.isInGetResource() || super.isGetResource(); |
| } |
| |
| /** |
| * @since 4.0 |
| */ |
| protected CDOResourceImpl createCDOResource(URI uri) |
| { |
| return new PapyrusCDOResourceImpl(uri); |
| } |
| |
| } |