1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-03 14:24:15 +01:00
Commit Graph

1897 Commits

Author SHA1 Message Date
Mattia Bertorello
824567d763 Change variable name where store log directory to "log4j.dir" 2019-08-02 11:48:07 +02:00
Mattia Bertorello
a80fd4af06 Add line number to the logs (%L)
https://logging.apache.org/log4j/2.x/manual/layouts.html
2019-08-02 11:48:07 +02:00
Martino Facchin
b2235c3a4a Avoid NPE and spurious unlock if serial monitor is clicked at upload warmup 2019-07-22 14:50:10 +02:00
Martino Facchin
13b74f5ccb Avoid reopening the serial monitor during upload
avoidMultipleOperations becomes false with a 10 seconds timeout after pressing the compile button.

The new code introduced by 99f6043ced didn't take this into account, so the port was being reopened before staring the actual upload.

Also, make uploading variable static to avoid preferences confusion (this should be solved in a saner way giving every Editor instance its own set of properties, but it will hopefully fixes by the cli integration and workspace concept)
2019-07-19 12:23:31 +02:00
Cristian Maglie
e659825058 Fixed test UpdateTextAreaActionTest 2019-07-18 14:25:24 +02:00
Cristian Maglie
dcee1846bd Updated eclipse classpath 2019-07-18 14:24:59 +02:00
Martino Facchin
b7a6d93d0a Fix SerialMonitor reopen on reconnect 2019-07-18 13:50:03 +02:00
Mattia Bertorello
a492c1ac44 Fix test about the contributions downloader 2019-07-18 12:26:55 +02:00
Pieter12345
1d21f0cca3 CommandHistory optimization
- Use LinkedList with ListIterator to make all methods except for `clear()` run in `O(1)` (constant runtime) instead of `O(n)` (linear runtime).
- No longer store executed commands that are executed multiple times (executing {1, 1, 1, 1, 2} now only adds {1, 2} to the history).
2019-07-18 12:22:08 +02:00
Pieter12345
f5b383113f Add serial monitor command history
The behavior is as follows:
- Pressing the UP key will select older commands.
- Pressing the DOWN key will select newer commands, restoring the last unexecuted command if available.
- Pressing the ESC key will reset the input field to the latest unexecuted command and reset the traversal location. Pressing ESC while the latest unexecuted command is selected will clear the input field.

This fixes #4891, with the difference that the proposed solution has a command history per Arduino session and this implementation has a command history per serial monitor start.
2019-07-18 12:22:08 +02:00
Martino Facchin
9ce5101df1
Merge branch 'master' into add-file-cache 2019-07-18 11:28:46 +02:00
Wilhelm
f70dd8330f Added labels to legend 2019-07-18 10:45:02 +02:00
Pieter12345
9aea65bee6 Use user-defined tab settings in new sketch generation
When creating a new sketch, it is initialized with the BareMinimum example sketch. This example sketch uses 2-width whitespace indentation, which might differ from the user-defined tab settings. This commit makes the generated example sketch consistent with the user-defined tab settings.
2019-07-18 10:40:19 +02:00
Cristian Maglie
3438b86699 Some small makeup
- use diamond notation <> to remove redundant type specification
- do no cache listeners, because it makes the code heavier for a
a very small gain in memory usage.
- removed redundant "this" keywords
2019-07-18 10:38:37 +02:00
Cristian Maglie
2f68d2af1b Remove Base dependency from AstractTextMonitor
See https://github.com/arduino/Arduino/pull/8704#issuecomment-477585720
2019-07-18 10:38:37 +02:00
Cristian Maglie
1cacd79689 Make the dialog appear in the correct position 2019-07-18 10:37:36 +02:00
Cristian Maglie
4dc5176c0f Fix some linter suggestions 2019-07-18 10:37:36 +02:00
Cristian Maglie
ed81292b14 Added library dependencies install dialog 2019-07-18 10:37:36 +02:00
Cristian Maglie
07e1518b28 Now libraries are installed with all the dependencies
This is the base for the GUI that will be introduced in the
next commits.
2019-07-18 10:37:36 +02:00
Cristian Maglie
67e38bc80a LibraryInstaller now autodetects if a library is being replaced
It's no more required to pass this information from outside,
just library that is being installed is now sufficient.
2019-07-18 10:37:36 +02:00
Martino Facchin
2ec8c539b2 Match CustomMenu against unique platform id
platform.getId() gives the same result for derived cores.
Issue #5260 is caused by both cores declaring as `avr`, with the same label but different identifier.
This patch completes the previous one by adding the folder where the core resides to the matching id.
2019-07-18 10:30:40 +02:00
Martino Facchin
2778651eb6 Allow multiple boards to share the same menu
This stuff is truly madness, should be refactored from the ground up by a Java expert
2019-07-18 10:30:40 +02:00
Martino Facchin
06cfbbfa74 Annotate custom menu to avoid name clashing
Fixes #5260
2019-07-18 10:30:40 +02:00
Martino Facchin
99f6043ced Don't try automatic resume during upload 2019-07-18 10:11:43 +02:00
Martino Facchin
693498fb76 Handle suspend/resume if serial port disappears
Similar to minicom behaviour.
Automatically reopens the port only if it takes the same name (could be improved based on vid/pid)
2019-07-18 10:11:43 +02:00
Martino Facchin
e7d85d8b6d Reopen serial monitor on correct port if changed from menu 2019-07-18 10:11:43 +02:00
Martino Facchin
fb9ce0ade3 Update jssc to arduino4
Repackage jssc-2.8.0-arduino1 and add aarch64 lib instead than plain jssc

