MCPcopy
hub / github.com/arduino/Arduino / Actions

Class Actions

app/src/processing/app/EditorHeader.java:89–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 int imageW, imageH;
88
89 public class Actions {
90 public final Action newTab = new SimpleAction(tr("New Tab"),
91 Keys.ctrlShift(KeyEvent.VK_N),
92 () -> editor.getSketchController().handleNewCode());
93
94 public final Action renameTab = new SimpleAction(tr("Rename"),
95 () -> editor.getSketchController().handleRenameCode());
96
97 public final Action deleteTab = new SimpleAction(tr("Delete"), () -> {
98 try {
99 editor.getSketchController().handleDeleteCode();
100 } catch (IOException e) {
101 e.printStackTrace();
102 }
103 });
104
105 public final Action prevTab = new SimpleAction(tr("Previous Tab"),
106 Keys.ctrlAlt(KeyEvent.VK_LEFT), () -> editor.selectPrevTab());
107
108 public final Action nextTab = new SimpleAction(tr("Next Tab"),
109 Keys.ctrlAlt(KeyEvent.VK_RIGHT), () -> editor.selectNextTab());
110
111 Actions() {
112 // Explicitly bind keybindings for the actions with accelerators above
113 // Normally, this happens automatically for any actions bound to menu
114 // items, but only for menus attached to a window, not for popup menus.
115 Keys.bind(EditorHeader.this, newTab);
116 Keys.bind(EditorHeader.this, prevTab);
117 Keys.bind(EditorHeader.this, nextTab);
118
119 // Add alternative keybindings to switch tabs
120 Keys.bind(EditorHeader.this, prevTab, Keys.ctrlShift(KeyEvent.VK_TAB));
121 Keys.bind(EditorHeader.this, nextTab, Keys.ctrl(KeyEvent.VK_TAB));
122 }
123 }
124 public Actions actions = new Actions();
125
126 /**

Callers

nothing calls this directly

Calls 10

ctrlShiftMethod · 0.95
ctrlAltMethod · 0.95
trMethod · 0.80
handleNewCodeMethod · 0.80
getSketchControllerMethod · 0.80
handleRenameCodeMethod · 0.80
handleDeleteCodeMethod · 0.80
printStackTraceMethod · 0.80
selectPrevTabMethod · 0.80
selectNextTabMethod · 0.80

Tested by

no test coverage detected