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

Bug 399004

Summary: common code to attach all the key bindings to clickable items
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 3.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2013-01-24 13:12:53 EST
We have a common function for creating a button that looks like our command buttons, attaches all the accessibility roles, keyboard triggers, etc.

However...we aren't using it everywhere because in some places we already have a button from a template and then we add all that stuff using copied code.  

In fixing bug 398992, I found 8 places besides the common function that are doing this kind of thing.  The right answer is to refactor a bit so that all these users can use common code.  I didn't want to do this as we are building M2, but will do it in RC1.
Comment 1 Susan McCourt CLA 2013-01-24 13:17:49 EST
In w3c web component lingo, the keyboard event handlers and accessibility roles would be packaged as a decorator that just got marked up when you defined the button.
Comment 2 Susan McCourt CLA 2013-02-27 16:30:49 EST
Fixed in http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=abd8670d8a019c3ef890e17c85de2efc1b314627

I took a slightly different approach here.  I tried to make all buttons be real buttons (vs. spans) where possible.  Then we don't need to attach the accessibility/keyboard enabling code because you get it for free in the browser.  In the past we were having problems with the user agent styles for buttons, but I was able to style them to look the same and convert most of our spans to real buttons.

There are still a few places where spans are used (such as menu items) and these are now sharing code.