blob: db2bd5ecf055f11130270e96c532592d5fa7a4d4 [file] [log] [blame]
/*******************************************************************************
* <copyright>
*
* Copyright (c) 2013, 2013 SAP AG.
* 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:
* SAP AG - initial API, implementation and documentation
*
* </copyright>
*
*******************************************************************************/
package org.eclipse.fmc.blockdiagram.editor.meta.features;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.fmc.blockdiagram.editor.meta.util.FMCMetaUtil;
import org.eclipse.fmc.mm.Comment;
import org.eclipse.fmc.mm.CommentType;
import org.eclipse.fmc.mm.FmcFactory;
import org.eclipse.graphiti.features.IFeatureProvider;
/**
* Feature Class for pasting the graphical representation and the business
* model.
*
* @author Patrick Jahnke
*
*/
public class ShapePasteMetaFeature extends
org.eclipse.fmc.blockdiagram.editor.features.ShapePasteFeature {
/**
* Constructor just calls the super constructor.
*
* @param fp
* The FeatureProvider object.
*/
public ShapePasteMetaFeature(IFeatureProvider fp) {
super(fp);
}
/**
* Add copied business object to the meta model.
*
* @param copy
* The copied business object.
*/
protected void addCopyToModel(EObject copy) {
FMCMetaUtil.addModelObject(copy, getDiagram(), getFeatureProvider());
}
/**
* Create an comment object not an image.
*/
@Override
protected Object getImageModelObject() {
Comment comment = FmcFactory.eINSTANCE.createComment();
comment.setType(CommentType.IMAGE);
FMCMetaUtil.addModelObject(comment, getDiagram(), getFeatureProvider());
return comment;
}
}