1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00
Commit Graph

5698 Commits

Author SHA1 Message Date
Matthijs Kooijman
7eea624dfa Remove EditorListener class
It did not contain any actual code anymore, so it can be removed, along
with the infrastructure for setting it up.
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
ac66a9c64a Change workaround for ctrl-slash handling in RSyntaxTextArea
Previously, there was a handler on the text area that consumed most
KEY_TYPED events with control pressed. This was added a long time ago to
fix a problem with ctrl-slash doing both the toggle comment action and
inserting a /. Further investigation shows that with RSyntaxTextArea
this problem is still present, but is caused by a weird binding on the
slash key that Arduino is not even using. Removing that binding is a
cleaner workaround for this problem, so this commit switches to that
workaround.

Ideally this would be fixed in RSyntaxTextArea, see
https://github.com/bobbylight/RSyntaxTextArea/issues/157
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
f06820713e Make ctrl-tab and ctrl-shift-tab work again
In the previous commit, these bindings were moved to EditorTab and
registered in a cleaner way, but this move also allows more components
to hijack these keystrokes and prevent them from reaching EditorTab.

This commit makes the keybindings work again, by preventing other
components from handling the keys. In particular:
 - JSplitPane had a binding to switch between its two panes, which is
   now removed after creating the JSplitPane.
 - The default focus traversal manager in Swing uses these keys to
   traverse focus (in addition to the the normal tab and shift-tab
   keys). By removing these keys from the set of "focus traversal keys"
   defined for the window, this should be prevented when the focus is on
   any component inside the window.
 - JTextPane didn't respond to the previous modification of the
   window-default focus traversal keys, since it defines its own set (to
   only contain ctrl-tab and ctrl-shift-tab, but not tab and shift-tab,
   for undocumented reasons). To fix this, focus traversal is simply
   disabled on the JTextPane, since this wasn't really being used
   anyway.

There was some code in SketchTextArea that tried to modify the focus
traversal keys for just the text area, which is now removed. This code
wasn't really useful, since focus traversal is disabled for the text
area already. Also, the code contained a bug where it would not actually
set the new set of keys for the backward focus traversal.

Closes #195
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
fc4b2028fa Move ctrl-tab and ctrl-shift-tab handling into EditorHeader
Previously, EditorListener handled these keys, by registering a handler
in the text area. This meant that they would only work while the text
area was focused. By registering the keys as WHEN_IN_FOCUSED_WINDOW
bindings, they can always be handled, and EditorHeader seems like a more
appropriate place.

Note that this does not currently work (so this commit breaks these
keys), since these keys are also handled in a few different places as
well, preventing these newly added keybindings to take effect. This will
be fixed in the next commit.

One additional change is that previously, these keybindings did not work
when the text area was readonly. This was probably a remnant from when
EditorListener took care of a lot of other editing keybindings, but
this does not make much sense anymore now.

Finally, with the old bindings, ctrl-shift-tab did not (seem to) work.
What happened is that the binding for ctrl-tab did not check the shift
state, so both bindings would fire on ctrl-shift-tab, switching forward
and back again, making it seem the keys did not work. The Swing
keybinding mechanism that is now used for these bindings checks the
complete keystroke, including all modifier keys, so this problem is
fixed by this change.

References #195
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
e98285f900 Remove duplicate ctrl+alt+left/right handling
These key combinations were registered as accelerator keystrokes in the
tab bar popup menu, but also handled by EditorListener. This was
probably added in an attempt to work around the broken accelerator keys
on the tab bar popup menus, but in practice this only meant that the
shortcut would sometimes (and now that the accelerator keys are fixed,
always) switch tabs *twice*. Removing the handling from EditorListener
helps to fix this.

References: #4228
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
a3ba935a57 Slightly simplify EditorHeader tab selection menu items
Previously, this would use a single ActionListener object, and pass the
filename of the file to switch to in the action command. This means that
whenever switching the filename needs to be looked up. This commit
instead uses a lambda to capture the index of the tab to switch to for
every tab (so it uses a different ActionListener for each tab).
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
2f5375d523 Fix accelerator keybindings for the tab menu
Some items in this menu had accelerator keys (shortcuts) defined.
Normally, this automatically takes care of registering such keybindings
when the menu item is added to a menu. However, this requires adding the
item (indirectly) to a menubar, which is again added to a window. Since
the tab menu is just a separate popup menu, this did not work.

