Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 487070

Summary: Provide a mechanism to query the selectability and focusability of an IContentPart.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: nyssen
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) M6   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2016-02-03 03:50:47 EST
Currently, a content part is only selectable if an interaction policy is bound that selects that part, and a content part is only focusable if an interaction policy is bound that focuses that part. However, when implementing an interaction policy that is not bound per part, but instead, for example, only once on the root part, and this interaction policy should focus or select a content part, then the focusability and selectability cannot be managed via the bindings anymore. Therefore, a mechanism should be provided to query the selectability and focusability of a content part.
Comment 1 Matthias Wienand CLA 2016-02-04 12:21:00 EST
Since selection and focus are generic concepts, I added query methods for the selectability and focusability to IContentPart, and adjusted the corresponding interaction policies (FXFocusAndSelectOnClick, FXMarqueeOnDrag, FXSelectOnType) so that only selectable content parts are selected, and only focusable content parts are focused.

 + IContentPart#isSelectable():boolean
 + IContentPart#isFocusable():boolean

The default implementation within AbstractContentPart returns true for both methods. However, in the Logo example, I ensured that the FXGeometricModelPart is not focusable, so that it is skipped when traversing keyboard focus.

The code is published on the master branch. Therefore, I resolve this ticket as fixed for 4.0.0 M6.