@Override public void close(Portlet portlet) { TabItem tab = getTab(portlet); if (tab != null) { if (tab.getTabPanel() != null) tab.close(); // Take the tab out of the list of tabs for (List<TabItem> column : portletTabs) { for (TabItem targetTab : column) { if (tab.hashCode() == targetTab.hashCode()) { column.remove(targetTab); break; } } } } // Make sure the portlet is out of the tab itself if (portlet.getParent() != null) portlet.removeFromParent(); // Update the portlet as "closed" in the user cache if (portlet instanceof AppPortlet) ((AppPortlet) portlet).updateUserPortlet(); }