From 6e11e2a504f0bbed40b9c2c3cd58d47273f4670d Mon Sep 17 00:00:00 2001 From: Andras Toth Date: Mon, 13 Feb 2017 10:51:11 +0200 Subject: [PATCH 1/3] Async init load --- .../ideplugins/intellij/PluginModule.java | 2 + .../ideplugins/intellij/ui/EntryPoint.java | 116 ++++++++++-------- .../EntitySearchResultPresenter.java | 3 +- .../treetable/EntityTreeTablePresenter.java | 3 +- .../ideplugins/services/MetadataService.java | 69 +++++++++++ .../ideplugins/services/MyWorkService.java | 29 +---- 6 files changed, 143 insertions(+), 79 deletions(-) create mode 100644 src/main/java/com/hpe/adm/octane/ideplugins/services/MetadataService.java diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/PluginModule.java b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/PluginModule.java index 538a666e..c622671c 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/PluginModule.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/PluginModule.java @@ -25,6 +25,7 @@ import com.hpe.adm.octane.ideplugins.intellij.ui.treetable.EntityTreeView; import com.hpe.adm.octane.ideplugins.intellij.util.NotificationUtil; import com.hpe.adm.octane.ideplugins.services.EntityService; +import com.hpe.adm.octane.ideplugins.services.MetadataService; import com.hpe.adm.octane.ideplugins.services.TestService; import com.hpe.adm.octane.ideplugins.services.UserService; import com.hpe.adm.octane.ideplugins.services.connection.ConnectionSettings; @@ -113,6 +114,7 @@ protected void configure() { }); //Services + bind(MetadataService.class).asEagerSingleton(); bind(TestService.class); bind(SharedSpaceLevelRequestService.class); bind(EntityService.class); diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java index b00e8042..95dd109b 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java @@ -3,6 +3,7 @@ import com.hpe.adm.octane.ideplugins.intellij.PluginModule; import com.hpe.adm.octane.ideplugins.intellij.settings.IdePluginPersistentState; import com.hpe.adm.octane.ideplugins.intellij.ui.components.WelcomeViewComponent; +import com.hpe.adm.octane.ideplugins.intellij.ui.customcomponents.LoadingWidget; import com.hpe.adm.octane.ideplugins.intellij.ui.main.MainPresenter; import com.hpe.adm.octane.ideplugins.intellij.ui.util.UiUtil; import com.hpe.adm.octane.ideplugins.services.TestService; @@ -12,12 +13,16 @@ import com.hpe.adm.octane.ideplugins.services.nonentity.SharedSpaceLevelRequestService; import com.intellij.notification.NotificationType; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.progress.ProgressIndicator; +import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowFactory; import com.intellij.ui.content.ContentFactory; import org.jetbrains.annotations.NotNull; +import javax.swing.*; + /** * Entry point, will create the IntelliJ tool window */ @@ -45,53 +50,66 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo final ConnectionSettingsProvider connectionSettingsProvider = pluginModule.getInstance(ConnectionSettingsProvider.class); Runnable mainToolWindowContentControl = () -> { - try{ - ConnectionSettings connectionSettings = connectionSettingsProvider.getConnectionSettings(); - - if(connectionSettings == null || connectionSettings.isEmpty()){ - throw new ServiceException("No connection settings configured"); - } - TestService testService = pluginModule.getInstance(TestService.class); - testService.testConnection(connectionSettings); - - // Make sure you only instantiate other services (including the ones in the Presenter hierarchy, - // after you tested the connection settings with the test service - - //Add the workspace name to the ToolWindow content tab name - SharedSpaceLevelRequestService sharedSpaceLevelRequestService = pluginModule.getInstance(SharedSpaceLevelRequestService.class); - String workspaceDisplayName = " [" + sharedSpaceLevelRequestService.getCurrentWorkspaceName() + "]"; - - //Create the presenter hierarchy, DI will inject view instances - MainPresenter mainPresenter = pluginModule.getInstance(MainPresenter.class); - setContent(toolWindow, mainPresenter.getView(), workspaceDisplayName); - } catch (Exception ex){ - pluginModule.getInstance(IdePluginPersistentState.class).clearState(IdePluginPersistentState.Key.ACTIVE_WORK_ITEM); - WelcomeViewComponent welcomeViewComponent; - - // If there were previously configured connection settings - // show a slightly different message in the welcome view - if(!connectionSettingsProvider.getConnectionSettings().isEmpty()){ - welcomeViewComponent = new WelcomeViewComponent( - project, - "Your previously saved connection settings do not seem to work", - "Please go to settings and test your connection to Octane"); - - //also show a notification with the exception - UiUtil.showWarningBalloon(project, - "Failed to connect to Octane", - "Your previously saved connection settings do not seem to work
Error: " + ex.getMessage(), - NotificationType.WARNING); - } else { - //In this case (probably), the plugin was never configured on this project before - welcomeViewComponent = new WelcomeViewComponent(project); + EntryPoint.this.setContent(toolWindow, () -> new LoadingWidget(), "Loading"); + + Task.Backgroundable backgroundTask = new Task.Backgroundable(project, "Loading workspace", false) { + public void run(@NotNull ProgressIndicator indicator) { + //SwingUtilities.invokeLater(() -> { + try { + ConnectionSettings connectionSettings = connectionSettingsProvider.getConnectionSettings(); + + if (connectionSettings == null || connectionSettings.isEmpty()) { + throw new ServiceException("No connection settings configured"); + } + + TestService testService = pluginModule.getInstance(TestService.class); + testService.testConnection(connectionSettings); + + // Make sure you only instantiate other services (including the ones in the Presenter hierarchy, + // after you tested the connection settings with the test service + + //Add the workspace name to the ToolWindow content tab name + SharedSpaceLevelRequestService sharedSpaceLevelRequestService = pluginModule.getInstance(SharedSpaceLevelRequestService.class); + String workspaceDisplayName = " [" + sharedSpaceLevelRequestService.getCurrentWorkspaceName() + "]"; + + SwingUtilities.invokeLater(() -> { + //Create the presenter hierarchy, DI will inject view instances + MainPresenter mainPresenter = pluginModule.getInstance(MainPresenter.class); + setContent(toolWindow, mainPresenter.getView(), workspaceDisplayName); + }); + + } catch (Exception ex) { + pluginModule.getInstance(IdePluginPersistentState.class).clearState(IdePluginPersistentState.Key.ACTIVE_WORK_ITEM); + WelcomeViewComponent welcomeViewComponent; + + // If there were previously configured connection settings + // show a slightly different message in the welcome view + if (!connectionSettingsProvider.getConnectionSettings().isEmpty()) { + welcomeViewComponent = new WelcomeViewComponent( + project, + "Your previously saved connection settings do not seem to work", + "Please go to settings and test your connection to Octane"); + + //also show a notification with the exception + UiUtil.showWarningBalloon(project, + "Failed to connect to Octane", + "Your previously saved connection settings do not seem to work
Error: " + ex.getMessage(), + NotificationType.WARNING); + } else { + //In this case (probably), the plugin was never configured on this project before + welcomeViewComponent = new WelcomeViewComponent(project); + } + + log.info("Showing welcome view, cause: " + ex); + + //Show the welcome view + setContent(toolWindow, welcomeViewComponent, ""); + } + //}); } - - log.info("Showing welcome view, cause: " + ex); - - //Show the welcome view - setContent(toolWindow, welcomeViewComponent, ""); - } + }; + backgroundTask.queue(); }; //Run at the start of the application @@ -100,9 +118,11 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo } private void setContent(ToolWindow toolWindow, HasComponent hasComponent, String workspaceName) { - ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); - toolWindow.getContentManager().removeAllContents(true); - toolWindow.getContentManager().addContent(contentFactory.createContent(hasComponent.getComponent(), workspaceName, false)); + SwingUtilities.invokeLater(() -> { + ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); + toolWindow.getContentManager().removeAllContents(true); + toolWindow.getContentManager().addContent(contentFactory.createContent(hasComponent.getComponent(), workspaceName, false)); + }); } } diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/searchresult/EntitySearchResultPresenter.java b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/searchresult/EntitySearchResultPresenter.java index 37e785fa..451087bc 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/searchresult/EntitySearchResultPresenter.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/searchresult/EntitySearchResultPresenter.java @@ -33,7 +33,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -120,7 +119,7 @@ public void actionPerformed(AnActionEvent e) { this.entityTreeView.addSeparatorToToolbar(); //eager init my work service support cache - Arrays.asList(Entity.values()).forEach(myWorkService::isFollowingEntitySupported); + //Arrays.asList(Entity.values()).forEach(myWorkService::isFollowingEntitySupported); setContextMenuFactory(this.entityTreeView); entityTreeView.setComponentWhenEmpty(() -> new NoSearchResultsPanel()); diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/treetable/EntityTreeTablePresenter.java b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/treetable/EntityTreeTablePresenter.java index 7b701463..4518d351 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/treetable/EntityTreeTablePresenter.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/treetable/EntityTreeTablePresenter.java @@ -47,7 +47,6 @@ import java.awt.event.MouseEvent; import java.io.*; import java.nio.charset.StandardCharsets; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; @@ -159,7 +158,7 @@ public void setView(@Named("myWorkEntityTreeView") EntityTreeView entityTreeView this.entityTreeTableView = entityTreeView; //eager init my work service support cache - Arrays.asList(Entity.values()).forEach(myWorkService::isFollowingEntitySupported); + //Arrays.asList(Entity.values()).forEach(myWorkService::isFollowingEntitySupported); setContextMenuFactory(entityTreeView); //start presenting diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/services/MetadataService.java b/src/main/java/com/hpe/adm/octane/ideplugins/services/MetadataService.java new file mode 100644 index 00000000..080fd061 --- /dev/null +++ b/src/main/java/com/hpe/adm/octane/ideplugins/services/MetadataService.java @@ -0,0 +1,69 @@ +package com.hpe.adm.octane.ideplugins.services; + +import com.google.inject.Inject; +import com.hpe.adm.nga.sdk.Octane; +import com.hpe.adm.nga.sdk.metadata.FieldMetadata; +import com.hpe.adm.octane.ideplugins.services.connection.ConnectionSettingsProvider; +import com.hpe.adm.octane.ideplugins.services.connection.OctaneProvider; +import com.hpe.adm.octane.ideplugins.services.filtering.Entity; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +public class MetadataService { + + @Inject + private OctaneProvider octaneProvider; + + @Inject + private ConnectionSettingsProvider connectionSettingsProvider; + + private Map> cache; + + public boolean hasFields(Entity entityType, String... fieldNames){ + + if(cache == null){ + cache = new ConcurrentHashMap<>(); + init(); + } + + Octane octane = octaneProvider.getOctane(); + + Collection fields; + + if(!cache.containsKey(entityType)){ + fields = octane.metadata().fields(entityType.getEntityName()).execute(); + cache.put(entityType, fields); + } else { + fields = cache.get(entityType); + } + + List responseFieldNames = fields.stream().map(FieldMetadata::getName).collect(Collectors.toList()); + + return Arrays.stream(fieldNames) + .allMatch(responseFieldNames::contains); + } + + public void eagerInit(Entity... entities){ + if(cache == null){ + cache = new ConcurrentHashMap<>(); + init(); + } + + Octane octane = octaneProvider.getOctane(); + + Arrays.stream(entities) + .parallel() + .forEach(entityType -> cache.put(entityType, octane.metadata().fields(entityType.getEntityName()).execute())); + } + + private void init(){ + cache = new ConcurrentHashMap<>(); + connectionSettingsProvider.addChangeHandler(()-> cache.clear()); + } + +} \ No newline at end of file diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/services/MyWorkService.java b/src/main/java/com/hpe/adm/octane/ideplugins/services/MyWorkService.java index 4b9ed545..4a96b61f 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/services/MyWorkService.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/services/MyWorkService.java @@ -3,10 +3,8 @@ import com.google.inject.Inject; import com.hpe.adm.nga.sdk.Octane; import com.hpe.adm.nga.sdk.Query; -import com.hpe.adm.nga.sdk.metadata.FieldMetadata; import com.hpe.adm.nga.sdk.model.EntityModel; import com.hpe.adm.nga.sdk.model.MultiReferenceFieldModel; -import com.hpe.adm.octane.ideplugins.services.connection.ConnectionSettingsProvider; import com.hpe.adm.octane.ideplugins.services.connection.OctaneProvider; import com.hpe.adm.octane.ideplugins.services.exception.ServiceException; import com.hpe.adm.octane.ideplugins.services.exception.ServiceRuntimeException; @@ -30,7 +28,7 @@ public class MyWorkService { private OctaneProvider octaneProvider; @Inject - private ConnectionSettingsProvider connectionSettingsProvider; + private MetadataService metadataService; public static final String FOLLOW_ITEMS_OWNER_FIELD = "my_follow_items_owner"; public static final String NEW_ITEMS_OWNER_FIELD = "my_new_items_owner"; @@ -87,7 +85,6 @@ public Collection getMyWork(Map> fieldListMap) .and(createPhaseQuery(TASK, "new", "inprogress")) ); - filterCriteria.put(MANUAL_TEST_RUN, createCurrentUserQuery("run_by") .and(MANUAL_TEST_RUN.createMatchSubtypeQueryBuilder()) @@ -221,30 +218,8 @@ private Query.QueryBuilder createCurrentUserQuery(String fieldName) { } - private Map followingSupportEntityMap; - public boolean isFollowingEntitySupported(Entity entityType) { - - //init cache map - if (followingSupportEntityMap == null) { - followingSupportEntityMap = new HashMap<>(); - //Clear on settings changed - //connectionSettingsProvider.addChangeHandler(() -> followingSupportEntityMap.clear()); - } - - if (followingSupportEntityMap.containsKey(entityType)) { - return followingSupportEntityMap.get(entityType); - } - - Octane octane = octaneProvider.getOctane(); - Collection fields = octane.metadata().fields(entityType.getEntityName()).execute(); - boolean followFieldExits = - fields.stream().anyMatch(fieldMetadata -> FOLLOW_ITEMS_OWNER_FIELD.equals(fieldMetadata.getName())); - boolean newFieldExits = - fields.stream().anyMatch(fieldMetadata -> NEW_ITEMS_OWNER_FIELD.equals(fieldMetadata.getName())); - - followingSupportEntityMap.put(entityType, followFieldExits && newFieldExits); - return followFieldExits && newFieldExits; + return metadataService.hasFields(entityType, FOLLOW_ITEMS_OWNER_FIELD, NEW_ITEMS_OWNER_FIELD); } public boolean isCurrentUserFollowing(EntityModel entityModel) { From 7418052ee498009c8806c92c1571682cc72e61ce Mon Sep 17 00:00:00 2001 From: Andras Toth Date: Mon, 13 Feb 2017 11:46:15 +0200 Subject: [PATCH 2/3] Added eager init for meta service --- .../ideplugins/intellij/ui/EntryPoint.java | 111 +++++++++--------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java index 95dd109b..773d70c4 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java @@ -6,10 +6,12 @@ import com.hpe.adm.octane.ideplugins.intellij.ui.customcomponents.LoadingWidget; import com.hpe.adm.octane.ideplugins.intellij.ui.main.MainPresenter; import com.hpe.adm.octane.ideplugins.intellij.ui.util.UiUtil; +import com.hpe.adm.octane.ideplugins.services.MetadataService; import com.hpe.adm.octane.ideplugins.services.TestService; import com.hpe.adm.octane.ideplugins.services.connection.ConnectionSettings; import com.hpe.adm.octane.ideplugins.services.connection.ConnectionSettingsProvider; import com.hpe.adm.octane.ideplugins.services.exception.ServiceException; +import com.hpe.adm.octane.ideplugins.services.filtering.Entity; import com.hpe.adm.octane.ideplugins.services.nonentity.SharedSpaceLevelRequestService; import com.intellij.notification.NotificationType; import com.intellij.openapi.diagnostic.Logger; @@ -34,6 +36,7 @@ public class EntryPoint implements ToolWindowFactory { * This method can be called by multiple IntelliJ's running at the same time, * it's important that the state of any one tool window that contains the IDE plugin * does not affect the state of other potentially open tool windows + * * @param project * @param toolWindow */ @@ -51,62 +54,64 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo Runnable mainToolWindowContentControl = () -> { - EntryPoint.this.setContent(toolWindow, () -> new LoadingWidget(), "Loading"); + EntryPoint.this.setContent(toolWindow, () -> new LoadingWidget(), "Loading Workspace"); - Task.Backgroundable backgroundTask = new Task.Backgroundable(project, "Loading workspace", false) { + Task.Backgroundable backgroundTask = new Task.Backgroundable(project, "Loading Workspace", false) { public void run(@NotNull ProgressIndicator indicator) { - //SwingUtilities.invokeLater(() -> { - try { - ConnectionSettings connectionSettings = connectionSettingsProvider.getConnectionSettings(); - - if (connectionSettings == null || connectionSettings.isEmpty()) { - throw new ServiceException("No connection settings configured"); - } - - TestService testService = pluginModule.getInstance(TestService.class); - testService.testConnection(connectionSettings); - - // Make sure you only instantiate other services (including the ones in the Presenter hierarchy, - // after you tested the connection settings with the test service - - //Add the workspace name to the ToolWindow content tab name - SharedSpaceLevelRequestService sharedSpaceLevelRequestService = pluginModule.getInstance(SharedSpaceLevelRequestService.class); - String workspaceDisplayName = " [" + sharedSpaceLevelRequestService.getCurrentWorkspaceName() + "]"; - - SwingUtilities.invokeLater(() -> { - //Create the presenter hierarchy, DI will inject view instances - MainPresenter mainPresenter = pluginModule.getInstance(MainPresenter.class); - setContent(toolWindow, mainPresenter.getView(), workspaceDisplayName); - }); - - } catch (Exception ex) { - pluginModule.getInstance(IdePluginPersistentState.class).clearState(IdePluginPersistentState.Key.ACTIVE_WORK_ITEM); - WelcomeViewComponent welcomeViewComponent; - - // If there were previously configured connection settings - // show a slightly different message in the welcome view - if (!connectionSettingsProvider.getConnectionSettings().isEmpty()) { - welcomeViewComponent = new WelcomeViewComponent( - project, - "Your previously saved connection settings do not seem to work", - "Please go to settings and test your connection to Octane"); - - //also show a notification with the exception - UiUtil.showWarningBalloon(project, - "Failed to connect to Octane", - "Your previously saved connection settings do not seem to work
Error: " + ex.getMessage(), - NotificationType.WARNING); - } else { - //In this case (probably), the plugin was never configured on this project before - welcomeViewComponent = new WelcomeViewComponent(project); - } - - log.info("Showing welcome view, cause: " + ex); - - //Show the welcome view - setContent(toolWindow, welcomeViewComponent, ""); + try { + ConnectionSettings connectionSettings = connectionSettingsProvider.getConnectionSettings(); + + if (connectionSettings == null || connectionSettings.isEmpty()) { + throw new ServiceException("No connection settings configured"); + } + + TestService testService = pluginModule.getInstance(TestService.class); + testService.testConnection(connectionSettings); + + // Make sure you only instantiate other services (including the ones in the Presenter hierarchy, + // after you tested the connection settings with the test service + + //Add the workspace name to the ToolWindow content tab name + SharedSpaceLevelRequestService sharedSpaceLevelRequestService = pluginModule.getInstance(SharedSpaceLevelRequestService.class); + String workspaceDisplayName = " [" + sharedSpaceLevelRequestService.getCurrentWorkspaceName() + "]"; + + //Eager init the metadata service, it's an eager singleton + MetadataService metadataService = pluginModule.getInstance(MetadataService.class); + metadataService.eagerInit(Entity.values()); + + SwingUtilities.invokeLater(() -> { + //Create the presenter hierarchy, DI will inject view instances + MainPresenter mainPresenter = pluginModule.getInstance(MainPresenter.class); + setContent(toolWindow, mainPresenter.getView(), workspaceDisplayName); + }); + + } catch (Exception ex) { + pluginModule.getInstance(IdePluginPersistentState.class).clearState(IdePluginPersistentState.Key.ACTIVE_WORK_ITEM); + WelcomeViewComponent welcomeViewComponent; + + // If there were previously configured connection settings + // show a slightly different message in the welcome view + if (!connectionSettingsProvider.getConnectionSettings().isEmpty()) { + welcomeViewComponent = new WelcomeViewComponent( + project, + "Your previously saved connection settings do not seem to work", + "Please go to settings and test your connection to Octane"); + + //also show a notification with the exception + UiUtil.showWarningBalloon(project, + "Failed to connect to Octane", + "Your previously saved connection settings do not seem to work
Error: " + ex.getMessage(), + NotificationType.WARNING); + } else { + //In this case (probably), the plugin was never configured on this project before + welcomeViewComponent = new WelcomeViewComponent(project); } - //}); + + log.info("Showing welcome view, cause: " + ex); + + //Show the welcome view + setContent(toolWindow, welcomeViewComponent, ""); + } } }; backgroundTask.queue(); From c25efe0b82fcb96abfc1c17eab989f7640876e8e Mon Sep 17 00:00:00 2001 From: Andras Toth Date: Mon, 13 Feb 2017 14:37:15 +0200 Subject: [PATCH 3/3] Plugin will now correctly who the error if the workspace failed to load --- .../com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java index 773d70c4..9d71746d 100644 --- a/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java +++ b/src/main/java/com/hpe/adm/octane/ideplugins/intellij/ui/EntryPoint.java @@ -54,7 +54,7 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo Runnable mainToolWindowContentControl = () -> { - EntryPoint.this.setContent(toolWindow, () -> new LoadingWidget(), "Loading Workspace"); + EntryPoint.this.setContent(toolWindow, () -> new LoadingWidget(), ""); Task.Backgroundable backgroundTask = new Task.Backgroundable(project, "Loading Workspace", false) { public void run(@NotNull ProgressIndicator indicator) { @@ -79,7 +79,7 @@ public void run(@NotNull ProgressIndicator indicator) { MetadataService metadataService = pluginModule.getInstance(MetadataService.class); metadataService.eagerInit(Entity.values()); - SwingUtilities.invokeLater(() -> { + SwingUtilities.invokeAndWait(() -> { //Create the presenter hierarchy, DI will inject view instances MainPresenter mainPresenter = pluginModule.getInstance(MainPresenter.class); setContent(toolWindow, mainPresenter.getView(), workspaceDisplayName);