diff options
Diffstat (limited to 'extraplugins/propertylifecycle/org.eclipse.papyrus.propertylifecycle.preferences/src/org/eclipse/papyrus/propertylifecycle/preferences/utils/AdvancedTabViewerUtils.java')
-rwxr-xr-x | extraplugins/propertylifecycle/org.eclipse.papyrus.propertylifecycle.preferences/src/org/eclipse/papyrus/propertylifecycle/preferences/utils/AdvancedTabViewerUtils.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/extraplugins/propertylifecycle/org.eclipse.papyrus.propertylifecycle.preferences/src/org/eclipse/papyrus/propertylifecycle/preferences/utils/AdvancedTabViewerUtils.java b/extraplugins/propertylifecycle/org.eclipse.papyrus.propertylifecycle.preferences/src/org/eclipse/papyrus/propertylifecycle/preferences/utils/AdvancedTabViewerUtils.java new file mode 100755 index 00000000000..b56abf13c8d --- /dev/null +++ b/extraplugins/propertylifecycle/org.eclipse.papyrus.propertylifecycle.preferences/src/org/eclipse/papyrus/propertylifecycle/preferences/utils/AdvancedTabViewerUtils.java @@ -0,0 +1,43 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST 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: + * Quentin Le Menez (CEA LIST) quentin.lemenez@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.propertylifecycle.preferences.utils; + +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.propertylifecycle.PropertylifecycleFactory; +import org.eclipse.papyrus.propertylifecycle.StrategyElement; + +/** + * Convenience class used to create the custom model and its strategies + * + */ +public class AdvancedTabViewerUtils { + + /** The factory from which all the strategies are spawned */ + protected static PropertylifecycleFactory newModelFactory = PropertylifecycleFactory.eINSTANCE; + + /** + * Clone the selected strategy in the custom model + * + * @param selectedStrategy + * The selected strategy + * @return + * The cloned strategy + */ + public static StrategyElement cloneStrategy(StrategyElement selectedStrategy) { + StrategyElement clonedStrategy = EcoreUtil.copy(selectedStrategy); + + return clonedStrategy; + } + +} |