It seems an attempt was made to fix this by adding the popup menu to the
EditorHeader JComponent, which indeed made the keybindings work.
However, this is a hack at best, and as soon as the popup menu was
opened, it would be moved to another container and again detached when
the menu was closed, breaking the keyboard shortcuts again (re-adding
the popup menu turned out not to work either, then the menu would
actually be drawn on top of the tab bar).

To properly fix this, keybindings for the menu items are added to the
EditorHeader itself. By looking at the existing accelerator keystroke
property of the actions, there is no need to duplicate the keystrokes
themselves, and the displayed value will always match the actually bound
value. To simplify this, some methods are added to the Keys helper
class, which will likely come in handy in other places as well.
2015-12-11 19:31:15 +01:00
Matthijs Kooijman
957331299b Use Actions to simplify the EditorHeader popup menu building
Instead of defining JMenuItems, setting accelerator keys, and attaching
an ActionListener inline, this first defines a list of actions (with a
name, optional accelerator key and using a lambda as the action
listener). Then menu items are added, that simply refer to the
previously defined actions.

The actions are defined in a inner class named Actions, of which one
instance is created. This allows grouping the actions together inside
the `actions` attribute, and allows external access to the actions (in
case the same action is present in multiple menus, or otherwise
performed from other places). This might not be the best way to expose
these actions, and perhaps they should be moved elsewhere, but for now
this seems like a good start.

