tool_window code sample: Fix deprecated API usage

This commit is contained in:
Karol Lewandowski 2023-04-11 13:07:53 +02:00
parent ce89421f49
commit be06c8856d

View File

@ -1,5 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.intellij.sdk.toolWindow; package org.intellij.sdk.toolWindow;
import com.intellij.openapi.project.Project; import com.intellij.openapi.project.Project;
@ -19,8 +18,7 @@ public class MyToolWindowFactory implements ToolWindowFactory {
*/ */
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) { public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
MyToolWindow myToolWindow = new MyToolWindow(toolWindow); MyToolWindow myToolWindow = new MyToolWindow(toolWindow);
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); Content content = ContentFactory.getInstance().createContent(myToolWindow.getContent(), "", false);
Content content = contentFactory.createContent(myToolWindow.getContent(), "", false);
toolWindow.getContentManager().addContent(content); toolWindow.getContentManager().addContent(content);
} }