Fixes #9062
2019-07-16 11:03:02 +02:00
Mattia Bertorello
58fc5a5011
Add commons-io dependency and replace the extract file name with FilenameUtils 2019-07-11 14:32:50 +02:00
Mattia Bertorello
bd85fdc084
Add log4j.xml configuration 2019-07-05 11:47:36 +02:00
Mattia Bertorello
2596ecee28
Add log4j configuration 2019-07-03 15:25:48 +02:00
Mattia Bertorello
53be417989
Add log4j dependencies 2019-07-02 16:10:12 +02:00
Mattia Bertorello
d089323342
Fix possible empty files during the download of the package index 2019-06-28 17:44:17 +02:00
Martino Facchin
6b770d0190 Fix UpdateTextAreaAction test 2019-04-18 11:15:58 +02:00
Martino Facchin
e92d5948fe
Merge pull request #8672 from Pieter12345/contextual-menus
Add contextual menus to input fields
2019-04-18 10:00:19 +02:00
Cristian Maglie
72330aaddd Fix .classpath: commons-lang3-3.3.2 -> commons-lang3-3.8.1.jar 2019-04-02 16:36:08 +02:00
Martino Facchin
26f428384b Preferences: remove outdated preferences 2019-04-02 16:20:58 +02:00
Martino Facchin
4c8ac04727 Preferences: allow smaller window since checkboxes take less space
Fixes #8238
2019-04-02 16:20:58 +02:00
Martino Facchin
b1253e2f0a Preferences: arrange checkboxes into two columns 2019-04-02 16:20:58 +02:00
Pieter12345
941050ecf0 Add contextual menus to input fields
- Add contextual menus to text-based monitors (serial / network monitor).
- Add contextual menu to installer dialog search filter fields (library manager / contribution manager).
- Make installer dialogs focus the search filter field on window-open. This prevents pastes from ending up elsewhere in the case that they are performed before the field has been focussed at least once.
Fixes #8423.
2019-03-29 02:26:41 +01:00
Pieter12345
933bbb3a39 Fix CommandLineTest.testCommandLineVersion() on Windows
Fix CommandLineTest.testCommandLineVersion() failing on Windows due to Runtime.exec() returning `\r\n` line endings where the test expected `\n` line endings.
2019-03-26 18:46:09 +01:00
Pieter12345
4c2fca6457 Replace some FileUtils calls with direct methods
Not wrapping these calls in FileUtils methods makes the code cleaner and easier to understand (FileUtils is very poorly documented, whereas direct calls contain proper documentation).
2019-03-26 18:46:09 +01:00
Pieter12345
e2d2998075 Fix MergeSketchWithUploaderText failing under Windows
When having "autocrlf=input" (as described in the Building Arduino guide), the `.hex` files used in the test will be a different size due to the test expecting `\n` and git cloning as `\r\n`. This commit fixes this issue by removing cariage returns before running the test.
2019-03-26 18:46:09 +01:00
Pieter12345
6d9dd975be Remove StringUtils class
The functionality in this class has been replaced with the Apache commons.lang3 dependency.
2019-03-26 18:46:09 +01:00
Pieter12345
09e466a4a2 Replace StringUtils.join() with library call
Use Apache commons.lang3 instead of own implementation.
2019-03-26 18:46:09 +01:00
Pieter12345
e6e10cdeb9 Update commons-lang3 from 3.3.2 to 3.8.1
Updated due to new API methods than can be useful for this project.
The license remained the same.
2019-03-26 18:46:09 +01:00
Pieter12345
61bbc382b5 Move editor font resize listener code to Base
- Move editor font resize listener code to the Base class.
- Cache and share the same listener for all components.
2019-03-26 17:18:11 +01:00
Pieter12345
3aa81b0a89 Add CTRL +/-/scroll shortcuts to adjust editor console font size
Add CTRL +/- and CTRL scroll shortcuts to increase/decrease editor console output text size. This font size is shared with the editor and serial/network monitor. Adjusting the font size on any of these will update them all.
Partially fixes #8615.
2019-03-26 17:18:11 +01:00
Pieter12345
91fc80ba69 Properly update editor console font size on change
Make the editor console font properly update with editor font size changes. Before this commit, only newly added text would have an adjusted size, making it possible to have multiple text sizes in the editor console.
2019-03-26 17:18:11 +01:00
Pieter12345
e3f129a0ee Fix compiler/IDE warnings in monitor classes + Code cleanup
No functional changes:
- Fix compiler/IDE warnings in monitor classes.
- Replace listeners to use lambda classes where convenient in monitor classes.
- Code cleanup.
2019-03-26 17:18:11 +01:00
Pieter12345
1a6d55480c Make text monitor output area font size dynamically adjustable
Add CTRL +/- and CTRL scroll shortcuts to increase/decrease serial/network monitor output text size. This font size is shared with the editor and adjusting either will update both.
Partially fixes #8615
2019-03-26 17:18:11 +01:00
Pieter12345
49242bed02 Add editor zoom "CTRL =" shortcut
Add "CTRL =" as additional shortcut to increase the editor font size. This shortcut should be added because the '+' and '=' characters are often on the same key on the keyboard and having to press SHIFT as well is not intuitive for all users (especially since many common applications support "CTRL =").
2019-03-26 17:18:11 +01:00
Martino Facchin
dd58a7254c Replace usages of jssc-2.8.0-arduino2.jar with arduino3 2019-03-11 17:05:06 +01:00
Martino Facchin
8ad6d0efcf Update aarch64 shared library in jssc
Fixes https://github.com/arduino/Arduino/issues/7302#issuecomment-422539496
2019-03-11 17:01:18 +01:00
Martino Facchin
0e45f4e0d4
Merge pull request #8038 from cmaglie/pluggable-discovery
Pluggable discovery: search in platform.txt (WIP)
2019-03-07 14:13:43 +01:00
Martino Facchin
4ae2e1f116 Fix wrong Unicode encoding on unsaved sketch
Fixes #4231
2019-03-07 12:21:12 +01:00
Martino Facchin
9518aa421c Ensure line is unfolded when highlighting for error
Fixes #8457

