/** * Sets the visibility and selection state of the tab. */ @Override protected void updateVisibility(boolean visible, boolean activated) { tab.setVisible(visible); tab.setSelected(visible && activated); }
/** * Resets the viewer to its baseline state. All registered help sets are removed, the history is * cleared, and all views are hidden. */ private void reset() { tvNavigator.setVisible(false); lblLoading.setVisible(true); helpSets.clear(); history.clear(); for (Tab tab : tvNavigator.getChildren(Tab.class)) { tab.setVisible(false); } }
/** * Updated the list box selection when the history selection changes. * * @see org.carewebframework.help.viewer.HelpViewBase#onTopicSelected(HelpTopic) */ @Override public void onTopicSelected(HelpTopic topic) { Listitem item = (Listitem) lstHistory.getChildAt(history.getPosition()); lstHistory.setSelectedItem(item); if (item != null) { getContainer().getAncestor(Tab.class).setVisible(true); item.scrollIntoView(); } }
tab.setLabel(label == null ? viewType.name() : label); tab.addChild(newView.getContainer()); tab.setVisible(viewType != HelpViewType.HISTORY); tvNavigator.addChild(tab, pos); return newView;
/** * Returns the help view associated with the specified view type. If the view does not exist and * doCreate is true and the view type is supported, a new view is created. Otherwise, null is * returned. * * @param viewType The view type. * @param doCreate If true, create if does not already exist. * @param visible Determines visibility of view. * @return A help view (possibly null). */ private HelpViewBase findView(HelpViewType viewType, boolean doCreate, boolean visible) { HelpViewBase result = null; for (HelpViewBase view : views) { if (view.getViewType().equals(viewType)) { result = view; break; } } result = result != null ? result : doCreate ? createView(viewType) : null; if (result != null) { result.getContainer().getAncestor(Tab.class).setVisible(visible); } return result; }