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

Bug 481677

Summary: Enhance MVC logo example to provide a palette for object creation.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: cletavernier, ctg, matthias.wienand
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) RC1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 480489, 493617    
Bug Blocks:    

Description Alexander Nyßen CLA 2015-11-09 02:29:56 EST
Up to now, creation of new items is only possible via the context menu. We should enhance the example to provide a palette, which allows some prototype-based creation through drag-and-drop. In contrast to GEF 3.x the palette should render a minimized version of the actual element visualizations rather than providing icons.
Comment 1 Alexander Nyßen CLA 2015-11-09 02:32:25 EST
The intended way to realize this would be to have a second FXViewer for the palette, using an JavaFX splitter to arrange both. This approach is currently blocked by bug #480489, as it prevents mouse events from reaching both viewers in such a scenario.
Comment 2 Alexander Nyßen CLA 2016-04-10 09:54:48 EDT
I added support for "role-base" adapter injection. This way, we can now defined bindings for several FXViewer instances by using the respective viewer role in the adapter map bindings. Up to now, the mechanism requires that type keys are specified for all adapters that are injected role-based, as we cannot infer their types from the bindings yet. I will try to enhance this, so we have the same 'comfort' for role-based bindings.
Comment 3 Matthias Wienand CLA 2016-05-13 09:50:22 EDT
I added a palette viewer to the MVC Logo example. Per default, the palette is hidden. A palette indicator is anchored to the left of the content viewer. When the indicator is hovered, the palette is opened and elements can be dragged into the content viewer.

The changes are published on the master branch. Therfore, 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 "+").

InfiniteCanvas:
- protected ScrollBar getHorizontalScrollBar()
+ public ScrollBar getHorizontalScrollBar()
- protected ScrollBar getVerticalScrollBar()
+ public ScrollBar getVerticalScrollBar()

MvcFxModule:
+ protected void bindContentModelAsContentViewerAdapter(MapBinder)
+ protected void bindGridModelAsContentViewerAdapter(MapBinder)
+ protected void bindFXRootPartAsContentViewerAdapter(MapBinder)
- protected void bindInsertHandleColor()
+ protected void bindContentViewerRootPartAdapters(MapBinder)
- protected void bindFocusFeedbackColor()
- protected void bindFXRootPartAdapters(MapBinder)
- protected void bindMoveHandleColor()
- protected void bindPrimarySelectionFeedbackColor()
- protected void bindSecondarySelectionFeedbackColor()