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

Bug 143279

Summary: [Accessibility] No keyboard accessible way to create objects from the Palette
Product: [Tools] GEF Reporter: Syed Atif <syedatif>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Syed Atif CLA 2006-05-23 14:02:56 EDT
There seems to be no keyboard accessible way to create objects from the palette in GEF editors. Hence, all GEF examples seem to lack the basic functionality of creating objects using the keyboard only.

GMF has this issue fixed by extending the CreationTool class from GEF and overriding the handleKeyUp method (originally derived from AbstractTool) [@see org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool].
Comment 1 Steven R. Shaw CLA 2006-05-23 14:21:14 EDT
Yes there is.  You have to use "Ctrl-C" to copy the palette entry, and then "Ctrl-V" to paste onto the diagram editor (after navigating back using the keyboard).  GMF uses a different paradigm then GEF by explicitly invoking creation with a keyboard binding ("Enter").
Comment 2 Randy Hudson CLA 2006-05-23 15:16:15 EDT
Are you referring to:
protected boolean handleKeyUp(KeyEvent e) {
	if (e.keyCode==SWT.Selection){
		setEditDomain(getCurrentViewer().getEditDomain());
		createShapeAt(UNDEFINED_POINT);
		return true;
	}
	return false;
}

I can see several issues with adopting that code as is.

- The solution is not discoverable by the end user.
- It doesn't check for a preceeding keydown event
- It doesn't check if the user is in the middle of a size-on-drop creation with the mouse, in which case ENTER should not interrupt.
- SWT.Selection is not a keyCode constant, but an event type.
- The point (-1, -1) is a valid location in many GEF applications and does not signify undefined location.
- overridden method should invoke super

As Steve pointed out, the application can place Copy and Paste on the context menus for the palette and diagram. This is discoverable. Some applications also add "Insert" the palette's context menu.

Keyboard users can temporarily invoke mousekeys to place the mouse, and to click the location.