|
|
Re: Selecting a node after creation [message #1822394 is a reply to message #1821419] |
Thu, 05 March 2020 15:54 |
|
Hi Ken,
the new part should be selected by default (so no need for manually setting the selection):
- CreationPolicy#create(content, parent, anchoreds) delegates to create(content, parent, anchoreds, doFocus=true, doSelect=true).
- A SelectOperation is constructed to perform changing the selection (so that it will be undoable).
You can test that this is the case by observing the state of SelectionModel (i.e. register ListChangeListener on getSelection()). It might seem like the selection is not changed if the selection is cleared shortly after. This could happen, for example, if another handler is executed after the CreateOnClickHandler.
Selection feedback construction works as follows:
- SelectionModel is changed (it is observable)
- SelectionBehavior observes that change
(- Feedback and Handles are destroyed or created, depending on the change)
- DefaultSelectionFeedbackPartFactory is used to create selection feedback parts (by default, only the primary selection will have feedback)
!!! - Selection Feedback Geometry Provider is queried from the part !!! this could be missing for the newly created part -> look into the module and compare part bindings with another part where selection works fine
- SelectionFeedbackPart is created to show the feedback geometry
(- Primary Selection Feedback Color Provider can be used to change the selection color for different parts)
All of these are exchangeable, i.e. you can, for example, subclass DefaultSelectionFeedbackPartFactory and change the binding in your module, in order to adjust selection feedback part creation.
Best regards,
Matthias
[Updated on: Thu, 05 March 2020 15:55] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03244 seconds