本文整理汇总了Java中java.awt.peer.ListPeer.delItems方法的典型用法代码示例。如果您正苦于以下问题:Java ListPeer.delItems方法的具体用法?Java ListPeer.delItems怎么用?Java ListPeer.delItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.ListPeer
的用法示例。
在下文中一共展示了ListPeer.delItems方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: delItem
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Deletes the item at the specified index.
*
* @param index The index of the item to delete.
*
* @exception IllegalArgumentException If the index is not valid
*
* @deprecated
*/
public void delItem(int index) throws IllegalArgumentException
{
boolean selected = false;
if (isSelected(index))
{
selected = true;
deselect(index);
}
items.removeElementAt (index);
if (selected)
select(index);
ListPeer peer = (ListPeer) getPeer();
if (peer != null)
peer.delItems (index, index);
}
示例2: replaceItem
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Replaces the item at the specified index with the specified item.
*
* @param item The new item value.
* @param index The index of the item to replace.
*
* @exception ArrayIndexOutOfBoundsException If the index is not valid.
*/
public synchronized void replaceItem(String item, int index)
throws ArrayIndexOutOfBoundsException
{
if ((index < 0) || (index >= items.size()))
throw new ArrayIndexOutOfBoundsException("Bad list index: " + index);
items.insertElementAt(item, index + 1);
items.removeElementAt (index);
if (peer != null)
{
ListPeer l = (ListPeer) peer;
/* We add first and then remove so that the selected
item remains the same */
l.add (item, index + 1);
l.delItems (index, index);
}
}
示例3: delItem
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Deletes the item at the specified index.
*
* @param index The index of the item to delete.
*
* @exception IllegalArgumentException If the index is not valid
*
* @deprecated
*/
public void delItem(int index) throws IllegalArgumentException
{
boolean selected = false;
if (isSelected(index))
{
selected = true;
deselect(index);
}
items.removeElementAt (index);
if (selected)
select(index);
ListPeer peer = (ListPeer) getPeer();
if (peer != null)
peer.delItems (index, index);
}
示例4: replaceItem
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Replaces the item at the specified index with the specified item.
*
* @param item The new item value.
* @param index The index of the item to replace.
*
* @exception ArrayIndexOutOfBoundsException If the index is not valid.
*/
public synchronized void replaceItem(String item, int index)
throws ArrayIndexOutOfBoundsException
{
if ((index < 0) || (index >= items.size()))
throw new ArrayIndexOutOfBoundsException("Bad list index: " + index);
items.insertElementAt(item, index + 1);
items.removeElementAt (index);
if (peer != null)
{
ListPeer l = (ListPeer) peer;
/* We add first and then remove so that the selected
item remains the same */
l.add (item, index + 1);
l.delItems (index, index);
}
}
示例5: delItems
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* @deprecated As of JDK version 1.1,
* Not for public use in the future.
* This method is expected to be retained only as a package
* private method.
*/
@Deprecated
public synchronized void delItems(int start, int end) {
for (int i = end; i >= start; i--) {
items.removeElementAt(i);
}
ListPeer peer = (ListPeer)this.peer;
if (peer != null) {
peer.delItems(start, end);
}
}
示例6: delItems
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Deletes the list items in the specified index range.
*
* @param start the beginning index of the range to delete
* @param end the ending index of the range to delete
* @deprecated As of JDK version 1.1,
* Not for public use in the future.
* This method is expected to be retained only as a package
* private method.
*/
@Deprecated
public synchronized void delItems(int start, int end) {
for (int i = end; i >= start; i--) {
items.removeElementAt(i);
}
ListPeer peer = (ListPeer)this.peer;
if (peer != null) {
peer.delItems(start, end);
}
}
示例7: delItems
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Deletes all items in the specified index range.
*
* @param start The beginning index of the range to delete.
* @param end The ending index of the range to delete.
*
* @exception IllegalArgumentException If the indexes are not valid
*
* @deprecated This method is deprecated for some unknown reason.
*/
public synchronized void delItems(int start, int end)
throws IllegalArgumentException
{
// We must run the loop in reverse direction.
for (int i = end; i >= start; --i)
items.removeElementAt (i);
if (peer != null)
{
ListPeer l = (ListPeer) peer;
l.delItems (start, end);
}
}
示例8: delItems
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* Deletes all items in the specified index range.
*
* @param start The beginning index of the range to delete.
* @param end The ending index of the range to delete.
*
* @exception IllegalArgumentException If the indexes are not valid
*
* @deprecated This method is deprecated for some unknown reason.
*/
public synchronized void delItems(int start, int end)
throws IllegalArgumentException
{
// We must run the loop in reverse direction.
for (int i = end; i >= start; --i)
items.removeElementAt (i);
if (peer != null)
{
ListPeer l = (ListPeer) peer;
l.delItems (start, end);
}
}
示例9: delItems
import java.awt.peer.ListPeer; //导入方法依赖的package包/类
/**
* @deprecated As of JDK version 1.1,
* Not for public use in the future.
* This method is expected to be retained only as a package
* private method.
*/
@Deprecated
public synchronized void delItems(int start, int end) {
for (int i = end; i >= start; i--) {
items.removeElementAt(i);
}
ListPeer peer = (ListPeer)this.peer;
if (peer != null) {
peer.delItems(start, end);
}
}