package org.kobjects.nativehtml.android;

import android.content.Context;
import android.widget.FrameLayout;
import java.io.Reader;
import java.net.URI;
import org.kobjects.nativehtml.dom.Element;
import org.kobjects.nativehtml.io.DefaultRequestHandler;
import org.kobjects.nativehtml.io.HtmlParser;
import org.kobjects.nativehtml.io.InternalLinkHandler;

public class HtmlView extends FrameLayout implements InternalLinkHandler {
    private final AndroidPlatform platform;
    private final HtmlParser htmlParser;
    private DefaultRequestHandler requestHandler;

    public HtmlView(Context context) {
        super(context);
        platform = new AndroidPlatform(context);
        requestHandler = new DefaultRequestHandler(platform);
        requestHandler.setInternalLinkHandler(this);
        htmlParser = new HtmlParser(platform, requestHandler, null);
    }

    public void addInternalLinkPrefix(String s) {
        requestHandler.addInternalLinkPrefix(s);
    }

    public void loadHtml(URI url) {
        requestHandler.openInternalLink(url);
    }

    public void loadHtml(Reader reader, URI baseUrl) {
        Element element = htmlParser.parse(reader, baseUrl);

        removeAllViews();
        if (element instanceof AbstractAndroidComponentElement) {
            addView((AbstractAndroidComponentElement) element);
        }
    }


}

@@ -86,72 +86,63 @@
 oid.
-widget.FrameLayout;%0Aimport java.io.Reader;%0Aimport java.net.URI
+util.AttributeSet;%0Aimport android.widget.FrameLayout
 ;%0A
+%0A
 impo
@@ -340,16 +340,61 @@
 ndler;%0A%0A
+import java.io.Reader;%0Aimport java.net.URI;%0A%0A
 public c
@@ -476,58 +476,8 @@
 ate 
-final AndroidPlatform platform;%0A    private final 
 Html
@@ -609,24 +609,24 @@
 ntext);%0A
-
         
 platform
@@ -617,16 +617,375 @@
         
+init(context);%0A    %7D%0A%0A    public HtmlView(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A        init(context);%0A    %7D%0A%0A    public HtmlView(Context context, AttributeSet attrs, int defStyleAttr) %7B%0A        super(context, attrs, defStyleAttr);%0A        init(context);%0A    %7D%0A%0A    private void init(Context context) %7B%0A        AndroidPlatform 
 platform

Add the required constructors for direct usage in layout xml files.