* @return ContextButtonPadData in which the actions are splitted into two sets
*/
private ContextButtonPadData getContextButtonPad(List<GraphicalEditPart> editParts)
{
ContextButtonPadData contextButtonPadData = new ContextButtonPadData();
DiagramNodeEditPart nodeEditPart = ((ShapeEditPart)editParts.get(0)).getNodeEditPart();
if (nodeEditPart == null)
{
return contextButtonPadData;
}
org.eclipse.draw2d.geometry.Rectangle bounds = nodeEditPart.getFigure().getBounds();
Point loc = bounds.getLocation();
Point botRight = bounds.getBottomRight();
contextButtonPadData.getPadLocation().set(loc.x, loc.y,
botRight.x - loc.x, botRight.y - loc.y);
SapphireActionGroup actionGroup = null;
if (editParts.size() == 1)
{
ShapeEditPart shapeEditPart = (ShapeEditPart)editParts.get(0);
if (shapeEditPart instanceof DiagramNodeEditPart)
{
DiagramNodePart nodePart = nodeEditPart.getCastedModel().getModelPart();
actionGroup = nodePart.getActions(SapphireActionSystem.CONTEXT_DIAGRAM_NODE);
}
else
{
ShapePart shapePart = (ShapePart)((ShapeModel)shapeEditPart.getModel()).getSapphirePart();