[tabs] dispose specific tab when closing

This commit is contained in:
Julia Beliaeva
2016-05-03 19:32:39 +03:00
parent 23080e9073
commit 6fd386b142
@@ -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;