added custom code
[old-projects.git] / ekit / com / hexidec / ekit / component / ExtendedHTMLEditorKit.java
index bb2b14a..07c1122 100644 (file)
@@ -44,17 +44,24 @@ import javax.swing.text.Document;
 
 public class ExtendedHTMLEditorKit extends HTMLEditorKit
 {
+       private String BaseUrl = "";
+       
        /** Constructor
          */
        public ExtendedHTMLEditorKit()
        {
        }
+       
+       public ExtendedHTMLEditorKit(String baseurl)
+       {
+               BaseUrl = baseurl;
+       }
 
        /** Method for returning a ViewFactory which handles the image rendering.
          */
        public ViewFactory getViewFactory()
        {
-               return new HTMLFactoryExtended();
+               return new HTMLFactoryExtended(BaseUrl);
        }
 
 /* WACKY GERMAN CODE */
@@ -76,10 +83,13 @@ public class ExtendedHTMLEditorKit extends HTMLEditorKit
          */
        public static class HTMLFactoryExtended extends HTMLFactory implements ViewFactory
        {
+               private String BaseUrl;
+
                /** Constructor
                  */
-               public HTMLFactoryExtended()
+               public HTMLFactoryExtended(String baseurl)
                {
+                       BaseUrl = baseurl;
                }
 
                /** Method to handle IMG tags and
@@ -93,7 +103,7 @@ public class ExtendedHTMLEditorKit extends HTMLEditorKit
                                HTML.Tag tagType = (HTML.Tag)obj;
                                if(tagType == HTML.Tag.IMG)
                                {
-                                       return new RelativeImageView(elem);
+                                       return new RelativeImageView(elem,BaseUrl);
                                }
                        }
                        return super.create(elem);