Proof of Concept SwitchPane Plugin
Submitted by Tuesday, 16 March, 2004 - 04:59
on
Hi,
I've wanted jEdit to have an Alt-Tab window switcher
(like on Windows and Mac) for edit panes for a while
now. That is, you'd cycle through windows, but the
order changes based on which windows receive focus, so
you can quickly switch between 2-3 windows.
This weekend, I hacked together this proof of concept
plugin to demonstrate the idea. After bumping my head
on the various KeyEvent workarounds and AWT warts, I
finally got it to work.
http://www.stanford.edu/~adraken/SwitchPane.jar
Just drop it in your jars/ directory and restart
jEdit. Use CTRL-BACKQUOTE (Ctrl-`) to switch between
edit panes.
The keyboard shortcut is hardcoded in and there are no
actions or options. But, if you like it and would like
to spend some time polishing it, the source is in the
JAR. Go for it.
Have fun.
Dave
P.S. I had to bypass the keyboard shortcut framework
because there was no other way for the plugin to know
when you let go of the modifier key. If you're still
confused, play with the real thing (Alt-Tab) and
notice how it behaves. But because I did that, we
can't use TAB as the action key (no Ctrl-Tab) because
View.processKeyEvent consumes any KEY_PRESSED event
for TAB.
P.P.S. Lee Turner's SwitchBuffer served as a basic
template for building this plugin. Thanks.
I've wanted jEdit to have an Alt-Tab window switcher
(like on Windows and Mac) for edit panes for a while
now. That is, you'd cycle through windows, but the
order changes based on which windows receive focus, so
you can quickly switch between 2-3 windows.
This weekend, I hacked together this proof of concept
plugin to demonstrate the idea. After bumping my head
on the various KeyEvent workarounds and AWT warts, I
finally got it to work.
http://www.stanford.edu/~adraken/SwitchPane.jar
Just drop it in your jars/ directory and restart
jEdit. Use CTRL-BACKQUOTE (Ctrl-`) to switch between
edit panes.
The keyboard shortcut is hardcoded in and there are no
actions or options. But, if you like it and would like
to spend some time polishing it, the source is in the
JAR. Go for it.
Have fun.
Dave
P.S. I had to bypass the keyboard shortcut framework
because there was no other way for the plugin to know
when you let go of the modifier key. If you're still
confused, play with the real thing (Alt-Tab) and
notice how it behaves. But because I did that, we
can't use TAB as the action key (no Ctrl-Tab) because
View.processKeyEvent consumes any KEY_PRESSED event
for TAB.
P.P.S. Lee Turner's SwitchBuffer served as a basic
template for building this plugin. Thanks.