当前位置: 首页>>代码示例>>Java>>正文


Java ListPeer.getSelectedIndexes方法代码示例

本文整理汇总了Java中java.awt.peer.ListPeer.getSelectedIndexes方法的典型用法代码示例。如果您正苦于以下问题:Java ListPeer.getSelectedIndexes方法的具体用法?Java ListPeer.getSelectedIndexes怎么用?Java ListPeer.getSelectedIndexes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.peer.ListPeer的用法示例。


在下文中一共展示了ListPeer.getSelectedIndexes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeNotify

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Removes the peer for this list.  The peer allows us to modify the
 * list's appearance without changing its functionality.
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        ListPeer peer = (ListPeer)this.peer;
        if (peer != null) {
            selected = peer.getSelectedIndexes();
        }
        super.removeNotify();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:List.java

示例2: getSelectedIndex

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Returns the index of the currently selected item.  -1 will be returned
 * if there are no selected rows or if there are multiple selected rows.
 *
 * @return The index of the selected row.
 */
public synchronized int getSelectedIndex()
{
  if (peer != null)
    {
      ListPeer l = (ListPeer) peer;
      selected = l.getSelectedIndexes ();
    }

  if (selected == null || selected.length != 1)
    return -1;

  return selected[0];
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:List.java

示例3: getSelectedIndexes

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Returns an array containing the indexes of the rows that are
 * currently selected.
 *
 * @return A list of indexes of selected rows.
 */
public synchronized int[] getSelectedIndexes()
{
  if (peer != null)
    {
      ListPeer l = (ListPeer) peer;
      selected = l.getSelectedIndexes();
    }

  return selected;
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:List.java

示例4: getSelectedIndexes

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Returns an array containing the indexes of the rows that are 
 * currently selected.
 *
 * @return A list of indexes of selected rows.
 */
public synchronized int[] getSelectedIndexes()
{
  if (peer != null)
    {
      ListPeer l = (ListPeer) peer;
      selected = l.getSelectedIndexes();
    }   
 
  return selected;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:17,代码来源:List.java

示例5: removeNotify

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
    * Removes the peer for this list.  The peer allows us to modify the
    * list's appearance without changing its functionality.
    */
   public void removeNotify() {
   	synchronized (getTreeLock()) {
    ListPeer peer = (ListPeer)this.peer;
    if (peer != null) {
	selected = peer.getSelectedIndexes();
    }
    super.removeNotify();
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:14,代码来源:List.java

示例6: writeObject

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable <code>ItemListeners</code>
 * and <code>ActionListeners</code> as optional data.
 * The non-serializable listeners are detected and
 * no attempt is made to serialize them.
 *
 * @serialData <code>null</code> terminated sequence of 0
 *  or more pairs; the pair consists of a <code>String</code>
 *  and an <code>Object</code>; the <code>String</code>
 *  indicates the type of object and is one of the
 *  following:
 *  <code>itemListenerK</code> indicating an
 *    <code>ItemListener</code> object;
 *  <code>actionListenerK</code> indicating an
 *    <code>ActionListener</code> object
 *
 * @param s the <code>ObjectOutputStream</code> to write
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#itemListenerK
 * @see java.awt.Component#actionListenerK
 * @see #readObject(ObjectInputStream)
 */
private void writeObject(ObjectOutputStream s)
  throws IOException
{
  synchronized (this) {
    ListPeer peer = (ListPeer)this.peer;
    if (peer != null) {
      selected = peer.getSelectedIndexes();
    }
  }
  s.defaultWriteObject();

  AWTEventMulticaster.save(s, itemListenerK, itemListener);
  AWTEventMulticaster.save(s, actionListenerK, actionListener);
  s.writeObject(null);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:List.java

示例7: writeObject

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Writes default serializable fields to stream.  Writes
 * a list of serializable {@code ItemListeners}
 * and {@code ActionListeners} as optional data.
 * The non-serializable listeners are detected and
 * no attempt is made to serialize them.
 *
 * @serialData {@code null} terminated sequence of 0
 *  or more pairs; the pair consists of a {@code String}
 *  and an {@code Object}; the {@code String}
 *  indicates the type of object and is one of the
 *  following:
 *  {@code itemListenerK} indicating an
 *    {@code ItemListener} object;
 *  {@code actionListenerK} indicating an
 *    {@code ActionListener} object
 *
 * @param s the {@code ObjectOutputStream} to write
 * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
 * @see java.awt.Component#itemListenerK
 * @see java.awt.Component#actionListenerK
 * @see #readObject(ObjectInputStream)
 */
private void writeObject(ObjectOutputStream s)
  throws IOException
{
  synchronized (this) {
    ListPeer peer = (ListPeer)this.peer;
    if (peer != null) {
      selected = peer.getSelectedIndexes();
    }
  }
  s.defaultWriteObject();

  AWTEventMulticaster.save(s, itemListenerK, itemListener);
  AWTEventMulticaster.save(s, actionListenerK, actionListener);
  s.writeObject(null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:List.java

示例8: writeObject

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
    * Writes default serializable fields to stream.  Writes
    * a list of serializable <code>ItemListeners</code>
    * and <code>ActionListeners</code> as optional data.
    * The non-serializable listeners are detected and
    * no attempt is made to serialize them.
    *
    * @serialData <code>null</code> terminated sequence of 0
    *  or more pairs; the pair consists of a <code>String</code>
    *  and an <code>Object</code>; the <code>String</code>
    *  indicates the type of object and is one of the
    *  following:
    *  <code>itemListenerK</code> indicating an
    *    <code>ItemListener</code> object;
    *  <code>actionListenerK</code> indicating an
    *    <code>ActionListener</code> object
    *
    * @param s the <code>ObjectOutputStream</code> to write
    * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
    * @see java.awt.Component#itemListenerK
    * @see java.awt.Component#actionListenerK
    * @see #readObject(ObjectInputStream)
    */
   private void writeObject(ObjectOutputStream s)
     throws IOException
   {
     synchronized (this) {
ListPeer peer = (ListPeer)this.peer;
if (peer != null) {
  selected = peer.getSelectedIndexes();
}
     }
     s.defaultWriteObject();

     AWTEventMulticaster.save(s, itemListenerK, itemListener);
     AWTEventMulticaster.save(s, actionListenerK, actionListener);
     s.writeObject(null);
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:39,代码来源:List.java

示例9: getSelectedIndexes

import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
 * Gets the selected indexes on the list.
 *
 * @return        an array of the selected indexes on this scrolling list;
 *                if no item is selected, a zero-length array is returned.
 * @see           #select
 * @see           #deselect
 * @see           #isIndexSelected
 */
public synchronized int[] getSelectedIndexes() {
    ListPeer peer = (ListPeer)this.peer;
    if (peer != null) {
        selected = peer.getSelectedIndexes();
    }
    return selected.clone();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:List.java


注:本文中的java.awt.peer.ListPeer.getSelectedIndexes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。