EditPart part = getViewer().getContents();
if (part instanceof ActivityDiagramPart) {
ActivityDiagramPart diagramPart = (ActivityDiagramPart) part;
direction = diagramPart.getDirection();
}
CollapsibleContainerFigure figure = new CollapsibleContainerFigure(direction);
figure.addActionListener(this);
return figure;
}