Java 类org.w3c.dom.html2.HTMLOptionsCollection 实例源码

项目:javify    文件:DomHTMLSelectElement.java   
public int getSelectedIndex()
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      if (option.getSelected())
        {
          return i;
        }
    }
  return -1;
}
项目:javify    文件:DomHTMLSelectElement.java   
public void setSelectedIndex(int selectedIndex)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (selectedIndex < 0 || selectedIndex >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      option.setSelected(i == selectedIndex);
    }
}
项目:javify    文件:DomHTMLSelectElement.java   
public HTMLOptionsCollection getOptions()
{
  DomHTMLCollection ret =
    new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
  ret.addNodeName("option");
  ret.evaluate();
  return ret;
}
项目:javify    文件:DomHTMLSelectElement.java   
public void remove(int index)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (index < 0 || index >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  HTMLOptionElement option = (HTMLOptionElement) options.item(index);
  option.getParentNode().removeChild(option);
}
项目:jvm-stm    文件:DomHTMLSelectElement.java   
public int getSelectedIndex()
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      if (option.getSelected())
        {
          return i;
        }
    }
  return -1;
}
项目:jvm-stm    文件:DomHTMLSelectElement.java   
public void setSelectedIndex(int selectedIndex)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (selectedIndex < 0 || selectedIndex >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      option.setSelected(i == selectedIndex);
    }
}
项目:jvm-stm    文件:DomHTMLSelectElement.java   
public HTMLOptionsCollection getOptions()
{
  DomHTMLCollection ret =
    new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
  ret.addNodeName("option");
  ret.evaluate();
  return ret;
}
项目:jvm-stm    文件:DomHTMLSelectElement.java   
public void remove(int index)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (index < 0 || index >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  HTMLOptionElement option = (HTMLOptionElement) options.item(index);
  option.getParentNode().removeChild(option);
}
项目:JamVM-PH    文件:DomHTMLSelectElement.java   
public int getSelectedIndex()
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      if (option.getSelected())
        {
          return i;
        }
    }
  return -1;
}
项目:JamVM-PH    文件:DomHTMLSelectElement.java   
public void setSelectedIndex(int selectedIndex)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (selectedIndex < 0 || selectedIndex >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      option.setSelected(i == selectedIndex);
    }
}
项目:JamVM-PH    文件:DomHTMLSelectElement.java   
public HTMLOptionsCollection getOptions()
{
  DomHTMLCollection ret =
    new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
  ret.addNodeName("option");
  ret.evaluate();
  return ret;
}
项目:JamVM-PH    文件:DomHTMLSelectElement.java   
public void remove(int index)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (index < 0 || index >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  HTMLOptionElement option = (HTMLOptionElement) options.item(index);
  option.getParentNode().removeChild(option);
}
项目:classpath    文件:DomHTMLSelectElement.java   
public int getSelectedIndex()
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      if (option.getSelected())
        {
          return i;
        }
    }
  return -1;
}
项目:classpath    文件:DomHTMLSelectElement.java   
public void setSelectedIndex(int selectedIndex)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (selectedIndex < 0 || selectedIndex >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  for (int i = 0; i < len; i++)
    {
      HTMLOptionElement option = (HTMLOptionElement) options.item(i);
      option.setSelected(i == selectedIndex);
    }
}
项目:classpath    文件:DomHTMLSelectElement.java   
public HTMLOptionsCollection getOptions()
{
  DomHTMLCollection ret =
    new DomHTMLCollection((DomHTMLDocument) getOwnerDocument(), this);
  ret.addNodeName("option");
  ret.evaluate();
  return ret;
}
项目:classpath    文件:DomHTMLSelectElement.java   
public void remove(int index)
{
  HTMLOptionsCollection options = getOptions();
  int len = options.getLength();
  if (index < 0 || index >= len)
    {
      throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
    }
  HTMLOptionElement option = (HTMLOptionElement) options.item(index);
  option.getParentNode().removeChild(option);
}