문제

I implemented adding ports as children to a rectangle Figure/EditPart/Model using the Logic example as a reference. The port Figures display as expected, and debugging shows that the EditParts and Models are created and added to the parent, but the children are not selectable.

In the EditPart for the children, I override isSelectable() to return true.

In the parent I tried overriding createChildEditPolicy() to return NonResizableEditPolicy, by reversing the recommendation for making children not selectable here, but it appears to do nothing. If I install NonResizableEditPolicy as a SELECTION_FEEDBACK_ROLE in the child's EditPart, it is initially selected upon creation, but then cannot be selected later.

Also, when the child's Figure is clicked, the parent is not selected either - it is a dead spot where clicking does not change selection.

Am I missing something to make it selectable, or is it likely something else is interfering?

도움이 되었습니까?

해결책

You can try with debugger to set breakpoint to viewers getEditPartAt(Point) and stepping from there where it goes. This should be triggered when you click on the child.

It might be that there just isn't any selection feedbacks created, so you can also try outputting the viewer.getSelectedEditParts() to check that is the selection actually there, but the feedback missing.

다른 팁

I meet the same issue , and fix it in the way : try to install a suitable policy in the editpart.

   @Override
   protected void createEditPolicies() {
       installEditPolicy(EditPolicy.LAYOUT_ROLE, yourEditPolicy());
   }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top