Sebastian,

Sorry it's taken so long for anyone to respond. This sounds like useful
functionality, and I would suggest creating an issue (
http://code.google.com/p/google-web-toolkit/issues/) and a patch for public
discussion (http://gwt-code-reviews.appspot.com/). That way it will be
easier for people to try out your patch and refine it.

Cheers,
joel.

On Fri, Jan 22, 2010 at 9:55 AM, Sebastian <[email protected]> wrote:

> Hello,
>
> I was missing the ability to format a block with <h1> - <h6> tags. I
> researched the topic and build a patch which allows to insert block
> tags. It makes use of the FormatBlock command.
>
> I would like to ask, if you are interested in the patch and discuss
> the coding decision I took.
>
> 1)
> I couldn't find any guidance on testing. I have tested with Safari 4,
> Firefox 3.5, IE 6, IE 8 and IE 8 in IE 7 mode.
>
> 2)
> Currently only the tags <h1> to <h6>, <pre>, <address> and <p> work
> stable across browsers. To limit the choice of tags, I have created an
> enum to limit the possible values.
>
> public static enum BlockTag {
>                H1, H2, H3, H4, H5, H6, PRE, ADDRESS, P;
>      final String OPEN = "<";
>      final String CLOSE = ">";
>      public String toTag() {
>        return OPEN+name()+CLOSE;
>      }
>    }
>
> The advantage is that you cannot provide the wrong tags. The
> disadvantage is that you cannot provide tags which are for example
> supported in newer browser versions.
>
> The rest of the tag is just a new method in RichTextAreaImplStd.
>  public void formatBlock(RichTextArea.BlockTag blockTag) {
>    execCommand("FormatBlock", blockTag.toTag());
>  }
>
> Shall I leave it that way or turn it into a String parameter?
>
> 3)
> Should I create a bug tracking entry for this?
>
> If somebody is interested, here are some links, I found interesting
> while exploring the topic.
>
> http://discerning.com/topics/software/ttw.html
> http://help.dottoro.com/ljcvtcaw.php
> http://www.quirksmode.org/dom/execCommand.html
>
> Best Regards
>
> Sebastian Hennebrueder
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to