Tabnine Logo
Listbox
Code IndexAdd Tabnine to your IDE (free)

How to use
Listbox
in
org.fujion.component

Best Java code snippets using org.fujion.component.Listbox (Showing top 20 results out of 315)

origin: org.carewebframework/org.carewebframework.help.core

/**
 * Set the topic view when a topic selection is made.
 */
@EventHandler(value = "change", target = "@lstTopics")
private void onSelect$lstTopics() {
  Listitem item = lstTopics.getSelectedItem();
  Listitem keywordItem = lstKeywords.getSelectedItem();
  
  if (item == null) {
    int i = keywordItem.hasAttribute("last") ? (Integer) keywordItem.getAttribute("last") : 0;
    item = (Listitem) lstTopics.getChildAt(i);
    lstTopics.setSelectedItem(item);
  }
  
  if (item != null) {
    keywordItem.setAttribute("last", lstTopics.getSelectedIndex());
    setTopic((HelpTopic) item.getData());
  } else {
    setTopic(null);
  }
}

origin: org.hspconsortium.carewebframework/cwf-ui-reporting

/**
 * Returns a list of listbox items.
 *
 * @param selectedOnly If true, only selected items are returned.
 * @return List of list items.
 */
protected Iterable<Listitem> getItems(boolean selectedOnly) {
  return selectedOnly ? listbox.getSelected() : listbox.getChildren(Listitem.class);
}
origin: org.carewebframework/org.carewebframework.plugin.chat

/**
 * Updates controls to reflect the current selection state.
 */
private void updateControls() {
  btnInvite.setDisabled(lstSessions.getSelectedCount() == 0);
}

origin: org.fujion/fujion-core

/**
 * Sets the selected list item by its index. Any existing selections are cleared.
 *
 * @param index The index of the list item to be selected.
 */
public void setSelectedIndex(int index) {
  setSelectedItem((Listitem) getChildAt(index));
}

origin: org.carewebframework/org.carewebframework.ui.core

private void processListResponses() {
  List<?> responses = control.getResponses();
  listbox.setVisible(true);
  
  for (Object rsp : responses) {
    DialogResponse<?> response = (DialogResponse<?>) rsp;
    Listitem item = new Listitem(StrUtil.formatMessage(response.getLabel()));
    item.addEventListener(DblclickEvent.TYPE, clickListener);
    item.setData(response);
    listbox.addChild(item);
    
    if (response.isDefault()) {
      item.setSelected(true);
    }
  }
  
  if (listbox.getSelectedCount() == 0) {
    listbox.setSelectedItem(listbox.getChild(Listitem.class));
  }
  
  addButton(LABEL_ID_CANCEL, "danger", (event) -> {
    close(null);
  });
  
  addButton(LABEL_ID_OK, "success", (event) -> {
    close(listbox.getSelectedItem());
  });
}

origin: org.carewebframework/org.carewebframework.shell

/**
 * Returns the identifier of the currently selected layout, or null if none selected.
 *
 * @return The currently selected layout.
 */
private LayoutIdentifier getSelectedLayout() {
  Listitem item = lstLayouts.getSelectedItem();
  return item == null ? null : (LayoutIdentifier) item.getData();
}

origin: org.carewebframework/org.carewebframework.help.core

/**
 * Locates and selects a matching keyword as the user types in the quick find text box.
 * 
 * @param event The input event.
 */
@EventHandler(value = "change", target = "@txtFind")
private void onChange$txtFind(ChangeEvent event) {
  String find = event.getValue(String.class).toLowerCase();
  
  if (StringUtils.isEmpty(find)) {
    return;
  }
  
  int match = -1;
  
  for (int i = 0; i < keywordList.size(); i++) {
    if (keywordList.get(i).toLowerCase().startsWith(find)) {
      match = i;
      break;
    }
  }
  
  if (match != lstKeywords.getSelectedIndex()) {
    Listitem item = match == -1 ? null : (Listitem) lstKeywords.getChildAt(match);
    lstKeywords.setSelectedItem(item);
    onSelect$lstKeywords();
  }
}

origin: org.carewebframework/org.carewebframework.plugin.messagetesting

@EventHandler(value = "click", target = "btnRemoveSubscription")
private void onClick$btnRemoveSubscription() {
  Listitem item = lboxSubscriptions.getSelectedItem();
  
  if (item != null) {
    if (item.isSelected()) {
      subscribe(item.getLabel(), false);
    }
    
    lboxSubscriptions.removeChild(item);
  }
}

origin: org.carewebframework/org.carewebframework.help.core

/**
 * Initialize the topic list when a keyword is selected. The last topic selected for the keyword
 * is automatically selected.
 */
@EventHandler(value = "change", target = "@lstKeywords")
private void onSelect$lstKeywords() {
  Listitem item = lstKeywords.getSelectedItem();
  
  if (item == null) {
    lstTopics.destroyChildren();
    setTopic(null);
    return;
  }
  
  List<HelpTopic> topics = getTopics(item.getLabel());
  
  if (!item.hasAttribute("sorted")) {
    item.setAttribute("sorted", true);
    Collections.sort(topics);
  }
  
  modelAndView.setModel(new ListModel<>(topics));
  onSelect$lstTopics();
}

