/** * Add an item to the list box. * * @param value = Value of item to add. */ public void addItem(String value) { Listitem item = new Listitem(); item.setLabel(value); addChild(item); if (value.equalsIgnoreCase(defaultValue)) { item.addStyle("font-style", "italic"); } } }
public DateRangeChooser() { super(); customItem = new Listitem(); customItem.setLabel("Custom..."); addChild(customItem); setAllowCustom(false); loadChoices(null); }
@EventHandler(value = "click", target = "btnNewEvent") private void onClick$btnNewEvent() { String eventName = StringUtils.trimToNull(tboxNewEvent.getValue()); if (eventName != null && !containsEvent(eventName)) { Listitem item = new Listitem(); item.setLabel(eventName); lboxEventList.addChild(item); } tboxNewEvent.setValue(""); }
item.setLabel(range.getLabel()); item.setData(range); addChild(item, isCustom ? null : customItem);
/** * Creates and returns a draggable list item. * * @param associateEvents If true, associate events with this item. * @return New list item. */ private Listitem newListitem(boolean associateEvents) { Listitem item = new Listitem(); if (associateEvents) { associateEvents(item); } String label = "Drop item #" + ++itemCount + (associateEvents ? " *" : ""); item.setLabel(label); // Set to info panel drop id. item.setDragid(IInfoPanel.DROP_ID); // Create and attach the object to be rendered. DroppedItem dropped = new DroppedItem(label, "This is the detail for drop item #" + itemCount); item.setData(dropped); // Associate the drop renderer with the item. DropUtil.setDropRenderer(item, dropRenderer); return item; }