File tree Expand file tree Collapse file tree 2 files changed +35
-11
lines changed
com.espressif.idf.core/src/com/espressif/idf/core/tools/vo
com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages Expand file tree Collapse file tree 2 files changed +35
-11
lines changed Original file line number Diff line number Diff line change 11package com .espressif .idf .core .tools .vo ;
22
3+ import java .util .Objects ;
4+
35import com .google .gson .annotations .Expose ;
46
57public class IdfInstalled
@@ -77,4 +79,21 @@ public void setPython(String python)
7779 this .python = python ;
7880 }
7981
82+ @ Override
83+ public boolean equals (Object obj )
84+ {
85+ if (this == obj )
86+ return true ;
87+ if (obj == null || getClass () != obj .getClass ())
88+ return false ;
89+ IdfInstalled that = (IdfInstalled ) obj ;
90+ return Objects .equals (id , that .id );
91+ }
92+
93+ @ Override
94+ public int hashCode ()
95+ {
96+ return Objects .hash (id );
97+ }
98+
8099}
Original file line number Diff line number Diff line change 1414import org .eclipse .jface .viewers .ColumnLabelProvider ;
1515import org .eclipse .jface .viewers .ColumnWeightData ;
1616import org .eclipse .jface .viewers .IStructuredSelection ;
17+ import org .eclipse .jface .viewers .StructuredSelection ;
1718import org .eclipse .jface .viewers .TableViewer ;
1819import org .eclipse .jface .viewers .TableViewerColumn ;
1920import org .eclipse .jface .viewers .Viewer ;
@@ -430,20 +431,24 @@ public void refreshEditorUI()
430431 });
431432 }
432433
433-
434-
435434 public void setupInitialEspIdf ()
436435 {
437- if (tableViewer .getInput () instanceof List <?> list && !list .isEmpty ()
438- && !prefs .getBoolean (EimConstants .INSTALL_TOOLS_FLAG , false ))
439- {
440- Object first = list .get (0 );
441- if (first instanceof IdfRow selectedRaw )
442- {
443- performToolsSetup (selectedRaw .original ());
444- }
445- }
436+ if (container == null || container .isDisposed () || tableViewer == null
437+ || prefs .getBoolean (EimConstants .INSTALL_TOOLS_FLAG , false ))
438+ {
439+ return ;
440+ }
446441
442+ if (tableViewer .getTable ().getItemCount () == 0 )
443+ {
444+ return ;
445+ }
446+
447+ if (tableViewer .getElementAt (0 ) instanceof IdfRow firstIdf )
448+ {
449+ tableViewer .setSelection (new StructuredSelection (firstIdf ), true );
450+ performToolsSetup (firstIdf .original ());
451+ }
447452 }
448453
449454 private MessageConsoleStream getConsoleStream (boolean errorStream )
You can’t perform that action at this time.
0 commit comments