For some reason, getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(line) doesn't work here; there no documentation on what offset is.
Also, getFoldForLine(line) returns null even if the line is folded (bug in rsyntaxtextarea?)
2019-03-07 11:19:46 +01:00
Cristian Maglie
a5e866f731 makeup: using some lambdas where possible 2019-03-06 13:18:53 +01:00
Martino Facchin
8f5f4f594d [LibManager] Restore "search on type" with 1 second grace period 2019-02-15 10:44:56 +01:00
Martino Facchin
f3d521d820 [Lib Manager] Avoid updating the UI at every keystroke
Fixes #8282
2019-02-14 15:34:21 +01:00
Martino Facchin
2b11e94afe Correctly handle cancellation on last open sketch exit
Fixes #8488
2019-02-04 10:03:17 +01:00
Sandeep Mistry
3c8f201024 macOS touchbar: Run event handler later to prevent hanging if a dialog needs to be open 2019-01-24 11:58:37 -05:00
Sandeep Mistry
980b70e3d6 Upgrade jtouchbar to 1.0.0 2019-01-23 10:46:28 -05:00
Cristian Maglie
e1caaf1c45 Perform port selection after initializing packages
Fix #8400
2019-01-23 15:46:41 +01:00
Cristian Maglie
651dcd5271 Removed unused field 2019-01-23 13:51:41 +01:00
Cristian Maglie
4fffcd6e1a Editor: use TargetBoard.getName() to get board name 2019-01-23 13:51:41 +01:00
Cristian Maglie
6c50007e22 Editor: renamed status bar field serialport -> port 2019-01-23 13:51:41 +01:00
Cristian Maglie
349af4b5cf Added BoardPort.protocolLabel and simplified port menu rendering 2019-01-23 13:51:41 +01:00
Cristian Maglie
9ba172b0db Show BoardName.boardName field in 'Ports' menu
...instead of putting it into the 'label' field during discovery.
2019-01-23 13:51:41 +01:00
Cristian Maglie
8d6fa72667 Removing fixed fields in BoardPort 2019-01-23 13:51:41 +01:00
Martino Facchin
3ba85835bf Merge branch 'master' of github.com:arduino/Arduino 2019-01-21 09:41:32 +01:00
Martino Facchin
7248affd7e Avoid double confirmation when closing sketch
Fixes #8413

