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

How to use
getSelectedItem
method
in
org.fujion.component.Listbox

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

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.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.plugin.infopanel

/**
 * Double-clicking a list item adds it to the info panel.
 */
public void onDoubleClick$listbox() {
  pushDrop(listbox.getSelectedItem());
}

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

/**
 * 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.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.plugin.infopanel

public void onClick$btnSendEvent() {
  Listitem item = actions.getSelectedItem();
  
  if (item != null) {
    Action action = Action.valueOf(item.getLabel());
    EventManager.getInstance().fireLocalEvent(getEvent(action), action);
  }
}

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

org.fujion.componentListboxgetSelectedItem

Javadoc

Returns the selected list item, if any. If there are multiple selections, only the first will be returned.

Popular methods of Listbox

  • 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.
  • destroyChildren
  • clearSelected,
  • destroyChildren,
  • findChildByLabel,
  • getChild,
  • getSelectedIndex,
  • propertyChange,
  • removeChild,
  • setFocus,
  • setVisible

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • getApplicationContext (Context)
  • findViewById (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 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