blob: dc9569f99a43613541957f800e98ffb907b16459 [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.Package;
/**
* 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 Package getTargetPackage(final Model pRootModel) {
// TODO Auto-generated method stub
return ChessPapyrusHelper.INSTANCE.getPackageFromModelByName(pRootModel,
ChessPapyrusHelper.MODEL_REQUIREMENT_VIEW_NAME);
}
}