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


Java ListPeer.delItems方法代码示例

本文整理汇总了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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:28,代码来源:List.java

示例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);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:28,代码来源:List.java

示例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);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:28,代码来源:List.java

示例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);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:28,代码来源:List.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:List.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:List.java

示例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);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:List.java

示例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);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:23,代码来源:List.java

示例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);
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:17,代码来源:List.java


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