@PostConstruct public void init() { link.setTitle(CommonConstants.INSTANCE.AppsLauncher()); link.setIcon(IconType.TH); link.addStyleName("dropdown"); link.setDataToggle(Toggle.DROPDOWN); link.setVisible(false); link.add(appLauncher.getView()); }
/** * Adds a new tab to this panel that doesn't have any contents itself, but can contain multiple items that appear in * a dropdown menu when the tab is clicked. This dropdown menu is initially empty. Items can be added and removed * using the {@link DropDownTab#addItem(String, Widget)} and * {@link DropDownTab#removeItem(String, Widget)} methods. * @param label The text that should appear on the dropdown tab. * @return the container for the items that appear when the tab is clicked. */ public DropDownTab addDropdownTab(String label) { AnchorListItem tab = new AnchorListItem(label); // FIXME should actually subclass AnchorListItem and add a <b class=caret/> to the anchor elem tab.setIcon(IconType.ANGLE_DOWN); tab.setIconPosition(IconPosition.RIGHT); tab.addStyleName(Styles.DROPDOWN_TOGGLE); tab.setDataToggle(Toggle.DROPDOWN); DropDownTab dropDownTab = new DropDownTab(tab); tab.add(dropDownTab); addDropdownTab(dropDownTab); return dropDownTab; }
/** * Adds a new tab to this panel that doesn't have any contents itself, but can contain multiple items that appear in * a dropdown menu when the tab is clicked. This dropdown menu is initially empty. Items can be added and removed * using the {@link DropDownTab#addItem(String, Widget)} and * {@link DropDownTab#removeItem(String, Widget)} methods. * @param label The text that should appear on the dropdown tab. * @return the container for the items that appear when the tab is clicked. */ public DropDownTab addDropdownTab(String label) { AnchorListItem tab = new AnchorListItem(label); // FIXME should actually subclass AnchorListItem and add a <b class=caret/> to the anchor elem tab.setIcon(IconType.ANGLE_DOWN); tab.setIconPosition(IconPosition.RIGHT); tab.addStyleName(Styles.DROPDOWN_TOGGLE); tab.setDataToggle(Toggle.DROPDOWN); DropDownTab dropDownTab = new DropDownTab(tab); tab.add(dropDownTab); addDropdownTab(dropDownTab); return dropDownTab; }