origin: org.carewebframework/org.carewebframework.shell

/**
 * Refresh the list.
 *
 * @param deflt The layout to select initially.
 */
private void refresh(String deflt) {
  modelAndView.setModel(new ListModel<>(LayoutUtil.getLayouts(shared)));
  lstLayouts.setSelectedItem(deflt == null ? null : (Listitem) lstLayouts.findChildByLabel(deflt));
  updateControls();
}

origin: org.carewebframework/org.carewebframework.plugin.messagetesting

@Override
public void onLoad(ElementPlugin plugin) {
  super.onLoad(plugin);
  ListModel<IMessageProducer> providers = new ListModel<>(getProviders());
  //providers.setMultiple(true);
  lboxProviders.setModel(providers);
  lboxProviders.setRenderer(new MessageProviderRenderer());
  gridReceived.getRows().setModel(received);
  gridReceived.getRows().setRenderer(new ReceivedMessageRenderer(gridReceived));
  //channels.setMultiple(true);
  lboxSubscriptions.setModel(channels);
  lboxSubscriptions.setRenderer(new SubscriptionRenderer());
  cboxChannels.setModel(channels2);
}

origin: org.carewebframework/org.carewebframework.ui.core

/**
 * Need to update visual appearance of selection when it is changed.
 * 
 * @see org.fujion.component.Listbox#setSelectedItem(Listitem)
 */
@Override
public void setSelectedItem(Listitem item) {
  super.setSelectedItem(item);
  updateSelection();
}

origin: org.carewebframework/org.carewebframework.plugin.eventtesting

private boolean containsEvent(String eventName) {
  for (Object object : lboxEventList.getChildren()) {
    if (((Listitem) object).getLabel().equals(eventName)) {
      return true;
    }
  }
  return false;
}
origin: org.carewebframework/org.carewebframework.plugin.eventtesting

@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("");
}
origin: org.carewebframework/org.carewebframework.help.core

@Override
public void afterInitialized(BaseComponent comp) {
  super.afterInitialized(comp);
  modelAndView = lstTopics.getModelAndView(HelpTopic.class);
  modelAndView.setRenderer(new HelpTopicRenderer());
}

origin: org.carewebframework/org.carewebframework.plugin.chat

private List<IPublisherInfo> getInvitees() {
  List<IPublisherInfo> invitees = new ArrayList<>();
  
  for (Listitem item : lstSessions.getSelected()) {
    invitees.add(item.getData(IPublisherInfo.class));
  }
  
  return invitees;
}

origin: org.carewebframework/org.carewebframework.plugin.chat

/**
 * Refresh the participant list.
 */
@Override
public void refresh() {
  lstSessions.setModel(null);
  model.clear();
  model.addAll(chatService.getChatCandidates());
  renderer.setHideExclusions(chkHideActive.isChecked());
  model.sort(sessionComparator);
  lstSessions.setModel(model);
  updateControls();
}

origin: org.fujion/fujion-core

/**
 * Returns the index of the selected list item. If there are multiple selections, the index of
 * the first selected item will be returned.
 *
 * @return The index of the selected list item. If there is no current selection, returns -1.
 */
public int getSelectedIndex() {
  Listitem item = getSelectedItem();
  return item == null ? -1 : item.getIndex();
}

origin: org.carewebframework/org.carewebframework.help.core

/**
 * 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();
  }
}

origin: org.carewebframework/org.carewebframework.plugin.chat

/**
 * Initialize the dialog.
 */
@Override
public void afterInitialized(BaseComponent comp) {
  super.afterInitialized(comp);
  window = (Window) comp;
  sessionId = (String) comp.getAttribute("id");
  lstParticipants.setRenderer(new ParticipantRenderer(chatService.getSelf(), null));
  model.add(chatService.getSelf());
  lstParticipants.setModel(model);
  clearMessage();
  
  if (comp.getAttribute("originator") != null) {
    invite((result) -> {
      if (!result) {
        close();
      } else {
        initSession();
      }
    });
  } else {
    initSession();
  }
}

org.fujion.componentListbox

Javadoc

A component representing a simple list box control.

Most used methods

  • getSelectedItem
    Returns the selected list item, if any. If there are multiple selections, only the first will be ret
  • setSelectedItem
    Sets the selected list item. Any existing selections are cleared.
  • addChild
  • getChildren
  • getChildAt
  • getModelAndView
  • getSelected
    Returns the set of selected list items.
  • getSelectedCount
    Returns the number of selected list items.
  • setModel
  • setRenderer
  • _updateSelected
    Updates the selection status of a list item.
  • clearSelected
    Clears any existing selection.
  • _updateSelected,
  • clearSelected,
  • destroyChildren,
  • findChildByLabel,
  • getChild,
  • getSelectedIndex,
  • propertyChange,
  • removeChild,
  • setFocus,
  • setVisible

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JTable (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now