refreshEnablement();
}
private void refreshEnablement()
{
final ISapphirePart part = getPart();
boolean enabled = false;
if( part instanceof DiagramNodePart || part instanceof ShapePart ||
(part instanceof DiagramConnectionPart && ((DiagramConnectionPart)part).removable()))
{
enabled = true;
}
else
{
SapphireDiagramEditorPagePart diagramPart = part.nearest(SapphireDiagramEditorPagePart.class);
List<ISapphirePart> selectedParts = diagramPart.getSelections();
for (ISapphirePart selectedPart : selectedParts)
{
if (selectedPart instanceof DiagramNodePart || selectedPart instanceof ShapePart ||
(selectedPart instanceof DiagramConnectionPart && ((DiagramConnectionPart)selectedPart).removable()))