Community
Participate
Working Groups
This result appeared when extending method "isSelectable()" with "hasFocus()" for testing purposes. The method delivered always false, even when the diagram editor has had focus. Note: ShapeEditPart extends gef.editparts.AbstractEditPart.
For me this method works correct. For testing the correct behaviour you can override the method "hasFocus()" in ShapeEditPart with: @Override public boolean hasFocus() { boolean ret = super.hasFocus(); if (ret) { if (getPictogramElement().getGraphicsAlgorithm() instanceof org.eclipse.graphiti.mm.algorithms.Rectangle) { EList<GraphicsAlgorithm> gaChildren = getPictogramElement().getGraphicsAlgorithm().getGraphicsAlgorithmChildren(); if (gaChildren.size() > 0 && gaChildren.get(0) instanceof Text) { Text t = (Text) gaChildren.get(0); System.out.println("ShapeEditPart.hasFocus() " + t.getValue()); } } } return ret; }
You must test this with the sketch editor. Create some objects of type "Rectangle Single Text". Then change simply the focus between these edit parts and you will see the output in the console.
No bug