How to Use Arrow Keys Alone to Expand Tree Node in Package Explorer in Eclipse on Linux

Is it possible to use arrow keys alone to expand tree node in package explorer in Eclipse on Linux?

My version for GTK3 that behaves in more natural way.
Add the following to ~/.config/gtk-3.0/gtk.css:

@binding-set MyTreeViewBinding
{
bind "Left" { "select-cursor-parent" ()
"expand-collapse-cursor-row" (0,0,0) };
bind "Right" { "expand-collapse-cursor-row" (0,1,0) };
}

GtkTreeView
{
gtk-key-bindings: MyTreeViewBinding;
}

Expand tree nodes with right and left arrow keys on Eclipse

I do not know which shortcut entry in Eclipse but when you use the Eclipse on Ubuntu, you can get the same behaviour with shift + left/right arrow keys instead of onyl left/right arrow keys.

In order to change the behaviour on Ubuntu, please have a look at this post and the answer of @big data nerd should work on newer versions of Ubuntu (tested)

I hope this helps.

Navigation in Call Hierarchy using arrow keys in Eclipse on Linux Mint

Kudos to @Meogi! I followed the link @Meogi referenced in the comment.

Modified both gtk configs for gtk-2.0 and gtk-3 located in mine at:

~/.config/gtkrc-2.0
and
~/.config/gtk-3.0/gtk.css

And it worked like a charm.

Find below exact config for : ~/.config/gtkrc-2.0

binding "gtk-binding-tree-view" {
bind "j" { "move-cursor" (display-lines, 1) }
bind "k" { "move-cursor" (display-lines, -1) }
bind "h" { "expand-collapse-cursor-row" (1,0,0) }
bind "l" { "expand-collapse-cursor-row" (1,1,0) }
bind "o" { "move-cursor" (pages, 1) }
bind "u" { "move-cursor" (pages, -1) }
bind "g" { "move-cursor" (buffer-ends, -1) }
bind "y" { "move-cursor" (buffer-ends, 1) }
bind "p" { "select-cursor-parent" () }
bind "Left" { "expand-collapse-cursor-row" (0,0,0) }
bind "Right" { "expand-collapse-cursor-row" (0,1,0) }
bind "semicolon" { "expand-collapse-cursor-row" (0,1,1) }
bind "slash" { "start-interactive-search" () }
}
class "GtkTreeView" binding "gtk-binding-tree-view"

and ~/.config/gtk-3.0/gtk.css

@binding-set MyTreeViewBinding
{
bind "Left" { "expand-collapse-cursor-row" (0,0,0) };
bind "Right" { "expand-collapse-cursor-row" (0,1,0) };
}

GtkTreeView
{
gtk-key-bindings: MyTreeViewBinding;
}

Eclipse project explorer expand on startup

Found it! If you click the "Link with Editor" (the button that has a left arrow over a right arrow) button in the Project Explorer, it expands the tree in the project explorer to the file you're currently editing. This is a toggle button and its state is saved when closing Eclipse. So when you open it back up, your project explorer is expanded to the file that is currently open.

How to navigate to parent folder of current file in Project Explorer view using keyboard shortcut in Eclipse IDE?

Finally, I found the answer! I combined answers from this post, restarted GNOME shell, restarted eclipse and it worked:

Edit ~/.config/gtk-3.0/gtk.css (create if doesn't exist):

@binding-set MyTreeViewBinding
{
bind "<shift>Left" { "select-cursor-parent" () };
bind "Left" { "expand-collapse-cursor-row" (0,0,0) };
bind "Right" { "expand-collapse-cursor-row" (0,1,0) };
}

treeview
{
-gtk-key-bindings: MyTreeViewBinding;
}

To restart the GNOME shell: hit ALT + F2.

Applying this solution will add the following functionality:

  • SHIFT + : Go to parent.
  • : collapse current item.
  • : expand current item.

I came up with the steps of restarting GNOME shell and eclipse. Not sure if just changing the configurations would do the trick right away or not. Haven't tried it :D

I'm using GNU/Linux Ubuntu 18.04.4 LTS.

eclipse package explorer: file node duplicates type node?

@Wolfgang, I agree with your rationale. For vast majority of cases, there is a 1-to-1 mapping between a .java file and its contained type. While it is possible to have multiple top-level types in one .java file, this practice is not common, especially after advent of inner types. Arguably, even if you are using multiple top-level types feature, explicit relationship to the .java file is not that important. If you delete all types in a file, the file can go away.

Unfortunately, there is no option to suppress .java file nodes. I suspect that this is mostly for historic inertia reasons. The various navigational views started as basic file navigators way back when.

I would suggest opening enhancement request for Eclipse Java Developer Tools.

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT

Eclipse switches @ and

If you have several language layouts on the computer you are probably switching on them.

What OS are you using?
If Windows 7 the shortcut is ctrl + shift
http://www.tomshardware.com/forum/10444-63-shortcut-keys-keyboard-language-changing

If you're using windows XP i think the shortcut was alt + shift



Related Topics



Leave a reply



Submit