handleQuit() already checks for confirmation if the sketch has been modified (when invoked directly).
When invoked indirectly (via handleClose(), as we are closing the last open Editor instance), checkModified() is redundant.
2019-01-21 09:37:19 +01:00
Martino Facchin
f15ddeb846 Update rsyntaxtextarea to 3.0.2
The name is misleading since 3.0.2 had been officially released (but the filename is totally wrong).
The jar comes from https://netcologne.dl.sourceforge.net/project/rsyntaxtextarea/rsyntaxtextarea/3.0.2/rsyntaxtextarea-3.0.2.zip

Fixes #7861
2019-01-18 09:51:46 +01:00
Cristian Maglie
f5f8b7f29c Renamed wrong named variable 2019-01-14 16:53:47 +01:00
Martino Facchin
2efd090e81 Remove last editor window after saving its properties
Only OSX needs the "app" to stay open after handleQuit and to remove the editor windows when called.

Fixes #8337
2019-01-02 10:24:53 +01:00
Sandeep Mistry
b3b62d0c44
Only display touch bar on macOS 10.12 and higher (#8281) 2018-12-11 09:37:41 -05:00
Martino Facchin
d7963f04c5 Add scroller to INCOMPATIBLE examples menu
You need A LOT of libraries to trigger this :)
2018-11-30 11:54:57 +01:00
Martino Facchin
4d26ec85e6 Make "Export compiled binary" comply with specifications 2018-11-27 15:09:10 +01:00
Martino Facchin
36da22c086 [macOS] Modify behaviour when last editor gets closed
Don't call System.exit() but trust the ThinkDifferent handler
Handle reopen only if no editor is visible
Don't dispose last closing editor (so its toolbars are still in active state)
2018-11-23 12:39:54 +01:00
Martino Facchin
c1d9c588b5
Merge pull request #8184 from facchinm/kill_programmer_at_exit
Kill active programmer if still alive after closing last IDE window
2018-11-23 12:07:13 +01:00
Georges A
8309fb2428 typo: renamed showPrerefencesData to showPreferencesData 2018-11-21 12:04:58 +01:00
Cristian Maglie
3e9a3ec743 Fixed CommandLineTest.testCommandLineVersion 2018-11-16 12:34:04 +01:00
Cristian Maglie
ff952fc053 Fixed VersionHelperTest 2018-11-16 12:33:38 +01:00
Cristian Maglie
c3c08e5d79 Added tests for AbstractTextMonitor "Show Timestamp" function 2018-11-16 11:11:35 +01:00
Cristian Maglie
4b7c7e886c Replaced UpdateTextAreaAction with a lambda that performs a method call
The overhead is negligible and this design simplifies a lot the class
structure. More discussion here:

