blob: b8edda5cc93095a075126c58125a1707757924fa [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 ALL4TEC.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thanh Liem PHAN (ALL4TEC) - initial API and implementation
*******************************************************************************/
package org.eclipse.opencert.infra.dashboard.pages.adapters;
import org.eclipse.opencert.infra.dashboard.helpers.ChessPapyrusHelper;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.sysml.diagram.requirement.RequirementDiagramCreateCommand;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.PackageableElement;
/**
* A {@link HyperlinkAdapter} to create a new CHESS requirement diagram.
*/
public class CreateNewChessRequirementDiagram extends AbstractCreateNewChessDiagramHyperLinkAdapter {
/**
* {@inheritDoc}
*/
@Override
protected ICreationCommand getDiagramCreationCommand() {
return new RequirementDiagramCreateCommand();
}
/**
* {@inheritDoc}
*/
@Override
protected PackageableElement getTargetElement(final Model pRootModel) {
return ChessPapyrusHelper.INSTANCE.getPackageFromModelByName(pRootModel,
ChessPapyrusHelper.MODEL_REQUIREMENT_VIEW_NAME);
}
}