Object o = getBusinessObjectForPictogramElement(pe);
//Need to handle both pes and literals here
if (Utility.isObjectLiteral(o) || o instanceof LocalVariableStatement) {
IDirectEditingInfo directEditingInfo =
getFeatureProvider().getDirectEditingInfo();
// set container shape for direct editing after object creation
directEditingInfo.setMainPictogramElement(pe);
// set shape and graphics algorithm where the editor for
// direct editing shall be opened after object creation
Shape textShape = null;
if (pe instanceof ContainerShape) {
//Need to find child shape
List<Shape> shapes = ((ContainerShape) pe).getChildren();
for (Shape s : shapes) {
if (s.getGraphicsAlgorithm() instanceof AbstractText) {
textShape = s;
break;
}
}
}
if (textShape != null) {
//pe should be shape and ga text
directEditingInfo.setPictogramElement(textShape);
directEditingInfo.setGraphicsAlgorithm(
textShape.getGraphicsAlgorithm());
directEditingInfo.setActive(true);
getDiagramEditor().refresh();
}
}
}