https://github.com/arduino/Arduino/pull/8088#issuecomment-433727423
2018-11-16 11:11:35 +01:00
nitram509
c2f324508f Fix issue #8055 missing timestamps on serial monitor 2018-11-16 11:11:35 +01:00
Cristian Maglie
b5bfe08bd2 Better error for 'no serial ports available'
See https://github.com/arduino/Arduino/pull/8194#issuecomment-438180384
2018-11-14 17:41:34 +01:00
Cristian Maglie
2647ce36ea Editor: fixed port ordering in tools menu 2018-11-14 17:41:34 +01:00
Cristian Maglie
d5e0e59fcf Editor: the serial port selection dialog now works 2018-11-14 17:41:34 +01:00
Cristian Maglie
12b38c5fcd Nicer serial port selection dialog box 2018-11-14 17:41:34 +01:00
Cristian Maglie
fd1b598ea2 Show port on status bar only when selected 2018-11-14 17:41:34 +01:00
Cristian Maglie
cede26883e Fix 'Select port on upload' error message 2018-11-14 17:41:34 +01:00
Cristian Maglie
3f79d129bb Refactor: Removed code duplication in Export(App)Handlers 2018-11-14 17:41:34 +01:00
Sandeep Mistry
df9c25692d Only load Touch Bar images once 2018-11-14 17:14:50 +01:00
Sandeep Mistry
17a60f4e3d Allow customization 2018-11-14 17:14:50 +01:00
Sandeep Mistry
d4d7062391 Add macOS Touch Bar support 2018-11-14 17:14:50 +01:00
Martino Facchin
b71a4969af Kill active programmer if still alive after closing last IDE window
Fixes https://github.com/arduino/Arduino/issues/7498
2018-11-08 18:08:58 +01:00
Martino Facchin
e1a5be7354 Cleanup IDE quit()
There were two different routines andling more or less the same operations.
Let the IDE call "real" quit when the last Editor windows is being closed.
2018-11-08 18:07:33 +01:00
Cristian Maglie
edb707378f makeup: call I18n.format using static imports in Base class 2018-10-08 12:56:22 +02:00
Cristian Maglie
6a1c1f4df9 Invalid use of toString in Optional<Version>
It should be used on the actual Version.

Fix #8034
2018-10-08 11:53:33 +02:00
Martino Facchin
d3cb01424f Provide actual string to findPlatform for Optional<Version>
Fix https://github.com/arduino/Arduino/issues/8034
2018-10-08 09:53:36 +02:00
Cristian Maglie
ddbe80b3fa Update library list model after a round of library_index.json update 2018-09-06 11:57:21 +02:00
Cristian Maglie
3dfe85916c Preserve boards.txt custom menu order.
Fix #7955
2018-09-04 10:31:36 +02:00
PaulStoffregen
4ccf9bbd90 Show a helpful message when no Port is selected 2018-09-03 16:39:39 +02:00
Cristian Maglie
5f9ff25b3c Added missing update to jssc lib 2018-09-03 13:29:42 +02:00
Martino Facchin
6080907ba3 Update jscc to 2.8.0-arduino2 (aarch64 support) 2018-08-28 17:53:04 +02:00
Martino Facchin
2f3a561c61 Fix rebuild being triggered on every menu open()
Fixes #7924

JRE 8u161 made JMenu.insert() MUCH slower on OSX.
This exposed a bug lurking there for years; in fact the menu entries were rebuilt every time since JMenu.getComponent() returns an empty list.
The correct function is JMenu.getMenuComponents().
In the meantime, also remove sketchbookMenu and examplesMenu being deleted on board change; only their content needs to be updated, not the container itself.
2018-08-27 16:22:42 +02:00
Martino Facchin
49cd9b57dd Fix check for wrong submenu 2018-08-27 16:20:20 +02:00
Cristian Maglie
d97147826e Serial monitor timestamp: add the arrow ' -> ' to the timestamp format
This saves another "append" call while streaming.
2018-08-23 10:46:32 +02:00
Cristian Maglie
986d67f1d9 Serial monitor timestamp: cache newline status
This saves an access to the Document object (as well as a bunch
temporary object allocations).
2018-08-23 10:46:32 +02:00
Cristian Maglie
8128525e83 Improve performance on serial monitor 'Show timestamp'
This patch dramatically reduce pressure on heap memory:

- use a StringTokenizer instead of the very slow String.split(...)
  method to decode newlines. This avoid allocation/deallocation of
  big strings array and use of regexp.
- pre allocate as many object as possible to avoid new allocation
  while streaming data.
- the "timestamp" string is calculated only once per iteration.
- use StringBuilder instead of inline temporary strings (that are,
  again, allocated and deallocated on each iteration)
2018-08-23 10:46:32 +02:00
Cristian Maglie
13c3750ecf Revert "Moving a sketch to another folder should move all files"
This reverts commit c4f5cafd33.
2018-08-23 10:39:20 +02:00
Cristian Maglie
4700cc3d27 Transformed some ActionListener anonumous class into lambdas
No code change
2018-08-15 17:23:04 +02:00
Cristian Maglie
2988136f97 Added alternative key binding for "Increase Font Size"
This commits adds the "CTRL SHIFT =" as key to increase font size.
The old shortcut "CTRL +" is still active, but it's not always
possible to produce it if the keyboard layout doesn't have the + key
on the base layer.

