public ElementTabView() { super(); fullSize(tabview); setOuterComponent(tabview); tabview.addClass("cwf-tabview"); tabview.addEventListener(ChangeEvent.TYPE, (event) -> { setActivePane((ElementTabPane) getAssociatedElement(tabview.getSelectedTab())); }); }
/** * Sets the tab {@link TabPosition position}. * * @param tabPosition The tab {@link TabPosition position}. */ @PropertySetter(value = "tabPosition", defaultValue = "top", description = "The position of the tabs.") public void setTabPosition(TabPosition tabPosition) { propertyChange("tabPosition", this.tabPosition, this.tabPosition = defaultify(tabPosition, TabPosition.TOP), true); }
/** * 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); } }
@Override protected void bind() { Tabview tabview = (Tabview) getParent().getOuterComponent(); tabview.addChild(tab); }
/** * If the added tab is marked as selected, update the selected tab. * * @see org.fujion.component.BaseUIComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { if (((Tab) child).isSelected()) { setSelectedTab((Tab) child); } }
/** * Sets the orientation which can be horizontal or vertical. * * @param orientation Orientation setting. */ public void setOrientation(String orientation) { tabview.setTabPosition(TabPosition.valueOf(orientation.toUpperCase())); }
/** * Returns the orientation (horizontal, vertical, top, or bottom). * * @return Orientation setting. */ public String getOrientation() { return tabview.getTabPosition().name().toLowerCase(); }
/** * Overrides activateChildren to ensure that only the active pane is affected. */ @Override public void activateChildren(boolean activate) { if (activePane == null) { activePane = (ElementTabPane) getAssociatedElement(tabview.getSelectedTab()); } if (activePane == null || !activePane.isVisible()) { activePane = (ElementTabPane) getFirstVisibleChild(); } if (activePane != null) { activePane.activate(activate); } }
tab.addChild(newView.getContainer()); tab.setVisible(viewType != HelpViewType.HISTORY); tvNavigator.addChild(tab, pos); return newView;
/** * Sets the tabs selected status. * * @param selected The new selected status. * @param notifyParent If true, notify the parent tab view of the status change. */ protected void _setSelected(boolean selected, boolean notifyParent) { if (propertyChange("selected", this.selected, this.selected = selected, true)) { if (notifyParent && getParent() != null) { getTabview().setSelectedTab(selected ? this : null); } } }