Skip to content

Commit 53eefa1

Browse files
committed
IEP-1345: Fix for refreshing the manager after installation
1 parent aea1ba2 commit 53eefa1

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/InitializeToolsStartup.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
import com.espressif.idf.ui.dialogs.BuildView;
4848
import com.espressif.idf.ui.dialogs.MessageLinkDialog;
4949
import com.espressif.idf.ui.tools.ToolsActivationJob;
50+
import com.espressif.idf.ui.tools.ToolsActivationJobListener;
51+
import com.espressif.idf.ui.tools.manager.pages.ESPIDFMainTablePage;
5052

5153
@SuppressWarnings("restriction")
5254
public class InitializeToolsStartup implements IStartup
@@ -180,8 +182,9 @@ else if (isInstallerConfigSet())
180182
Logger.log(e);
181183
}
182184
ToolsActivationJob toolsActivationJob = new ToolsActivationJob(newToolSet, pythonExecutablePath, gitExecutablePath);
185+
ToolsActivationJobListener toolsActivationJobListener = new ToolsActivationJobListener(ESPIDFMainTablePage.getInstance());
186+
toolsActivationJob.addJobChangeListener(toolsActivationJobListener);
183187
toolsActivationJob.schedule();
184-
185188
}
186189

187190
// save state

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/ESPIDFManagerEditor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public boolean isSaveAsAllowed()
5353
@Override
5454
public void createPartControl(Composite parent)
5555
{
56-
ESPIDFMainTablePage espidfMainTablePage = new ESPIDFMainTablePage();
56+
ESPIDFMainTablePage espidfMainTablePage = ESPIDFMainTablePage.getInstance();
5757
espidfMainTablePage.createPage(parent);
5858
}
5959

bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/tools/manager/pages/ESPIDFMainTablePage.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ public class ESPIDFMainTablePage
6767
private static final String RELOAD_ICON = "icons/tools/reload.png"; //$NON-NLS-1$
6868
private static final String IDF_TOOL_SET_BTN_KEY = "IDFToolSet"; //$NON-NLS-1$
6969

70+
private static ESPIDFMainTablePage espidfMainTablePage;
71+
72+
private ESPIDFMainTablePage()
73+
{
74+
}
75+
76+
public static ESPIDFMainTablePage getInstance()
77+
{
78+
if (espidfMainTablePage == null)
79+
{
80+
espidfMainTablePage = new ESPIDFMainTablePage();
81+
}
82+
83+
return espidfMainTablePage;
84+
}
85+
7086
public Composite createPage(Composite composite)
7187
{
7288
toolSetConfigurationManager = new ToolSetConfigurationManager();
@@ -81,6 +97,8 @@ public Composite createPage(Composite composite)
8197

8298
public void refreshEditorUI()
8399
{
100+
if (container == null)
101+
return;
84102
for (TableItem item : tableViewer.getTable().getItems())
85103
{
86104
String EDITOR_KEY = "action_editor";

0 commit comments

Comments
 (0)