| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.ide.core.ui.softwarefactory.extender; |
| |
| import java.util.HashMap; |
| import java.util.Map; |
| |
| import org.eclipse.core.resources.IWorkspace; |
| import org.eclipse.xtext.resource.IResourceDescriptions; |
| import org.eclipse.xtext.ui.resource.XtextResourceSetProvider; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| import com.google.inject.Inject; |
| |
| public abstract class BaseExtender { |
| @Inject |
| protected XtextResourceSetProvider provider; |
| @Inject |
| protected IResourceDescriptions descs; |
| |
| protected static final Logger LOGGER = LoggerFactory |
| .getLogger(BaseExtender.class); |
| protected IModelExtenderAdapter adapter; |
| protected Map<String, ModelInstanceDescription> packageDeltas = new HashMap<String, ModelInstanceDescription>(); |
| protected String extension; |
| |
| public BaseExtender(IModelExtenderAdapter adapter, String extension) { |
| this.adapter = adapter; |
| this.extension = extension; |
| } |
| |
| protected abstract boolean extendModel(Map<String, ModelInstanceDescription> packageDeltas); |
| |
| public String getExtension() { |
| return extension; |
| } |
| |
| public IModelExtenderAdapter getAdapter() { |
| return adapter; |
| } |
| |
| } |