use of org.eclipse.gmf.runtime.notation.BooleanValueStyle in project statecharts by Yakindu.
the class InlineSubdiagramRefactoring method internalExecute.
@SuppressWarnings("unchecked")
@Override
protected void internalExecute() {
BooleanValueStyle inlineStyle = getInlineStyle(getContextObject());
if (inlineStyle == null) {
inlineStyle = createInlineStyle();
getContextObject().getStyles().add(inlineStyle);
}
inlineStyle.setBooleanValue(true);
View contextView = getContextObject();
State contextElement = (State) contextView.getElement();
Diagram diagramToInline = DiagramPartitioningUtil.getSubDiagram(contextElement);
View containerView = ViewUtil.getChildBySemanticHint(contextView, SemanticHints.STATE_FIGURE_COMPARTMENT);
while (diagramToInline.getChildren().size() > 0) {
containerView.insertChild((View) diagramToInline.getChildren().get(0));
}
while (diagramToInline.getEdges().size() > 0) {
containerView.getDiagram().insertEdge((Edge) diagramToInline.getEdges().get(0));
}
getResource().getContents().remove(diagramToInline);
}
Aggregations