| /******************************************************************************* |
| * Copyright (c) 2014 E.D.Willink 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: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.qvtd.xtext.qvtimperative.ui.model; |
| |
| import org.eclipse.emf.common.util.URI; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.ocl.pivot.internal.utilities.OCLInternal; |
| import org.eclipse.ocl.pivot.resource.BasicProjectManager; |
| import org.eclipse.ocl.xtext.base.ui.model.BaseCSorASDocumentProvider; |
| import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperative; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.QVTimperativeCSPackage; |
| |
| /** |
| * QVTimperativeDocumentProvider orchestrates the load and saving of optional XMI content |
| * externally while maintaining the serialised human friendly form internally. |
| */ |
| public class QVTimperativeDocumentProvider extends BaseCSorASDocumentProvider |
| { |
| @Override |
| protected @NonNull OCLInternal createOCL() { |
| return QVTimperative.newInstance(BasicProjectManager.createDefaultProjectManager(), null); |
| } |
| |
| @Override |
| protected @NonNull String createTestDocument(@NonNull URI uri, @NonNull String lastSegment) { |
| return ""; |
| } |
| |
| @Override |
| protected String getCScontentType() { |
| return QVTimperativeCSPackage.eCONTENT_TYPE; |
| } |
| |
| @Override |
| protected @NonNull String getFileExtension() { |
| return "qvti"; |
| } |
| } |