This add the possibility to compose "CTRL +" when the keyboard has
the "+" available as "SHIFT =", that seems to be very common in
many layouts.

Fix #6806
2018-08-15 17:22:47 +02:00
Cristian Maglie
1a576dd468 Fixed wrong keybinding for "Increase Font Size"
See https://github.com/arduino/Arduino/issues/6806#issuecomment-335044967
2018-08-15 00:11:41 +02:00
Cristian Maglie
60146b3d7d Fixed unused import warnings 2018-08-14 22:01:04 +02:00
per1234
19bfd2ada9 Correct messages re: sketch/library folder name restrictions
- Specify that library name error is about folder name.
  - We would normally expect "library name" to mean the "fancy name" (as defined by the library.properties name field).
- Specify exactly which characters are allowed.
- State that spaces are prohibited in sketch folder name.
- Remove outdated message about library folders not being allowed to start with a number.
  - This restriction was removed by 4545283ae7.
- State library folder name length restriction.
- Make sketch and library messages consistent with each other.
2018-08-10 10:53:15 +02:00
Jose Juan Juarez Monsivais
9d904dad31 Fixed the bug that doesn't updates the title when an example sketch is saved 2018-08-10 10:50:43 +02:00
Martino Facchin
f2b9328d30 Fix build by restoring onIndexesUpdated override 2018-07-19 10:08:32 +02:00
Martino Facchin
0ee0fcc018 [Lib manager] Fix only member being rendered incorrectly if filter active and update/install 2018-07-18 14:31:17 +02:00
Martino Facchin
fa51a39b58 Fix SerialMonitor and SerialPlotter lifecycles
Fixes #7683

