Hi !

I think you've got an error in your css declaration "text-color". Currently,
this declaration is not really compliant. You have to use "color" instead
of.
I've tried what you have done, and it works for me :

Entry Point module :

public class testApplication implements EntryPoint {
    private HTML html;
    private Button clickMeButton;
    public void onModuleLoad() {
        RootPanel rootPanel = RootPanel.get();

        clickMeButton = new Button();
        rootPanel.add(clickMeButton);
        clickMeButton.setText("Blue Text !");
        clickMeButton.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                getHtml().addStyleDependentName("blue");
            }

        });

        html = new HTML("Blue text ?");
        rootPanel.add(html, 9, 48);
        html.setSize("467px", "309px");
        html.setStyleName("gwt-HTML");
    }
    public HTML getHtml() {
        return html;
    }
}

As you can see, I've explicitly defined the styleName before setting the
dependant Style Name.
And in my application, I've defined an extended style sheet in the xml :

<stylesheet src="testApplication.css"/>

In this style sheet, i've defined the two styles :

.gwt-HTML {
    font-family: Arial, sans-serif;
    font-size: 10px;
}
.gwt-HTML-blue{
    text-color: blue;
}

And it works fine for me.

Regards,
Damien


2009/2/4 Steven <[email protected]>

>
> Hi all,
>
> I would like to create a non-editable color-controlled (or style-
> controlled) textArea for a GWT chat application.
> For instance I woud like to change the color (or the text-style) of
> the messages depending on the message sender.
>
> To do that, after reading previous posts on this group I  created a
> HTML object, adding some very basic styles to the  standard.css file.
> In fact my application inherits the standard theme, as I can read from
> the xml configuration file:
>
> <inherits name="com.google.gwt.user.theme.standard.Standard"/>
>
> So for instance I added the .gwt-HTML-blue {text-color: blue} to the
> standard.css file the and in my application i invoked the method:
> HTMLObject.addSyleDependentname("blue")
>
> BUT  actually nothing happens: my message in the textArea is still
> black instead of blue.
>
> Why?
>
> I tried also to create a RichTextArea object and I tried  to invoke
> the method
> RichTextAreaObject.getBasicFormatter().toggleBold(), in order to set
> my message as bold,
> BUT  it doesn't work
>
> Thanks in advance, bye
>
>
> Steve
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to