Tabnine Logo
ArraySelection.getRequired
Code IndexAdd Tabnine to your IDE (free)

How to use
getRequired
method
in
com.badlogic.gdx.scenes.scene2d.utils.ArraySelection

Best Java code snippets using com.badlogic.gdx.scenes.scene2d.utils.ArraySelection.getRequired (Showing top 4 results out of 315)

origin: libgdx/libgdx

/** Sets the selection to only the passed item, if it is a possible choice.
 * @param item May be null. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (selection.getRequired() && items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: libgdx/libgdx

/** Sets the selection to only the passed item, if it is a possible choice.
 * @param item May be null. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (selection.getRequired() && items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: com.badlogicgames.gdx/gdx

/** Sets the selection to only the passed item, if it is a possible choice.
 * @param item May be null. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (selection.getRequired() && items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: bladecoder/bladecoder-adventure-engine

/**
 * Sets the current items, clearing the selection if it is no longer valid.
 * If a selection is {@link ArraySelection#getRequired()}, the first item is
 * selected.
 */
public void setItems(Array<T> newItems) {
  if (newItems == null)
    throw new IllegalArgumentException("newItems cannot be null.");
  items.clear();
  items.addAll(newItems);
  T selected = getSelected();
  if (!items.contains(selected, false)) {
    if (selection.getRequired() && items.size > 0)
      selection.set(items.first());
    else
      selection.clear();
  }
  invalidateHierarchy();
}
com.badlogic.gdx.scenes.scene2d.utilsArraySelectiongetRequired

Popular methods of ArraySelection

  • first
  • items
  • set
  • setRequired
  • addAll
  • choose
  • clear
  • contains
  • isDisabled
  • setActor
  • setProgrammaticChangeEvents
  • validate
    Removes objects from the selection that are no longer in the items array. If #getRequired() is true
  • setProgrammaticChangeEvents,
  • validate,
  • changed,
  • cleanup,
  • fireChangeEvent,
  • getMultiple,
  • revert,
  • setMultiple,
  • snapshot

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Vim 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