/******************************************************************************* | |
* <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.features; | |
import org.eclipse.graphiti.features.IFeatureProvider; | |
import org.eclipse.graphiti.features.context.ICopyContext; | |
import org.eclipse.graphiti.mm.pictograms.PictogramElement; | |
import org.eclipse.graphiti.ui.features.AbstractCopyFeature; | |
/** | |
* This class copies pictogram elements to the clipboard. | |
* | |
* @author Benjamin Schmeling | |
* | |
*/ | |
public class ShapeCopyFeature extends AbstractCopyFeature { | |
/** | |
* The main constructor. | |
* | |
* @param featureProvider The feature provider. | |
*/ | |
public ShapeCopyFeature(IFeatureProvider featureProvider) { | |
super(featureProvider); | |
} | |
/* | |
* (non-Javadoc) | |
* | |
* @see | |
* org.eclipse.graphiti.features.ICopyFeature#copy(org.eclipse.graphiti. | |
* features.context.ICopyContext) | |
*/ | |
@Override | |
public void copy(ICopyContext context) { | |
PictogramElement[] pes = context.getPictogramElements(); | |
putToClipboard(pes); | |
} | |
/* | |
* (non-Javadoc) | |
* | |
* @see | |
* org.eclipse.graphiti.features.ICopyFeature#canCopy(org.eclipse.graphiti | |
* .features.context.ICopyContext) | |
*/ | |
@Override | |
public boolean canCopy(ICopyContext context) { | |
return true; | |
} | |
} |