When the selected serial port is busy both monitors now avoid displaying a useless window, cleaning the status area once the open succeeds.
2018-06-12 10:41:45 +02:00
Cristian Maglie
a76588cf5d Added newline at the end of --version output
See #7549
2018-05-22 17:48:29 +02:00
Yohsuke FURUTA
24029c5ace CLI: Add --version to CLI option (#7549)
* CLI: Add --version to CLI option

I added to get the Arduino IDE version from the command line
It will allow to check easily if the new Arduino is already installed.

This feature makes it easier to build external systems linked to specific versions of Arduino.

1. I added `--version` action, which shows version name and exit
  1. Currently, VERSION_NAME_LONG (like `1.8.5`, `1.9.0-beta`, `1.8.6 Hourly Build XXX`, etc...) is used. Because I want to know its version number and stable/beta/hourly.
  2. Finish with `0`. Because it is `SUCCESSFLLY FINISHED`.
2. Updated man page.

* Split "parse" and "action".
Move print action to probably suitable place.

This commit will fix the behavior of multiple actions about --version.

* add testcase
2018-05-22 17:46:11 +02:00
Cristian Maglie
60021c1e63 Library search now works also for headers (.h) provided by libraries
Fixes #7604
2018-05-22 16:28:52 +02:00
Cristian Maglie
e18261f486 library manager: installed element is now displayed correctly 2018-05-22 09:53:37 +02:00
Cristian Maglie
901d8c77fe Fixed UpdatableLibrarieyTest 2018-05-21 12:04:01 +02:00
Cristian Maglie
b4efa5589b Moved cc.arduino.i18n.Language* classes in arduino-core project 2018-05-21 11:27:53 +02:00
Cristian Maglie
b70e876c0c Removed et_EE localization.
Fix #4747
2018-05-21 10:43:19 +02:00
Martino Facchin
397f4e81ea Fixed LibraryOfSameTypeComparator comparator 2018-05-21 10:00:47 +02:00
Cristian Maglie
3bce82092e Command line: added more verbosity and made output coherent 2018-05-17 09:14:25 +02:00
Cristian Maglie
8d27171b74 Fixed error in cmd-line lib installer 2018-05-17 09:14:25 +02:00
Cristian Maglie
fee5848a02 Removed no more used predicates 2018-05-17 09:14:25 +02:00
Cristian Maglie
8fa45a3a07 Removed useless double sort
Removed also the weird LibraryByTypeComparator comparator that is no
more used.
2018-05-17 09:14:25 +02:00
Cristian Maglie
ac570c50bd UserLibrary: ensure that types field is always not-null 2018-05-17 09:14:25 +02:00
Cristian Maglie
b3d01d8281 Moved install-related fields out of DownloadableContribution
Those fields have a slightly different meaning on each object that
extends DownloadableContribution and having them grouped in
DownloadableContribution only increase confusion in change of a
(very) tiny code reuse.

Moreover:

- the `readOnly` field has been renamed to `builtIn`
- predicates have been replaced by lambdas
- DownloadableContributionBuiltInAtTheBottomComparator has been replaced
  with a singleton instance
2018-05-17 09:14:25 +02:00
Cristian Maglie
0042a30c81 Simplified version display logic in Library Manager
- replaced the logic to check if an installed-library is a
  builtin library by reusing the same method available in
  ContributedLibraryReleases
- renamed some local vars to better reflect their contents:

  uninstalledLibraries        -> notInstalled
  uninstalledNewerReleases    -> notInstalledNewer
  uninstalledPreviousReleases -> notInstalledPrevious
2018-05-17 09:14:25 +02:00
Cristian Maglie
ac6d3c1aff Core and ref-Core libraries are not handled by the library manager. 2018-05-17 09:14:25 +02:00
Cristian Maglie
b03a9af19a ContributedLibraryReleases: removed getLibrary() method
this method is now useless
2018-05-17 09:14:25 +02:00
Cristian Maglie
5cc66e9715 Moved ContributedLibraryReleases in arduino-core 2018-05-17 09:14:25 +02:00
Cristian Maglie
1089378575 Preparing ContributedLibraryReleases to move in arduino-core
Removed dependency on FilteredAbstractTableModel.getLatestOf() method.
2018-05-17 09:14:25 +02:00
Cristian Maglie
904a898108 Fixed UpdatableLibraryPredicate 2018-05-17 09:14:25 +02:00
Cristian Maglie
86441e4341 Added first tests for library manager engine 2018-05-17 09:14:25 +02:00
Cristian Maglie
2374d9d1bd Introducing UserLibraryFolder
This class allows to attach a Location property to a folder
path, this way we directly know if a library is in the sketchbook,
core, referenced-core or bundled in the IDE.

This simplify a lot of logic in the IDE.
2018-05-17 09:14:25 +02:00
Cristian Maglie
040caad124 Fixed library layout detection when adding new library 2018-05-17 09:14:25 +02:00
Cristian Maglie
e896595214 UserLibrary doesn't extend ContributedLibrary anymore
ContributedLibrary is used to decode library_index.json and it's
intended to keep data coming only from the index.

Now, when the library_index is synced with the filesystem, the
metadata about installed libraries are kept in a separate list
to not mess up with the main index.
2018-05-17 09:14:25 +02:00
Cristian Maglie
3ec6748dc4 Lib manager Predicates must act on ContributedLibraryReleases
Previously the filtering was made on ContributedLibrary, but the
objects that is actually displayed is a ContributeLibraryReleases,
so it comens natural to filter on this class of objects.

Apparently the functionality is not affected by this commit, but
there may be some side-effect that may probably fix some
visualization bug.
2018-05-17 09:14:25 +02:00
Cristian Maglie
482b905a62 Using Optional<T> semantics for 'replacedLib' in LibraryInstaller
Optional<T> helps to not forget to check about nullness where it is
needed.

This commit should be equivalent and shouln't fix any bug, BTW the
Optional<T> semantic turns out to be useful in the next commits.

Possibly all nullable values will be replaced by Optional in the
future.
2018-05-17 09:14:25 +02:00
Cristian Maglie
212825eb55 Simplified overly complex filtering of InstallerJDialog
- we ensure that there is always a filter selected, no more need
  to check for non-nullness
- the filters are always the same, no need to pass a
  Stream<Predicate<T>> around where Predicate<T> suffices
2018-05-17 09:14:25 +02:00
Cristian Maglie
f111905da6 Removed a lot of useless equals overrides.
Those introduces a very convoluted logic that is needed only in
two cases. Moreover those are better handled by directly checking
the object.
2018-05-17 09:14:25 +02:00
Cristian Maglie
b832e0d8b1 Use anyMatch instead of count in ContributionSelfCheck checks 2018-05-17 09:14:25 +02:00
Cristian Maglie
d285b7fdc9 Improved VersionComparator API 2018-05-17 09:14:25 +02:00