use of org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation in project Palladio-Editors-Sirius by PalladioSimulator.
the class LinkingResourceEditPolicyProvider method provides.
@Override
public boolean provides(final IOperation operation) {
if (operation instanceof CreateEditPoliciesOperation) {
final CreateEditPoliciesOperation castedOperation = (CreateEditPoliciesOperation) operation;
final EditPart editPart = castedOperation.getEditPart();
final Object model = editPart.getModel();
if (model instanceof View) {
final View view = (View) model;
// FIXME find right constraints for this filter
if (view.getDiagram() != null && view.getDiagram().getElement() != null && view.getDiagram().getElement().eClass().getEPackage().getNsURI().equals(DiagramPackage.eINSTANCE.getNsURI())) {
if (("SomeVisualID").equals(view.getType())) {
return true;
}
}
}
}
return false;
}
Aggregations