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

Bug 128228

Summary: make figures on FigureCanvas selectable
Product: [Tools] GEF Reporter: Jennifer Cormier <jcormier>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: rob
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
SelectableFigureCanvas.java none

Description Jennifer Cormier CLA 2006-02-16 11:02:06 EST
By adding the attached file to draw2d, figures on FigureCanvas's can be made selectable.  This will be very useful to people using draw2d who do not want the overhead of GEF, but do want to utilize Eclipse' selection and context menu features.

The file, SelectableFigureCanvas.java, which implements ISelectionProvider on a FigureCanvas, is attached.

Please consider adding this to org.eclipse.draw2d or another appropriate location within draw2d.  I will be happy to help with documentation or anything else to move this forward because I feel it will be a very valuable addition to Eclipse / draw2d.  There is an interest, as evidenced by many posts including the following:

http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg04320.html

Thanks!
Comment 1 Jennifer Cormier CLA 2006-02-16 11:06:48 EST
Created attachment 34848 [details]
SelectableFigureCanvas.java
Comment 2 Randy Hudson CLA 2006-02-16 11:29:53 EST
If we start adding behavior for selecting figures, what's next? Moving them around? Context menus? This is what the org.eclipse.gef plug-in is for.

Draw2d supports the notion of focus. Selection of a figure is not general enough and infringes on the support provided by the gef plug-in.
Comment 3 Jennifer Cormier CLA 2006-04-14 17:17:45 EDT
I agree that GEF is for editing and the Draw2d canvas is for viewing only.  Creating a FigureCanvas which implements ISelectionProvider further standardizes draw2d as a viewer; Eclipse context menu support is inherited for *free*.  Selection within a SelectableFigureCanvas works just like it does in other viewers such as table viewers and tree viewers - click on something to select it. 
Comment 4 Randy Hudson CLA 2006-04-17 09:05:30 EDT
draw2d does not have any dependencies on JFace.