/* * CustomStsToolEditPartFactory.java * * This file is part of the STS-Tool project. * Copyright (c) 2011-2012 "University of Trento - DISI" All rights reserved. * * Is strictly forbidden to remove this copyright notice from this source code. * * Disclaimer of Warranty: * STS-Tool (this software) is provided "as-is" and without warranty of any kind, * express, implied or otherwise, including without limitation, any warranty of * merchantability or fitness for a particular purpose. * In no event shall the copyright holder or contributors be liable for any direct, * indirect, incidental, special, exemplary, or consequential damages * including, but not limited to, procurement of substitute goods or services; * loss of use, data, or profits; or business interruption) however caused and on * any theory of liability, whether in contract, strict liability, or tort (including * negligence or otherwise) arising in any way out of the use of this software, even * if advised of the possibility of such damage. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License version 3 * as published by the Free Software Foundation with the addition of the * following permission added to Section 15 as permitted in Section 7(a): * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY * "University of Trento - DISI","University of Trento - DISI" DISCLAIMS THE * WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program; if not, see http://www.gnu.org/licenses or write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA, 02110-1301 USA, or download the license from the following URL: * http://www.sts-tool.eu/License.php * * For more information, please contact STS-Tool group at this * address: ststool@disi.unitn.it * */ package eu.aniketos.wp1.ststool.diagram.custom.editpart; import org.eclipse.gef.EditPart; import org.eclipse.gmf.runtime.notation.View; import eu.aniketos.wp1.ststool.diagram.edit.parts.AgentAgentCompartmentEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.AgentEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.AuthorisationEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.DelegationEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.DependencyEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.EventEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.Goal2EditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.GoalDecompositionANDEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.GoalDecompositionOREditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.GoalEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.IResourceEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.ModifyEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.NeedEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.NegativeGoalContributionEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.OwnEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.PartOfEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.PlayEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.PositiveGoalContributionEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.ProduceEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.ProvisionEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.RoleEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.RoleRoleCompartmentEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.StsToolDiagramEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.TResource2EditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.TResourceEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.TangibleByEditPart; import eu.aniketos.wp1.ststool.diagram.edit.parts.ThreatEditPart; import eu.aniketos.wp1.ststool.diagram.part.StsToolVisualIDRegistry; /** * Custom editPartFactory Really this class is equal to the one generated by gmf. Was created only to easy extend the EditPartfactory, without modify the generated code */ public class CustomStsToolEditPartFactory { /** * @see org.eclipse.gef.EditPartFactory#createEditPart(EditPart, Object) */ public EditPart createEditPart(EditPart context,Object model){ if (model instanceof View) { View view = (View) model; switch (StsToolVisualIDRegistry.getVisualID(view)) { case OwnEditPart.VISUAL_ID: OwnEditPart ep01 = new OwnEditPart(view); return ep01; case AgentAgentCompartmentEditPart.VISUAL_ID: AgentAgentCompartmentEditPart ep02 = new AgentAgentCompartmentEditPart(view); return ep02; case AgentEditPart.VISUAL_ID: AgentEditPart ep03 = new AgentEditPart(view); return ep03; case PlayEditPart.VISUAL_ID: PlayEditPart ep04 = new PlayEditPart(view); return ep04; case AuthorisationEditPart.VISUAL_ID: AuthorisationEditPart ep05 = new AuthorisationEditPart(view); return ep05; case DelegationEditPart.VISUAL_ID: DelegationEditPart ep06 = new DelegationEditPart(view); return ep06; case EventEditPart.VISUAL_ID: EventEditPart ep07 = new EventEditPart(view); return ep07; case ThreatEditPart.VISUAL_ID: ThreatEditPart ep08 = new ThreatEditPart(view); return ep08; case GoalDecompositionANDEditPart.VISUAL_ID: GoalDecompositionANDEditPart ep09 = new GoalDecompositionANDEditPart(view); return ep09; case GoalDecompositionOREditPart.VISUAL_ID: GoalDecompositionOREditPart ep10 = new GoalDecompositionOREditPart(view); return ep10; case GoalEditPart.VISUAL_ID: GoalEditPart ep11 = new GoalEditPart(view); return ep11; case Goal2EditPart.VISUAL_ID: Goal2EditPart ep12 = new Goal2EditPart(view); return ep12; case NeedEditPart.VISUAL_ID: NeedEditPart ep13 = new NeedEditPart(view); return ep13; case ModifyEditPart.VISUAL_ID: ModifyEditPart ep14 = new ModifyEditPart(view); return ep14; case ProduceEditPart.VISUAL_ID: ProduceEditPart ep15 = new ProduceEditPart(view); return ep15; case IResourceEditPart.VISUAL_ID: IResourceEditPart ep16 = new IResourceEditPart(view); return ep16; case TangibleByEditPart.VISUAL_ID: TangibleByEditPart ep17 = new TangibleByEditPart(view); return ep17; case NegativeGoalContributionEditPart.VISUAL_ID: NegativeGoalContributionEditPart ep18 = new NegativeGoalContributionEditPart(view); return ep18; case PositiveGoalContributionEditPart.VISUAL_ID: PositiveGoalContributionEditPart ep19 = new PositiveGoalContributionEditPart(view); return ep19; case ProvisionEditPart.VISUAL_ID: ProvisionEditPart ep20 = new ProvisionEditPart(view); return ep20; case PartOfEditPart.VISUAL_ID: PartOfEditPart ep21 = new PartOfEditPart(view); return ep21; case RoleEditPart.VISUAL_ID: RoleEditPart ep22 = new RoleEditPart(view); return ep22; case RoleRoleCompartmentEditPart.VISUAL_ID: RoleRoleCompartmentEditPart ep23 = new RoleRoleCompartmentEditPart(view); return ep23; case StsToolDiagramEditPart.VISUAL_ID: return new StsToolDiagramEditPart(view); case TResourceEditPart.VISUAL_ID: TResourceEditPart ep25 = new TResourceEditPart(view); return ep25; case TResource2EditPart.VISUAL_ID: TResource2EditPart ep26 = new TResource2EditPart(view); return ep26; case DependencyEditPart.VISUAL_ID: DependencyEditPart ep27 = new DependencyEditPart(view); return ep27; } } return null; } }