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

Bug 493617

Summary: Feedback and handle colors should be provided by the IViewer.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) RC1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 481677    

Description Matthias Wienand CLA 2016-05-13 07:21:34 EDT
Currently, feedback and handle colors are defined via named bindings. However, the colors should be exchangeable per viewer. Therefore, the named bindings need to be replaced by provider bindings at the viewer.
Comment 1 Matthias Wienand CLA 2016-05-13 07:31:34 EDT
The mechanism was recently refactored in the context of bug #493180. However, for the palette (see bug #481677) other colors should be used, which is not easily achievable using named bindings.
Comment 2 Matthias Wienand CLA 2016-05-13 08:45:29 EDT
I removed the named bindings and ensured that the colors are now determined by querying a Provider<Color> that is registered at the IViewer under a specific role depending on the usage (i.e. hover feedback color, selection feedback color, etc.).

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

The following listing contains all related API changes (removal indicated by "-", addition indicated by "+").

FXCreationMenuOnClickPolicy:
+ protected Color getHighlightColor()

MvcFxModule:
- protected void bindFocusFeedbackColor()
- protected void bindHoverFeedbackColor()
- protected void bindInsertHandleColor()
- protected void bindMoveHandleColor()
- protected void bindPrimarySelectionFeedbackColor()
- protected void bindSecondarySelectionFeedbackColor()

AbstractFXSegmentHandlePart:
+ protected Color getConnectedFill()
+ protected Color getInsertFill()
+ protected Color getMoveFill()
+ protected Color getStroke()

FXDefaultFocusFeedbackPartFactory:
- public static final String FOCUS_FEEDBACK_COLOR
+ public static final String FOCUS_FEEDBACK_COLOR_PROVIDER
+ public static final Color DEFAULT_FOCUS_FEEDBACK_COLOR

FXDefaultHoverFeedbackPartFactory:
- public static final String HOVER_FEEDBACK_COLOR
+ public static final String HOVER_FEEDBACK_COLOR_PROVIDER
+ public static final Color DEFAULT_HOVER_FEEDBACK_COLOR

FXDefaultSelectionFeedbackPartFactory:
- public static final String PRIMARY_SELECTION_FEEDBACK_COLOR
+ public static final String PRIMARY_SELECTION_FEEDBACK_COLOR_PROVIDER
+ public static final Color DEFAULT_PRIMARY_SELECTION_FEEDBACK_COLOR
- public static final String SECONDARY_SELECTION_FEEDBACK_COLOR
+ public static final String SECONDARY_SELECTION_FEEDBACK_COLOR_PROVIDER
+ public static final Color DEFAULT_SECONDARY_SELECTION_FEEDBACK_COLOR

FXDefaultSelectionHandlePartFactory:
- public static final String INSERT_HANDLE_COLOR
+ public static final String INSERT_HANDLE_COLOR_PROVIDER
- public static final String MOVE_HANDLE_COLOR
+ public static final Color DEFAULT_INSERT_HANDLE_COLOR
+ public static final String MOVE_HANDLE_COLOR_PROVIDER
+ public static final Color DEFAULT_MOVE_HANDLE_COLOR
+ public static final String CONNECTED_HANDLE_COLOR_PROVIDER
+ public static final Color DEFAULT_CONNECTED_HANDLE_COLOR

FXFocusFeedbackPart:
+ protected Color getFocusStroke()

FXHoverFeedbackPart:
+ protected Color getHoverStroke()

FXSelectionFeedbackPart:
+ protected Color getPrimarySelectionColor()
+ protected Color getSecondarySelectionColor()

FXMarqueeOnDragPolicy:
+ protected Color getPrimarySelectionColor()