htmlunit-2.7

    return getAttribute("marginwidth");
  }
  
  public final String getMarginHeightAttribute()
  {
    return getAttribute("marginheight");
  }
  
  public final String getNoResizeAttribute()
  {
    return getAttribute("noresize");
  }
  
  public final String getScrollingAttribute()
  {
    return getAttribute("scrolling");
  }
  
  public final String getOnLoadAttribute()
  {
    return getAttribute("onload");
  }
  
  public Page getEnclosedPage()
  {
    return getEnclosedWindow().getEnclosedPage();
  }
  
  public WebWindow getEnclosedWindow()
  {
    return enclosedWindow_;
  }
  
  public final void setSrcAttribute(String attribute)
  {
    setAttribute("src", attribute);
  }
  
  public void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
  {
    if (qualifiedName.equals("src")) {
      attributeValue = attributeValue.trim();
    }
    super.setAttributeNS(namespaceURI, qualifiedName, attributeValue);
    if (qualifiedName.equals("src"))
    {
      JavaScriptEngine jsEngine = getPage().getWebClient().getJavaScriptEngine();
      if ((!jsEngine.isScriptRunning()) || (attributeValue.startsWith("javascript:")))
      {
        loadInnerPageIfPossible(attributeValue);
      }
      else
      {
        final String src = attributeValue;
        PostponedAction action = new PostponedAction(getPage())
        {
          public void execute()
            throws Exception
          {
            if (getSrcAttribute().equals(src)) {
              loadInnerPage();
            }
          }
        };
        jsEngine.addPostponedAction(action);
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.BaseFrame
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebRequestSettings;
import com.gargoylesoftware.htmlunit.WebResponse;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;

public class HtmlLink
  extends HtmlElement
{
  private static final long serialVersionUID = 323745155296983364L;
  public static final String TAG_NAME = "link";
  private WebResponse cachedWebResponse_;
  
  HtmlLink(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  public final String getCharsetAttribute()
  {
    return getAttribute("charset");
  }
  
  public final String getHrefAttribute()
  {
    return getAttribute("href");
  }
  
  public final String getHrefLangAttribute()
  {
    return getAttribute("hreflang");
  }
  
  public final String getTypeAttribute()
  {
    return getAttribute("type");
  }
  
  public final String getRelAttribute()
  {
    return getAttribute("rel");
  }
  
  public final String getRevAttribute()
  {
    return getAttribute("rev");
  }
  
  public final String getMediaAttribute()
  {
    return getAttribute("media");
  }
  
  public final String getTargetAttribute()
  {
    return getAttribute("target");
  }
  
  public WebResponse getWebResponse(boolean downloadIfNeeded)
    throws IOException
  {
    if ((downloadIfNeeded) && (cachedWebResponse_ == null))
    {
      WebClient webclient = getPage().getWebClient();
      cachedWebResponse_ = webclient.loadWebResponse(getWebRequestSettings());
    }
    return cachedWebResponse_;
  }
  
  public WebRequestSettings getWebRequestSettings()
    throws MalformedURLException
  {
    HtmlPage page = (HtmlPage)getPage();
    URL url = page.getFullyQualifiedUrl(getHrefAttribute());
    WebRequestSettings request = new WebRequestSettings(url);
    request.setAdditionalHeader("Referer", page.getWebResponse().getRequestSettings().getUrl().toExternalForm());
    return request;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlLink
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlVariable
  extends HtmlElement
{
  private static final long serialVersionUID = 7539435832652322655L;
  public static final String TAG_NAME = "var";
  
  HtmlVariable(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlVariable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlFrame
  extends BaseFrame
{
  private static final long serialVersionUID = -6889609773688233917L;
  public static final String TAG_NAME = "frame";
  
  HtmlFrame(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlFrame
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import java.io.IOException;
import java.util.Map;
import org.apache.commons.lang.StringUtils;

public class HtmlImageInput
  extends HtmlInput
{
  private static final long serialVersionUID = -2955826367201282767L;
  private boolean wasPositionSpecified_;
  private int xPosition_;
  private int yPosition_;
  
  HtmlImageInput(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  public NameValuePair[] getSubmitKeyValuePairs()
  {
    String name = getNameAttribute();
    String prefix;
    String prefix;
    if (StringUtils.isEmpty(name)) {
      prefix = "";
    } else {
      prefix = name + ".";
    }
    if (wasPositionSpecified_)
    {
      NameValuePair valueX = new NameValuePair(prefix + 'x', String.valueOf(xPosition_));
      NameValuePair valueY = new NameValuePair(prefix + 'y', String.valueOf(yPosition_));
      if ((prefix.length() > 0) && (getPage().getWebClient().getBrowserVersion().isFirefox())) {
        return new NameValuePair[] { valueX, valueY, new NameValuePair(getNameAttribute(), getValueAttribute()) };
      }
      return new NameValuePair[] { valueX, valueY };
    }
    return new NameValuePair[] { new NameValuePair(getNameAttribute(), getValueAttribute()) };
  }
  
  public Page click()
    throws IOException
  {
    return click(0, 0);
  }
  
  protected void doClickAction()
    throws IOException
  {
    HtmlForm form = getEnclosingForm();
    if (form != null) {
      form.submit(this);
    }
  }
  
  public <P extends Page> P click(int x, int y)
    throws IOException, ElementNotFoundException
  {
    wasPositionSpecified_ = true;
    xPosition_ = x;
    yPosition_ = y;
    return super.click();
  }
  
  public void setDefaultValue(String defaultValue)
  {
    super.setDefaultValue(defaultValue);
    setValueAttribute(defaultValue);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlImageInput
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlAbbreviated
  extends HtmlElement
{
  private static final long serialVersionUID = 5776052132369544501L;
  public static final String TAG_NAME = "abbr";
  
  HtmlAbbreviated(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlAbbreviated
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlUnorderedList
  extends HtmlElement
{
  private static final long serialVersionUID = -6921066357090632169L;
  public static final String TAG_NAME = "ul";
  
  HtmlUnorderedList(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  public final String getTypeAttribute()
  {
    return getAttribute("type");
  }
  
  public final String getCompactAttribute()
  {
    return getAttribute("compact");
  }
  
  protected boolean isBlock()
  {
    return true;
  }
  
  protected boolean isEmptyXmlTagExpanded()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlUnorderedList
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import java.util.Iterator;
import java.util.NoSuchElementException;

public class HtmlTableRow$CellIterator
  implements Iterator<HtmlTableCell>
{
  private HtmlTableCell nextCell_;
  private HtmlForm currentForm_;
  
  public HtmlTableRow$CellIterator(HtmlTableRow paramHtmlTableRow)
  {
    setNextCell(paramHtmlTableRow.getFirstChild());
  }
  
  public boolean hasNext()
  {
    return nextCell_ != null;
  }
  
  public HtmlTableCell next()
    throws NoSuchElementException
  {
    return nextCell();
  }
  
  public void remove()
    throws IllegalStateException
  {
    if (nextCell_ == null) {
      throw new IllegalStateException();
    }
    DomNode sibling = nextCell_.getPreviousSibling();
    if (sibling != null) {
      sibling.remove();
    }
  }
  
  public HtmlTableCell nextCell()
    throws NoSuchElementException
  {
    if (nextCell_ != null)
    {
      HtmlTableCell result = nextCell_;
      setNextCell(nextCell_.getNextSibling());
      return result;
    }
    throw new NoSuchElementException();
  }
  
  private void setNextCell(DomNode node)
  {
    nextCell_ = null;
    for (DomNode next = node; next != null; next = next.getNextSibling())
    {
      if ((next instanceof HtmlTableCell))
      {
        nextCell_ = ((HtmlTableCell)next);
        return;
      }
      if ((currentForm_ == null) && ((next instanceof HtmlForm)))
      {
        currentForm_ = ((HtmlForm)next);
        setNextCell(next.getFirstChild());
        return;
      }
    }
    if (currentForm_ != null)
    {
      DomNode form = currentForm_;
      currentForm_ = null;
      setNextCell(form.getNextSibling());
    }
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTableRow.CellIterator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

public class HtmlTableRow
  extends HtmlElement
{
  private static final long serialVersionUID = 1296770669696592851L;
  public static final String TAG_NAME = "tr";
  
  HtmlTableRow(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  public CellIterator getCellIterator()
  {
    return new CellIterator();
  }
  
  public List<HtmlTableCell> getCells()
  {
    List<HtmlTableCell> result = new ArrayList();
    for (CellIterator iterator = getCellIterator(); iterator.hasNext();) {
      result.add(iterator.next());
    }
    return Collections.unmodifiableList(result);
  }
  
  public HtmlTableCell getCell(int index)
    throws IndexOutOfBoundsException
  {
    int count = 0;
    for (CellIterator iterator = getCellIterator(); iterator.hasNext(); count++)
    {
      HtmlTableCell next = iterator.nextCell();
      if (count == index) {
        return next;
      }
    }
    throw new IndexOutOfBoundsException();
  }
  
  public final String getAlignAttribute()
  {
    return getAttribute("align");
  }
  
  public final String getCharAttribute()
  {
    return getAttribute("char");
  }
  
  public final String getCharoffAttribute()
  {
    return getAttribute("charoff");
  }
  
  public final String getValignAttribute()
  {
    return getAttribute("valign");
  }
  
  public HtmlTable getEnclosingTable()
  {
    return (HtmlTable)getEnclosingElement("table");
  }
  
  public final String getBgcolorAttribute()
  {
    return getAttribute("bgcolor");
  }
  
  public class CellIterator
    implements Iterator<HtmlTableCell>
  {
    private HtmlTableCell nextCell_;
    private HtmlForm currentForm_;
    
    public CellIterator()
    {
      setNextCell(getFirstChild());
    }
    
    public boolean hasNext()
    {
      return nextCell_ != null;
    }
    
    public HtmlTableCell next()
      throws NoSuchElementException
    {
      return nextCell();
    }
    
    public void remove()
      throws IllegalStateException
    {
      if (nextCell_ == null) {
        throw new IllegalStateException();
      }
      DomNode sibling = nextCell_.getPreviousSibling();
      if (sibling != null) {
        sibling.remove();
      }
    }
    
    public HtmlTableCell nextCell()
      throws NoSuchElementException
    {
      if (nextCell_ != null)
      {
        HtmlTableCell result = nextCell_;
        setNextCell(nextCell_.getNextSibling());
        return result;
      }
      throw new NoSuchElementException();
    }
    
    private void setNextCell(DomNode node)
    {
      nextCell_ = null;
      for (DomNode next = node; next != null; next = next.getNextSibling())
      {
        if ((next instanceof HtmlTableCell))
        {
          nextCell_ = ((HtmlTableCell)next);
          return;
        }
        if ((currentForm_ == null) && ((next instanceof HtmlForm)))
        {
          currentForm_ = ((HtmlForm)next);
          setNextCell(next.getFirstChild());
          return;
        }
      }
      if (currentForm_ != null)
      {
        DomNode form = currentForm_;
        currentForm_ = null;
        setNextCell(form.getNextSibling());
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTableRow
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import java.util.Iterator;
import java.util.NoSuchElementException;

class HtmlTable$RowIterator
  implements Iterator<HtmlTableRow>, Iterable<HtmlTableRow>
{
  private HtmlTableRow nextRow_;
  private TableRowGroup currentGroup_;
  
  public HtmlTable$RowIterator(HtmlTable paramHtmlTable)
  {
    setNextRow(paramHtmlTable.getFirstChild());
  }
  
  public boolean hasNext()
  {
    return nextRow_ != null;
  }
  
  public HtmlTableRow next()
    throws NoSuchElementException
  {
    return nextRow();
  }
  
  public void remove()
    throws IllegalStateException
  {
    if (nextRow_ == null) {
      throw new IllegalStateException();
    }
    DomNode sibling = nextRow_.getPreviousSibling();
    if (sibling != null) {
      sibling.remove();
    }
  }
  
  public HtmlTableRow nextRow()
    throws NoSuchElementException
  {
    if (nextRow_ != null)
    {
      HtmlTableRow result = nextRow_;
      setNextRow(nextRow_.getNextSibling());
      return result;
    }
    throw new NoSuchElementException();
  }
  
  private void setNextRow(DomNode node)
  {
    nextRow_ = null;
    for (DomNode next = node; next != null; next = next.getNextSibling())
    {
      if ((next instanceof HtmlTableRow))
      {
        nextRow_ = ((HtmlTableRow)next);
        return;
      }
      if ((currentGroup_ == null) && ((next instanceof TableRowGroup)))
      {
        currentGroup_ = ((TableRowGroup)next);
        setNextRow(next.getFirstChild());
        return;
      }
    }
    if (currentGroup_ != null)
    {
      DomNode group = currentGroup_;
      currentGroup_ = null;
      setNextRow(group.getNextSibling());
    }
  }
  
  public Iterator<HtmlTableRow> iterator()
  {
    return this;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTable.RowIterator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

public class HtmlTable
  extends HtmlElement
{
  private static final long serialVersionUID = 2484055580262042798L;
  public static final String TAG_NAME = "table";
  
  HtmlTable(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  public final HtmlTableCell getCellAt(int rowIndex, int columnIndex)
  {
    RowIterator rowIterator = getRowIterator();
    for (int rowNo = 0; rowIterator.hasNext(); rowNo++)
    {
      HtmlTableRow row = rowIterator.nextRow();
      HtmlTableRow.CellIterator cellIterator = row.getCellIterator();
      for (int colNo = 0; cellIterator.hasNext(); colNo++)
      {
        HtmlTableCell cell = cellIterator.nextCell();
        if ((rowNo <= rowIndex) && (rowNo + cell.getRowSpan() > rowIndex) && 
          (colNo <= columnIndex) && (colNo + cell.getColumnSpan() > columnIndex)) {
          return cell;
        }
      }
    }
    return null;
  }
  
  private RowIterator getRowIterator()
  {
    return new RowIterator();
  }
  
  public List<HtmlTableRow> getRows()
  {
    List<HtmlTableRow> result = new ArrayList();
    for (RowIterator iterator = getRowIterator(); iterator.hasNext();) {
      result.add(iterator.next());
    }
    return Collections.unmodifiableList(result);
  }
  
  public HtmlTableRow getRow(int index)
    throws IndexOutOfBoundsException
  {
    int count = 0;
    for (RowIterator iterator = getRowIterator(); iterator.hasNext(); count++)
    {
      HtmlTableRow next = iterator.nextRow();
      if (count == index) {
        return next;
      }
    }
    throw new IndexOutOfBoundsException();
  }
  
  public final int getRowCount()
  {
    int count = 0;
    for (RowIterator iterator = getRowIterator(); iterator.hasNext(); iterator.next()) {
      count++;
    }
    return count;
  }
  
  public final HtmlTableRow getRowById(String id)
    throws ElementNotFoundException
  {
    RowIterator iterator = new RowIterator();
    while (iterator.hasNext())
    {
      HtmlTableRow row = iterator.next();
      if (row.getAttribute("id").equals(id)) {
        return row;
      }
    }
    throw new ElementNotFoundException("tr", "id", id);
  }
  
  public String getCaptionText()
  {
    for (HtmlElement element : getChildElements()) {
      if ((element instanceof HtmlCaption)) {
        return element.asText();
      }
    }
    return null;
  }
  
  public HtmlTableHeader getHeader()
  {
    for (HtmlElement element : getChildElements()) {
      if ((element instanceof HtmlTableHeader)) {
        return (HtmlTableHeader)element;
      }
    }
    return null;
  }
  
  public HtmlTableFooter getFooter()
  {
    for (HtmlElement element : getChildElements()) {
      if ((element instanceof HtmlTableFooter)) {
        return (HtmlTableFooter)element;
      }
    }
    return null;
  }
  
  public List<HtmlTableBody> getBodies()
  {
    List<HtmlTableBody> bodies = new ArrayList();
    for (HtmlElement element : getChildElements()) {
      if ((element instanceof HtmlTableBody)) {
        bodies.add((HtmlTableBody)element);
      }
    }
    return bodies;
  }
  
  public final String getSummaryAttribute()
  {
    return getAttribute("summary");
  }
  
  public final String getWidthAttribute()
  {
    return getAttribute("width");
  }
  
  public final String getBorderAttribute()
  {
    return getAttribute("border");
  }
  
  public final String getFrameAttribute()
  {
    return getAttribute("frame");
  }
  
  public final String getRulesAttribute()
  {
    return getAttribute("rules");
  }
  
  public final String getCellSpacingAttribute()
  {
    return getAttribute("cellspacing");
  }
  
  public final String getCellPaddingAttribute()
  {
    return getAttribute("cellpadding");
  }
  
  public final String getAlignAttribute()
  {
    return getAttribute("align");
  }
  
  public final String getBgcolorAttribute()
  {
    return getAttribute("bgcolor");
  }
  
  private class RowIterator
    implements Iterator<HtmlTableRow>, Iterable<HtmlTableRow>
  {
    private HtmlTableRow nextRow_;
    private TableRowGroup currentGroup_;
    
    public RowIterator()
    {
      setNextRow(getFirstChild());
    }
    
    public boolean hasNext()
    {
      return nextRow_ != null;
    }
    
    public HtmlTableRow next()
      throws NoSuchElementException
    {
      return nextRow();
    }
    
    public void remove()
      throws IllegalStateException
    {
      if (nextRow_ == null) {
        throw new IllegalStateException();
      }
      DomNode sibling = nextRow_.getPreviousSibling();
      if (sibling != null) {
        sibling.remove();
      }
    }
    
    public HtmlTableRow nextRow()
      throws NoSuchElementException
    {
      if (nextRow_ != null)
      {
        HtmlTableRow result = nextRow_;
        setNextRow(nextRow_.getNextSibling());
        return result;
      }
      throw new NoSuchElementException();
    }
    
    private void setNextRow(DomNode node)
    {
      nextRow_ = null;
      for (DomNode next = node; next != null; next = next.getNextSibling())
      {
        if ((next instanceof HtmlTableRow))
        {
          nextRow_ = ((HtmlTableRow)next);
          return;
        }
        if ((currentGroup_ == null) && ((next instanceof TableRowGroup)))
        {
          currentGroup_ = ((TableRowGroup)next);
          setNextRow(next.getFirstChild());
          return;
        }
      }
      if (currentGroup_ != null)
      {
        DomNode group = currentGroup_;
        currentGroup_ = null;
        setNextRow(group.getNextSibling());
      }
    }
    
    public Iterator<HtmlTableRow> iterator()
    {
      return this;
    }
  }
  
  protected boolean isBlock()
  {
    return true;
  }
  
  protected boolean isEmptyXmlTagExpanded()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import org.apache.commons.lang.StringEscapeUtils;

public class HtmlSubmitInput
  extends HtmlInput
{
  private static final long serialVersionUID = -615974535731910492L;
  private static final String DEFAULT_VALUE = "Submit Query";
  
  HtmlSubmitInput(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
    if ((getPage().getWebClient().getBrowserVersion().isIE()) && (!hasAttribute("value"))) {
      setAttribute("value", "Submit Query");
    }
  }
  
  protected void doClickAction()
    throws IOException
  {
    HtmlForm form = getEnclosingForm();
    if (form != null) {
      form.submit(this);
    }
  }
  
  public void reset() {}
  
  public String asText()
  {
    String text = getValueAttribute();
    if (text == ATTRIBUTE_NOT_DEFINED) {
      text = "Submit Query";
    }
    return text;
  }
  
  protected void printOpeningTagContentAsXml(PrintWriter printWriter)
  {
    printWriter.print(getTagName());
    for (DomAttr attribute : getAttributesMap().values()) {
      if ((!attribute.getNodeName().equals("value")) || (!attribute.getValue().equals("Submit Query")))
      {
        printWriter.print(" ");
        String name = attribute.getNodeName();
        printWriter.print(name);
        printWriter.print("=\"");
        printWriter.print(StringEscapeUtils.escapeXml(attribute.getNodeValue()));
        printWriter.print("\"");
      }
    }
  }
  
  public NameValuePair[] getSubmitKeyValuePairs()
  {
    if ((getNameAttribute().length() != 0) && (!hasAttribute("value"))) {
      return new NameValuePair[] { new NameValuePair(getNameAttribute(), "Submit Query") };
    }
    return super.getSubmitKeyValuePairs();
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlSubmitInput
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.util.StringUtils;
import java.io.PrintWriter;
import org.w3c.dom.DOMException;
import org.w3c.dom.Text;

public class DomText
  extends DomCharacterData
  implements Text
{
  private static final long serialVersionUID = 6589779086230288951L;
  public static final String NODE_NAME = "#text";
  
  public DomText(SgmlPage page, String data)
  {
    super(page, data);
  }
  
  public DomText splitText(int offset)
  {
    if ((offset < 0) || (offset > getLength())) {
      throw new IllegalArgumentException("offset: " + offset + " data.length: " + getLength());
    }
    DomText newText = createSplitTextNode(offset);
    setData(getData().substring(0, offset));
    if (getParentNode() != null) {
      getParentNode().insertBefore(newText, getNextSibling());
    }
    return newText;
  }
  
  protected DomText createSplitTextNode(int offset)
  {
    return new DomText(getPage(), getData().substring(offset));
  }
  
  @Deprecated
  public DomText splitDomText(int offset)
  {
    return splitText(offset);
  }
  
  public boolean isElementContentWhitespace()
  {
    throw new UnsupportedOperationException("DomText.isElementContentWhitespace is not yet implemented.");
  }
  
  public String getWholeText()
  {
    throw new UnsupportedOperationException("DomText.getWholeText is not yet implemented.");
  }
  
  public Text replaceWholeText(String content)
    throws DOMException
  {
    throw new UnsupportedOperationException("DomText.replaceWholeText is not yet implemented.");
  }
  
  public short getNodeType()
  {
    return 3;
  }
  
  public String getNodeName()
  {
    return "#text";
  }
  
  protected void printXml(String indent, PrintWriter printWriter)
  {
    if (getData().trim().length() != 0)
    {
      printWriter.print(indent);
      String data = getData();
      if ((!(getParentNode() instanceof HtmlStyle)) || (!data.startsWith("<!--")) || (!data.endsWith("-->"))) {
        data = StringUtils.escapeXmlChars(data);
      }
      printWriter.println(data);
    }
    printChildrenAsXml(indent, printWriter);
  }
  
  public String toString()
  {
    return asText();
  }
  
  protected boolean isTrimmedText()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.DomText
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public abstract class HtmlTableCell
  extends HtmlElement
{
  private static final long serialVersionUID = -6362606593038086865L;
  
  protected HtmlTableCell(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  public int getColumnSpan()
  {
    String spanString = getAttribute("colspan");
    if ((spanString == null) || (spanString.length() == 0)) {
      return 1;
    }
    return Integer.parseInt(spanString);
  }
  
  public int getRowSpan()
  {
    String spanString = getAttribute("rowspan");
    if ((spanString == null) || (spanString.length() == 0)) {
      return 1;
    }
    return Integer.parseInt(spanString);
  }
  
  public HtmlTableRow getEnclosingRow()
  {
    return (HtmlTableRow)getEnclosingElement("tr");
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTableCell
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlTableHeader
  extends TableRowGroup
{
  private static final long serialVersionUID = -5251209522769249017L;
  public static final String TAG_NAME = "thead";
  
  HtmlTableHeader(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTableHeader
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.WebClient;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public abstract class TableRowGroup
  extends HtmlElement
{
  private static final long serialVersionUID = 7770034627964024386L;
  
  protected TableRowGroup(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
    boolean ff = getPage().getWebClient().getBrowserVersion().isFirefox();
    if ((ff) && (!hasAttribute("align"))) {
      setAttribute("align", "left");
    }
  }
  
  public final List<HtmlTableRow> getRows()
  {
    List<HtmlTableRow> resultList = new ArrayList();
    for (HtmlElement element : getChildElements()) {
      if ((element instanceof HtmlTableRow)) {
        resultList.add((HtmlTableRow)element);
      }
    }
    return resultList;
  }
  
  public final String getAlignAttribute()
  {
    return getAttribute("align");
  }
  
  public final String getCharAttribute()
  {
    return getAttribute("char");
  }
  
  public final String getCharoffAttribute()
  {
    return getAttribute("charoff");
  }
  
  public final String getValignAttribute()
  {
    return getAttribute("valign");
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.TableRowGroup
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlTableFooter
  extends TableRowGroup
{
  private static final long serialVersionUID = -6442808304225679408L;
  public static final String TAG_NAME = "tfoot";
  
  HtmlTableFooter(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTableFooter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlTableBody
  extends TableRowGroup
{
  private static final long serialVersionUID = 676435852636735076L;
  public static final String TAG_NAME = "tbody";
  
  HtmlTableBody(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlTableBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.util.KeyDataPair;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
import org.apache.commons.lang.StringUtils;

public class HtmlFileInput
  extends HtmlInput
{
  private static final long serialVersionUID = 7925479292349207154L;
  private String contentType_;
  private byte[] data_;
  private String valueAtFocus_;
  
  HtmlFileInput(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
    setAttribute("value", "");
    if (page.getWebClient().getBrowserVersion().isIE()) {
      setDefaultValue("");
    }
  }
  
  public final byte[] getData()
  {
    return data_;
  }
  
  public final void setData(byte[] data)
  {
    data_ = data;
  }
  
  public NameValuePair[] getSubmitKeyValuePairs()
  {
    String value = getValueAttribute();
    if (StringUtils.isEmpty(value)) {
      return new NameValuePair[] { new KeyDataPair(getNameAttribute(), new File(""), null, null) };
    }
    File file = null;
    if (value.startsWith("file:/"))
    {
      if ((value.startsWith("file://")) && (!value.startsWith("file:///"))) {
        value = "file:///" + value.substring(7);
      }
      try
      {
        file = new File(new URI(value));
      }
      catch (URISyntaxException e) {}
    }
    if (file == null) {
      file = new File(value);
    }
    String contentType;
    String contentType;
    if (contentType_ == null) {
      contentType = getPage().getWebClient().guessContentType(file);
    } else {
      contentType = contentType_;
    }
    String charset = getPage().getPageEncoding();
    KeyDataPair keyDataPair = new KeyDataPair(getNameAttribute(), file, contentType, charset);
    keyDataPair.setData(data_);
    return new NameValuePair[] { keyDataPair };
  }
  
  public void reset() {}
  
  public void setDefaultValue(String defaultValue)
  {
    setDefaultValue(defaultValue, false);
  }
  
  public void setContentType(String contentType)
  {
    contentType_ = contentType;
  }
  
  public String getContentType()
  {
    return contentType_;
  }
  
  public void focus()
  {
    super.focus();
    
    valueAtFocus_ = getValueAttribute();
  }
  
  void removeFocus()
  {
    super.removeFocus();
    if (!valueAtFocus_.equals(getValueAttribute())) {
      executeOnChangeHandlerIfAppropriate(this);
    }
    valueAtFocus_ = null;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlFileInput
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlCitation
  extends HtmlElement
{
  private static final long serialVersionUID = 2087929241497523503L;
  public static final String TAG_NAME = "cite";
  
  HtmlCitation(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlCitation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

class HtmlPasswordInput$1
  extends DoTypeProcessor
{
  private static final long serialVersionUID = -1938284467263013958L;
  
  HtmlPasswordInput$1(HtmlPasswordInput paramHtmlPasswordInput) {}
  
  void typeDone(String newValue, int newCursorPosition)
  {
    this$0.setAttribute("value", newValue);
    this$0.setSelectionStart(newCursorPosition);
    this$0.setSelectionEnd(newCursorPosition);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlPasswordInput.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.html.impl.SelectableTextInput;
import com.gargoylesoftware.htmlunit.html.impl.SelectionDelegate;
import java.util.Map;

public class HtmlPasswordInput
  extends HtmlInput
  implements SelectableTextInput
{
  private static final long serialVersionUID = -1074283471317076942L;
  private final SelectionDelegate selectionDelegate_ = new SelectionDelegate(this);
  private final DoTypeProcessor doTypeProcessor_ = new DoTypeProcessor()
  {
    private static final long serialVersionUID = -1938284467263013958L;
    
    void typeDone(String newValue, int newCursorPosition)
    {
      setAttribute("value", newValue);
      setSelectionStart(newCursorPosition);
      setSelectionEnd(newCursorPosition);
    }
  };
  
  HtmlPasswordInput(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
  
  protected boolean isSubmittableByEnter()
  {
    return true;
  }
  
  public void select()
  {
    selectionDelegate_.select();
  }
  
  public String getSelectedText()
  {
    return selectionDelegate_.getSelectedText();
  }
  
  public String getText()
  {
    return getValueAttribute();
  }
  
  public void setText(String text)
  {
    setValueAttribute(text);
  }
  
  public int getSelectionStart()
  {
    return selectionDelegate_.getSelectionStart();
  }
  
  public void setSelectionStart(int selectionStart)
  {
    selectionDelegate_.setSelectionStart(selectionStart);
  }
  
  public int getSelectionEnd()
  {
    return selectionDelegate_.getSelectionEnd();
  }
  
  public void setSelectionEnd(int selectionEnd)
  {
    selectionDelegate_.setSelectionEnd(selectionEnd);
  }
  
  protected void doType(char c, boolean shiftKey, boolean ctrlKey, boolean altKey)
  {
    doTypeProcessor_.doType(getValueAttribute(), getSelectionStart(), getSelectionEnd(), c, shiftKey, ctrlKey, altKey);
  }
  
  protected Object clone()
    throws CloneNotSupportedException
  {
    return new HtmlPasswordInput(getNamespaceURI(), getQualifiedName(), getPage(), getAttributesMap());
  }
  
  public void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
  {
    super.setAttributeNS(namespaceURI, qualifiedName, attributeValue);
    if ((qualifiedName.equals("value")) && ((getPage() instanceof HtmlPage)))
    {
      setSelectionStart(attributeValue.length());
      setSelectionEnd(attributeValue.length());
    }
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlPasswordInput
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlFieldSet
  extends HtmlElement
{
  private static final long serialVersionUID = 4444607415016780539L;
  public static final String TAG_NAME = "fieldset";
  
  HtmlFieldSet(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr> attributes)
  {
    super(namespaceURI, qualifiedName, page, attributes);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.html.HtmlFieldSet
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import java.util.Map;

public class HtmlSubscript
  extends HtmlElement
{
  private static final long serialVersionUID = -797016719113068436L;
  public static final String TAG_NAME = "sub";
  
  HtmlSubscript(String namespaceURI, String qualifiedName, SgmlPage page, Map<String, DomAttr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd