DiagramNodePart nodePart = null;
DiagramConnectionPart connPart = null;
if (sapphirePart instanceof DiagramNodePart)
{
nodePart = (DiagramNodePart)sapphirePart;
DiagramNodeModel nodeModel = this.getDiagramModel().getDiagramNodeModel(nodePart);
editpartObj = viewer.getEditPartRegistry().get(nodeModel);
}
else if (sapphirePart instanceof ShapePart)
{
nodePart = sapphirePart.nearest(DiagramNodePart.class);
DiagramNodeModel nodeModel = this.getDiagramModel().getDiagramNodeModel(nodePart);
ShapeModel shapeModel = ShapeModelUtil.getChildShapeModel(nodeModel.getShapeModel(), (ShapePart)sapphirePart);
editpartObj = viewer.getEditPartRegistry().get(shapeModel);
}
else if (sapphirePart instanceof DiagramConnectionPart)
{
connPart = (DiagramConnectionPart)sapphirePart;