X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=ekit%2Fcom%2Fhexidec%2Fekit%2Fcomponent%2FExtendedHTMLEditorKit.java;h=07c112263d08e6c1f8cb5d94b9e2c92237a3bbf5;hb=c47fa64d719ab7f5062a87fbf5cc55a7916c5c53;hp=bb2b14a8f42d1c84252e57853098d617a3e1d951;hpb=ecd369f6391da62e76ab72ae88ecaeba30ba81c7;p=old-projects.git diff --git a/ekit/com/hexidec/ekit/component/ExtendedHTMLEditorKit.java b/ekit/com/hexidec/ekit/component/ExtendedHTMLEditorKit.java index bb2b14a..07c1122 100644 --- a/ekit/com/hexidec/ekit/component/ExtendedHTMLEditorKit.java +++ b/ekit/com/hexidec/ekit/component/ExtendedHTMLEditorKit.java @@ -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);