File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed
io.sloeber.core/src/io/sloeber Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,6 @@ public abstract class IArduinoLibrary extends Node implements Comparable<IArdu
5050
5151 public abstract IPath getInstallPath ();
5252
53+ public abstract boolean canUpdate ();
54+
5355}
Original file line number Diff line number Diff line change @@ -139,7 +139,11 @@ public boolean isInstalled() {
139139
140140 @ Override
141141 public int compareTo (IArduinoLibrary other ) {
142+ if (other ==null ) {
143+ return 1 ;
144+ }
142145 return getID ().compareTo (other .getID ());
146+
143147 }
144148
145149 //Below are the Node overrides
@@ -173,4 +177,12 @@ public ArduinoLibraryVersion getVersion(VersionNumber versionNumber) {
173177 return versions .get (versionNumber );
174178 }
175179
180+ @ Override
181+ public boolean canUpdate () {
182+ if (!isInstalled ()) {
183+ return false ;
184+ }
185+ return !getInstalledVersion ().equals (getNewestVersion ());
186+ }
187+
176188}
Original file line number Diff line number Diff line change 22
33import static io .sloeber .core .api .Const .*;
44
5+ import java .util .ArrayList ;
56import java .util .List ;
67
78import org .eclipse .core .runtime .IPath ;
@@ -84,8 +85,16 @@ public boolean equals(IArduinoLibraryVersion other) {
8485 }
8586
8687 @ Override
87- public int compareTo (IArduinoLibraryVersion o ) {
88- return 0 ;
88+ public boolean equals (Object other ) {
89+ if (other instanceof IArduinoLibraryVersion ) {
90+ return equals ((IArduinoLibraryVersion ) other );
91+ }
92+ return false ;
93+ }
94+
95+ @ Override
96+ public int compareTo (IArduinoLibraryVersion other ) {
97+ return myFQN .toPortableString ().compareTo (other .getFQN ().toPortableString ());
8998 }
9099
91100 @ Override
@@ -105,7 +114,7 @@ public boolean isInstalled() {
105114
106115 @ Override
107116 public List <String > getArchitectures () {
108- return null ;
117+ return new ArrayList <>() ;
109118 }
110119
111120 @ Override
@@ -125,7 +134,6 @@ public String getMaintainer() {
125134
126135 @ Override
127136 public String getAuthor () {
128- // TODO Auto-generated method stub
129137 return "Author is board provider" ; //$NON-NLS-1$
130138 }
131139
You can’t perform that action at this time.
0 commit comments