本文整理汇总了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();
}
}
示例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];
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}