Tabnine Logo
KeyedComboBoxModel$ComboBoxItemPair
Code IndexAdd Tabnine to your IDE (free)

How to use
KeyedComboBoxModel$ComboBoxItemPair
in
org.jfree.ui

Best Java code snippets using org.jfree.ui.KeyedComboBoxModel$ComboBoxItemPair (Showing top 15 results out of 315)

origin: org.jfree/com.springsource.org.jfree

/**
 * Searches an element by its data value. This method is called by the
 * setSelectedItem method and returns the first occurence of the element.
 *
 * @param anItem the item
 * @return the index of the item or -1 if not found.
 */
private int findDataElementIndex(final Object anItem)
{
 if (anItem == null)
 {
  throw new NullPointerException("Item to find must not be null");
 }
 for (int i = 0; i < data.size(); i++)
 {
  final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(i);
  if (anItem.equals(datacon.getKey()))
  {
   return i;
  }
 }
 return -1;
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Tries to find the index of element with the given key. The key must not
 * be null.
 *
 * @param key the key for the element to be searched.
 * @return the index of the key, or -1 if not found.
 */
public int findElementIndex(final Object key)
{
 if (key == null)
 {
  throw new NullPointerException("Item to find must not be null");
 }
 for (int i = 0; i < data.size(); i++)
 {
  final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(i);
  if (key.equals(datacon.getValue()))
  {
   return i;
  }
 }
 return -1;
}
origin: org.jfree/jcommon

/**
 * Tries to find the index of element with the given key. The key must not
 * be null.
 *
 * @param key the key for the element to be searched.
 * @return the index of the key, or -1 if not found.
 */
public int findElementIndex(final Object key)
{
 if (key == null)
 {
  throw new NullPointerException("Item to find must not be null");
 }
 for (int i = 0; i < this.data.size(); i++)
 {
  final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(i);
  if (key.equals(datacon.getValue()))
  {
   return i;
  }
 }
 return -1;
}
origin: jfree/jcommon

/**
 * Returns the key from the given index.
 *
 * @param index the index of the key.
 * @return the the key at the specified index.
 */
public Object getKeyAt(final int index)
{
 if (index >= this.data.size())
 {
  return null;
 }
 if (index < 0)
 {
  return null;
 }
 final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(index);
 if (datacon == null)
 {
  return null;
 }
 return datacon.getKey();
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Returns the key from the given index.
 *
 * @param index the index of the key.
 * @return the the key at the specified index.
 */
public Object getKeyAt(final int index)
{
 if (index >= data.size())
 {
  return null;
 }
 if (index < 0)
 {
  return null;
 }
 final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(index);
 if (datacon == null)
 {
  return null;
 }
 return datacon.getKey();
}
origin: org.jfree/jcommon

/**
 * Searches an element by its data value. This method is called by the
 * setSelectedItem method and returns the first occurence of the element.
 *
 * @param anItem the item
 * @return the index of the item or -1 if not found.
 */
private int findDataElementIndex(final Object anItem)
{
 if (anItem == null)
 {
  throw new NullPointerException("Item to find must not be null");
 }
 for (int i = 0; i < this.data.size(); i++)
 {
  final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(i);
  if (anItem.equals(datacon.getKey()))
  {
   return i;
  }
 }
 return -1;
}
origin: jfree/jcommon

/**
 * Searches an element by its data value. This method is called by the
 * setSelectedItem method and returns the first occurence of the element.
 *
 * @param anItem the item
 * @return the index of the item or -1 if not found.
 */
private int findDataElementIndex(final Object anItem)
{
 if (anItem == null)
 {
  throw new NullPointerException("Item to find must not be null");
 }
 for (int i = 0; i < this.data.size(); i++)
 {
  final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(i);
  if (anItem.equals(datacon.getKey()))
  {
   return i;
  }
 }
 return -1;
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Returns the value at the specified index.
 *
 * @param index the requested index
 * @return the value at <code>index</code>
 */
public Object getElementAt(final int index)
{
 if (index >= data.size())
 {
  return null;
 }
 final ComboBoxItemPair datacon = (ComboBoxItemPair) data.get(index);
 if (datacon == null)
 {
  return null;
 }
 return datacon.getValue();
}
origin: org.jfree/jcommon

/**
 * Returns the key from the given index.
 *
 * @param index the index of the key.
 * @return the the key at the specified index.
 */
public Object getKeyAt(final int index)
{
 if (index >= this.data.size())
 {
  return null;
 }
 if (index < 0)
 {
  return null;
 }
 final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(index);
 if (datacon == null)
 {
  return null;
 }
 return datacon.getKey();
}
origin: org.jfree/jcommon

/**
 * Returns the value at the specified index.
 *
 * @param index the requested index
 * @return the value at <code>index</code>
 */
public Object getElementAt(final int index)
{
 if (index >= this.data.size())
 {
  return null;
 }
 final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(index);
 if (datacon == null)
 {
  return null;
 }
 return datacon.getValue();
}
origin: jfree/jcommon

/**
 * Returns the value at the specified index.
 *
 * @param index the requested index
 * @return the value at <code>index</code>
 */
public Object getElementAt(final int index)
{
 if (index >= this.data.size())
 {
  return null;
 }
 final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(index);
 if (datacon == null)
 {
  return null;
 }
 return datacon.getValue();
}
origin: jfree/jcommon

/**
 * Tries to find the index of element with the given key. The key must not
 * be null.
 *
 * @param key the key for the element to be searched.
 * @return the index of the key, or -1 if not found.
 */
public int findElementIndex(final Object key)
{
 if (key == null)
 {
  throw new NullPointerException("Item to find must not be null");
 }
 for (int i = 0; i < this.data.size(); i++)
 {
  final ComboBoxItemPair datacon = (ComboBoxItemPair) this.data.get(i);
  if (key.equals(datacon.getValue()))
  {
   return i;
  }
 }
 return -1;
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Adds a new entry to the model.
 *
 * @param key    the key
 * @param cbitem the display value.
 */
public void add(final Object key, final Object cbitem)
{
 final ComboBoxItemPair con = new ComboBoxItemPair(key, cbitem);
 data.add(con);
 final ListDataEvent evt = new ListDataEvent
   (this, ListDataEvent.INTERVAL_ADDED, data.size() - 2, data.size() - 2);
 fireListDataEvent(evt);
}
origin: org.jfree/jcommon

/**
 * Adds a new entry to the model.
 *
 * @param key    the key
 * @param cbitem the display value.
 */
public void add(final Object key, final Object cbitem)
{
 final ComboBoxItemPair con = new ComboBoxItemPair(key, cbitem);
 this.data.add(con);
 final ListDataEvent evt = new ListDataEvent
   (this, ListDataEvent.INTERVAL_ADDED, this.data.size() - 2, this.data.size() - 2);
 fireListDataEvent(evt);
}
origin: jfree/jcommon

/**
 * Adds a new entry to the model.
 *
 * @param key    the key
 * @param cbitem the display value.
 */
public void add(final Object key, final Object cbitem)
{
 final ComboBoxItemPair con = new ComboBoxItemPair(key, cbitem);
 this.data.add(con);
 final ListDataEvent evt = new ListDataEvent
   (this, ListDataEvent.INTERVAL_ADDED, this.data.size() - 2, this.data.size() - 2);
 fireListDataEvent(evt);
}
org.jfree.uiKeyedComboBoxModel$ComboBoxItemPair

Javadoc

The internal data carrier to map keys to values and vice versa.

Most used methods

  • <init>
    Creates a new item pair for the given key and value. The value can be changed later, if needed.
  • getKey
    Returns the key.
  • getValue
    Returns the value.

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • From CI to AI: The AI layer in your organization
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