@Override protected void disposeInternal() { container.removeListener(m_containerListener); if (container.isLoaded()) { for (final INaviView view : container.getViews()) { view.removeListener(m_viewListener); } } }
@Override public void loaded(final IViewContainer container) { for (final INaviView view : container.getViews()) { view.addListener(m_viewListener); } updateBorderText(getBorderText()); }
/** * Creates a new component object. * * @param projectTree Project tree that is updated on certain events. * @param container Container that provides the views to be shown in the table. */ public CUserViewsComponent(final JTree projectTree, final IViewContainer container) { super( new CUserViewsTable(projectTree, container, container), new CViewFilterCreator(container), new CViewFilterHelp()); Preconditions.checkNotNull(projectTree, "IE02013: Project tree argument can not be null"); Preconditions.checkNotNull(container, "IE02014: Original container argument can not be null"); this.container = container; container.addListener(m_containerListener); if (container.isLoaded()) { for (final INaviView view : container.getViews()) { view.addListener(m_viewListener); } } updateBorderText(getBorderText()); }
/** * Creates the border text that gives information about the number of views. * * @return The created border text. */ private String getBorderText() { return String.format("%d Views", container.getViewCount()); }