Community
Participate
Working Groups
There's currently no way to expand/collapse the folding annotations without using the mouse. There needs to be a way to do this via the keyboard. Eclipse uses Ctrl+(Numpad{+,-,*,/}) to expand/collapse (all). This might not be a good choice because it does override the font size keybinding in browsers, though you are able to do it anyway with the other +,- keys.
Here is a first attempt. Silenio, could you please review? It's in the bug377572 branch. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=bug377572&id=49dff5ea3795c95d33aff4b467206685907c67ac
Code is fine. Here are a few things that could/should be improved: 1) Use view.setRedraw(true)/setRedraw(false) to speed up collapseAll and expandAll. Take a look at demoSetup.js. When there many folding regions (textView.js for example), it is a big improvement. 2) We need to keep the top index line constant after collapsing or expanding, otherwise the user will be lost. 3) Put the caret inside of a comment. Ctrl+- to collapse it. Caret is place in the first line after the collapsed comment. I should be able to hit Ctrl++ to expand it again. Works in Eclipse. 4) Ctrl+- and Ctrl++ on IE 9 still zoom in and out. Can we avoid this?
Created attachment 221713 [details] patch-1 I was unable to find a way to patch using orion, and unable to find my way to get it work with git hub. So, attached the patch here directly...
(In reply to comment #2) Updated the patch to the latest code and made the following changes: > Code is fine. Here are a few things that could/should be improved: > > 1) Use view.setRedraw(true)/setRedraw(false) to speed up collapseAll and > expandAll. Take a look at demoSetup.js. When there many folding regions > (textView.js for example), it is a big improvement. > done. > 2) We need to keep the top index line constant after collapsing or > expanding, otherwise the user will be lost. > I didn't notice this problem. Expanding/collapsing doesn't change the top index line. > 3) Put the caret inside of a comment. Ctrl+- to collapse it. Caret is place > in the first line after the collapsed comment. I should be able to hit > Ctrl++ to expand it again. Works in Eclipse. > To fix this, the patch moves the caret to first line of the annotation, instead of, to the next line. So, the behavior is same no matter from which line you collapse. > 4) Ctrl+- and Ctrl++ on IE 9 still zoom in and out. Can we avoid this? Don't have this setup yet. Will setup IE9 and try it out. There is a problem with using numpad keys for shortcut, when using the Mac. They aren't available on the mac book and newer mac keyboards. There is no way to emulate it, without using external apps. With eclipse, I guess, this wasn't a problem because we could rebind the keys using the preferences. I tried to use Ctrl++ and Ctrl+-, but that doesn't seem to work. So, I've temporarily mapped to different keys. Silenio, what do you think we should do here?
I have pushed the patch to github --> https://github.com/lshanmug/orion.client/commit/4ce0afa16a5cc55383ec0a1f294bb73d9bf68ef0 I tried the patch on IE9 setup and can see the zoom problem. Should we add conditional code for IE9? I think we can use a different keybinding, so that the mac problem is also resolved.
- Need to add the NON-NLS tags (there is a plugin to flag those as warnings. Use the Get Plugins navigation link to install it) - Let's not add the new API in FoldingAnnotation.getStartOffset() at this point (RC2). Just inline the code. - Even though these are the eclipse key bindings, I think we should not use Ctrl+NUMPAD_PLUS and Ctrl+NUMPAD_MINUS anywhere as they overwrite the user agent Zoom In/Out key bindings. This would fix the IE problem. Would these work: Ctrl+NUMPAD_DIVIDE -> collapse Ctrl+NUMPAD_MULTIPLY -> expand Ctrl+Shift+NUMPAD_DIVIDE -> collapseAll Ctrl+Shift+NUMPAD_MULTIPLY -> expandAll - The key assist panel (Alt+Shift+?) does not show the NLSed names of the actions. Need to change web/orion/editor/nls/messages.js file as well. - In order to see problem 2), you have to be scrolled away from the beginning of the file. Open textView.js, Ctrl+End, Ctrl+NUMPAD_DIVIDE. - Collapse does not work for the copyright comment of textView.js if the caret is in the middle of the comment (not at zero). Need to hit the action twice for it to work.
(In reply to comment #6) > > - Even though these are the eclipse key bindings, I think we should not use > Ctrl+NUMPAD_PLUS and Ctrl+NUMPAD_MINUS anywhere as they overwrite the user > agent Zoom In/Out key bindings. This would fix the IE problem. Would these > work: > > Ctrl+NUMPAD_DIVIDE -> collapse > Ctrl+NUMPAD_MULTIPLY -> expand > Ctrl+Shift+NUMPAD_DIVIDE -> collapseAll > Ctrl+Shift+NUMPAD_MULTIPLY -> expandAll > Hi Silenio, The one problem with using Numpad keys is that we have use a different shortcut keys on mac, since they don't have the numpad keys.
(In reply to comment #7) > (In reply to comment #6) > > > > - Even though these are the eclipse key bindings, I think we should not use > > Ctrl+NUMPAD_PLUS and Ctrl+NUMPAD_MINUS anywhere as they overwrite the user > > agent Zoom In/Out key bindings. This would fix the IE problem. Would these > > work: > > > > Ctrl+NUMPAD_DIVIDE -> collapse > > Ctrl+NUMPAD_MULTIPLY -> expand > > Ctrl+Shift+NUMPAD_DIVIDE -> collapseAll > > Ctrl+Shift+NUMPAD_MULTIPLY -> expandAll > > > Hi Silenio, > The one problem with using Numpad keys is that we have use a different > shortcut keys on mac, since they don't have the numpad keys. Maybe these everywhere (windows and mac). Ctrl+Alt+c - collapse Ctrl+Alt+e - expand Ctrl+Alt+Shift+c - collapseAll Ctrl+Alt+Shift+e - expandAll
Created attachment 222247 [details] patch-2 Modified patch
(In reply to comment #6) Patch fixes all problems in comment #6. Problem 2) from comment #2 is not reproducible with latest code. The top index seems to change only on collapse all and collapse all. (In reply to comment #8) > Maybe these everywhere (windows and mac). > > Ctrl+Alt+c - collapse > Ctrl+Alt+e - expand > Ctrl+Alt+Shift+c - collapseAll > Ctrl+Alt+Shift+e - expandAll Modified the patch to use the above shortcuts on windows and Cmd instead of Ctrl on Mac. (because most of the other shortcuts use Cmd on Mac)
Thanks very much Lakshmi. The patch is good. I have pushed it http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=e70490500beb906216a712999759c91b5f2559e4