blob: e67b9987fd76a36d4e2ff5c04fa8d9e504bc7d3c [file] [log] [blame]
/*******************************************************************************
* <copyright>
*
* Copyright (c) 2005, 2012 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
* mwenz - Bug 374918 - Let default paste use LocalSelectionTransfer
*
* </copyright>
*
*******************************************************************************/
/*
* Created on 06.07.2005
*/
package org.eclipse.graphiti.bot.tests.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;
;
/**
* The Class DefaultCopyFeature.
*/
public class DefaultCopyFeature extends AbstractCopyFeature {
/**
* The Constructor.
*
* @param fp
* the fp
*/
public DefaultCopyFeature(IFeatureProvider fp) {
super(fp);
}
public boolean canCopy(ICopyContext context) {
final PictogramElement[] pictogramElements = context.getPictogramElements();
return pictogramElements != null && pictogramElements.length > 0;
}
public void copy(ICopyContext context) {
final PictogramElement[] pes = context.getPictogramElements();
putToClipboard(pes);
}
@Override
public boolean hasDoneChanges() {
return false;
}
}