Skip to content

Commit

Permalink
gets name from the bundle
Browse files Browse the repository at this point in the history
suppresses warning about message
  • Loading branch information
vphilipnyc committed Jan 23, 2023
1 parent 09f49fc commit 633ac3e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ public RefreshAction(@NotNull @Nls String text) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
ToolWindowManager instance = ToolWindowManager.getInstance(Objects.requireNonNull(e.getProject()));
ToolWindow toolWindow = instance.getToolWindow("ChatGPT");
ToolWindow toolWindow = instance.getToolWindow(ChatGPTBundle.message("name"));
if (toolWindow != null) {
ContentManager contentManager = toolWindow.getContentManager();
Content browserContent = contentManager.findContent(ChatGPTBundle.message("browser.tab.name"));
if (browserContent != null) {
contentManager.removeContent(browserContent, false);
}
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
@SuppressWarnings("DialogTitleCapitalization")
Content browser = contentFactory.createContent(new ChatGPTToolWindow().getContent(),
ChatGPTBundle.message("browser.tab.name"), false);
contentManager.addContent(browser);
Expand Down

0 comments on commit 633ac3e

Please sign in to comment.