1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-05 13:16:13 +03:00

Reintroduced 'Next Tab' and 'Prev Tab' click actions

This commit is contained in:
Cristian Maglie
2014-02-01 19:30:52 +01:00
parent 79ab98fef9
commit bbd3782a9c

View File

@@ -34,6 +34,7 @@ import javax.swing.*;
/** /**
* Sketch tabs at the top of the editor window. * Sketch tabs at the top of the editor window.
*/ */
@SuppressWarnings("serial")
public class EditorHeader extends JComponent { public class EditorHeader extends JComponent {
static Color backgroundColor; static Color backgroundColor;
static Color textColor[] = new Color[2]; static Color textColor[] = new Color[2];
@@ -326,30 +327,27 @@ public class EditorHeader extends JComponent {
// KeyEvent.VK_LEFT and VK_RIGHT will make Windows beep // KeyEvent.VK_LEFT and VK_RIGHT will make Windows beep
item = new JMenuItem(_("Previous Tab")); item = new JMenuItem(_("Previous Tab"));
KeyStroke ctrlAltLeft = KeyStroke ctrlAltLeft = KeyStroke
KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, Editor.SHORTCUT_ALT_KEY_MASK); .getKeyStroke(KeyEvent.VK_LEFT, Editor.SHORTCUT_ALT_KEY_MASK);
item.setAccelerator(ctrlAltLeft); item.setAccelerator(ctrlAltLeft);
// this didn't want to work consistently
/*
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { @Override
editor.sketch.prevCode(); public void actionPerformed(ActionEvent e) {
} editor.sketch.handlePrevCode();
}); }
*/ });
menu.add(item); menu.add(item);
item = new JMenuItem(_("Next Tab")); item = new JMenuItem(_("Next Tab"));
KeyStroke ctrlAltRight = KeyStroke ctrlAltRight = KeyStroke
KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, Editor.SHORTCUT_ALT_KEY_MASK); .getKeyStroke(KeyEvent.VK_RIGHT, Editor.SHORTCUT_ALT_KEY_MASK);
item.setAccelerator(ctrlAltRight); item.setAccelerator(ctrlAltRight);
/*
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { @Override
editor.sketch.nextCode(); public void actionPerformed(ActionEvent e) {
} editor.sketch.handleNextCode();
}); }
*/ });
menu.add(item); menu.add(item);
Sketch sketch = editor.getSketch(); Sketch sketch = editor.getSketch();