This adds new helper classes SimpleAction, to allow more consisely
defining Action instances, and a new class Keys, to allow consisely
defining keyboard shortcuts.
2015-12-11 19:31:15 +01:00
Matthijs Kooijman
8c176e7429 Remove some old, commented out code 2015-12-11 16:16:01 +01:00
Matthijs Kooijman
f9e1dbd484 Remove unused method 2015-12-11 16:16:01 +01:00
Federico Fissore
78ddbdbfb3 Updating arduino-builder to 1.3.8 2015-12-11 14:34:54 +01:00
Federico Fissore
be2d4c6a52 Merge pull request #4288 from arduino/builder-log-levels
arduino-builder uses log levels
2015-12-11 14:26:37 +01:00
Federico Fissore
98d5ff79eb Upgrading arduino-builder to 1.3.7, which changes the way messages are sent
back to the IDE. Instead of having just stdour and stderr, stdout only is
used, but each message has a log level: info, warn, debug, error
Plain stdout/stderr are still used by child processes
2015-12-11 14:25:13 +01:00
NicoHood
bab9b6c4f7 Added HID_REPORT_TYPE definitions 2015-12-10 10:30:04 +01:00
Federico Fissore
ff13b303d4 Forgot to remove old arduino-builder SHAs 2015-12-04 14:14:15 +01:00
Federico Fissore
580bcb5003 Updating arduino-builder to 1.3.6 2015-12-04 14:03:54 +01:00
Federico Fissore
9a39e5e6ac Some configuration may totally miss network interfaces, even localhost. Fixes #4249 2015-12-04 09:55:32 +01:00
Federico Fissore
a2848716a0 Added -Dportable=true param to ant. You can build your own portable version of
the IDE
2015-12-03 16:34:25 +01:00
Federico Fissore
66117a5cc0 Burn Bootloader was run in the UI thread, avoiding intermediate messages to be printed to IDE console 2015-12-03 11:09:50 +01:00
Federico Fissore
91245e2164 Updating arduino-builder to 1.3.5 2015-12-03 09:54:30 +01:00
Federico Fissore
37d2ec3154 Updating arduino-builder to 1.3.4 2015-12-02 16:41:15 +01:00
Federico Fissore
321f589b0f Reduced "scroll down" timer of ConsoleOutputStream back to 100ms 2015-12-02 16:41:15 +01:00
agdl
309c8c1fe8 Added missing keyword analogWriteResolution 2015-12-02 09:34:43 +01:00
Federico Fissore
f9c80816aa Halved "scroll down" timer of ConsoleOutputStream 2015-12-01 16:39:17 +01:00
Federico Fissore
1e074cce42 Whoops, a debuggin call to "peek" was committed. Removed. 2015-12-01 15:23:51 +01:00
Federico Fissore
5fcf5e3eb7 Updated translations 2015-12-01 12:21:30 +01:00
Federico Fissore
46d1c89073 Windows: even old settings folder may be missing from the registry. Fixes #4124 2015-12-01 11:36:45 +01:00
Federico Fissore
49a0f768a1 Updating arduino-builder to 1.3.3 2015-12-01 10:21:40 +01:00
Federico Fissore
d9f9081f3c Updated translations 2015-11-30 14:02:17 +01:00
Martino Facchin
47bcf07f5e fix StringIndexOf example logic and wording 2015-11-30 13:23:57 +01:00
Federico Fissore
c5824fd586 Updating arduino-builder to 1.3.1 2015-11-30 11:32:27 +01:00
Cristian Maglie
463046d691 Merge branch 'remove-wire-keywords' of https://github.com/per1234/Arduino 2015-11-30 10:20:10 +01:00
Federico Fissore
e224698ecf Files weren't deleted from temp unsaved sketch folder. Fixes #4233 2015-11-30 10:17:29 +01:00
per1234
d21e054836 Remove unused keywords from Wire libraries keywords.txt
These functions have been replaced by read() and write() since Arduino
1.0.
2015-11-28 17:56:21 -08:00
Federico Fissore
aaebb0a4d6 Stored some regexps in static finals, given names to threads, and slightly
optimized ConsoleOutputStream
2015-11-27 15:07:44 +01:00
agdl
53af4a7dea Removed old example 2015-11-27 14:40:31 +01:00
agdl
c009ac6e4c Modified example to not generate confusion
Only Arduino Mega was mentioned, but actually many boards have more than one Serial port
2015-11-27 14:36:48 +01:00
Arturo Guadalupi
8e6a30e00c Merge pull request #4220 from agdl/communicationExamples
Fixed processing code for Processing 3
2015-11-26 11:45:40 +01:00
agdl
3229e422a2 run autoformat in the example 2015-11-26 11:44:05 +01:00
Federico Fissore
89a36cad0a Updated translations 2015-11-26 11:38:03 +01:00
agdl
2f00c938a7 Fixed processing code for Processing 3
As pointed out in #4214 I changed the processing code to make it working wit Processing 3
2015-11-26 11:33:27 +01:00
Federico Fissore
553a022a24 Revert "Windows: patched launch4j to reduce the delay between pollings for the main"
This reverts commit c3fc56f845.
2015-11-26 11:05:58 +01:00
Federico Fissore
c3fc56f845 Windows: patched launch4j to reduce the delay between pollings for the main
window. Fixes #4215
2015-11-25 17:12:55 +01:00
Cristian Maglie
0dca80cad3 Merge branch 'per1234-eeprom_clear-add-pinmode' of https://github.com/per1234/Arduino 2015-11-25 15:58:06 +01:00
Federico Fissore
002bc4127f Updating arduino-builder to 1.3.0 2015-11-25 11:43:33 +01:00
Federico Fissore
1234e95470 Windows: updating launch4j to latest (3.8). An attempt to mitigate #4215 2015-11-25 10:15:16 +01:00
per1234
ffbcfa781f eeprom_clear example: Set pinMode of LED pin 2015-11-24 16:23:16 -08:00
Cristian Maglie
8f2514f7c1 Merge remote-tracking branch 'arduino/master' 2015-11-24 16:45:33 +01:00
Cristian Maglie
4c2af08bb2 Merge branch 'led_fix' of https://github.com/NicoHood/Arduino 2015-11-24 16:44:51 +01:00
Federico Fissore
7bd4c8ec41 Update revisions.txt 2015-11-24 16:38:54 +01:00