Great suggestion! I have added a stylesheet file into the 'gwtOutput' folder of my web dynamic project, with the correct styles which you suggested: now it works fine.
Thanks! Steve On Feb 5, 7:37 am, Damien Picard <picard.dam...@gmail.com> wrote: > Sorry, the correct styles are : > > .gwt-HTML { > font-family: Arial, sans-serif; > font-size: 10px;} > > .gwt-HTML-blue{ > color: blue; > > } > > (I've added text-color in order to test this declaration :p ) > > 2009/2/5 Damien Picard <picard.dam...@gmail.com> > > > > > 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 <cannata.stef...@gmail.com> > > >> 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- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---