| Summary: | "hasFocus()" from class ShapeEditPart returns wrong result | ||
|---|---|---|---|
| Product: | [Modeling] Graphiti | Reporter: | Juergen Pasch <juergen.pasch> |
| Component: | Core | Assignee: | Project Inbox <graphiti-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.gorning, michael.wenz |
| Version: | 0.8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Juergen Pasch
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 |