mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[tabs] dispose specific tab when closing
This commit is contained in:
@@ -126,12 +126,20 @@ public class ContentUtilEx extends ContentsUtil {
|
||||
JComponent component = tabbedContent.getComponent();
|
||||
tabbedContent.removeContent(component);
|
||||
contentManager.setSelectedContent(tabbedContent, true, true);
|
||||
dispose(component);
|
||||
return;
|
||||
}
|
||||
}
|
||||
contentManager.removeContent(content, true);
|
||||
}
|
||||
|
||||
private static void dispose(@NotNull JComponent component) {
|
||||
Object disposable = component.getClientProperty(DISPOSABLE_KEY);
|
||||
if (disposable != null && disposable instanceof Disposable) {
|
||||
Disposer.dispose((Disposable)disposable);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getFullName(@NotNull String groupPrefix, @NotNull String tabName) {
|
||||
return getFullPrefix(groupPrefix) + tabName;
|
||||
|
||||
Reference in New Issue
Block a user