Ok,
taking a look at the RichTextArea in showcase
http://gwt.google.com/samples/Showcase/Showcase.html#!CwRichText
it looks like in order to get the toolbar you need to use
RichTextToolbar and give it the area.
// Create the text area and toolbar
RichTextArea area = new RichTextArea();
area.ensureDebugId("cwRichText-area");
area.setSize("100%", "14em");
RichTextToolbar toolbar = new RichTextToolbar(area);
toolbar.ensureDebugId("cwRichText-toolbar");
toolbar.setWidth("100%");
As one widget will require another one, this will probably help:
http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Using_a_widget
Cheers!
Tristan
On Jun 3, 9:13 am, krz <[email protected]> wrote:
> I need RichTextArea for my TextPresenter
>
> I have an interface TextPresenter, and TextPresenterImp.java as its
> implementation:
>
> public class TextPresenterImp extends BasePresenter<Display>
> implements TextPresenter{
>
> @Inject
> public TextPresenterImp(EventBus eventBus, Display display) {
> super(eventBus, display);
> }
>
> @Override
> public void bind() {
> super.bind();
>
> }
>
> I also have a TextWidget.java what extends Composite and implements
> Display, and there knows the objects in TextWidget.ui.xml
> Now it looks like this:
>
> public class TextWidget extends Composite implements Display{
>
> private static TextWidgetUiBinder uiBinder =
> GWT.create(TextWidgetUiBinder.class);
>
> @UiTemplate("ui/TextWidget.ui.xml")
> interface TextWidgetUiBinder extends UiBinder<Widget, TextWidget> {
> }
>
> @UiField RichTextArea textInputField;
>
> public TextWidget() {
> initWidget(uiBinder.createAndBindUi(this));
>
> }
>
> public HasHTML getEnteredText() {
> return this.textInputField;
> }
>
> public Widget asWidget() {
> return this;
> }
>
> }
>
> And my TextWidget.ui.xml looks like this:
>
> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
> xmlns:g="urn:import:com.google.gwt.user.client.ui">
> <g:HTMLPanel>
> <g:RichTextArea ui:field="textInputField"></g:RichTextArea>
> </g:HTMLPanel>
> </ui:UiBinder>
>
> The problem is that if TextWidget is shown, it only has the text input
> fielt, but no text formation toolbar
>
> big thanx for any help
> On 3 Jun., 08:47, Tristan <[email protected]> wrote:
>
>
>
> > you're going to have to be more specific. There are many ways of
> > hooking up MVP and UiBinder together, what way are you using?
>
> > Where are you putting your RichTextArea? What do your presenters and
> > views look like and how are they wired together?
>
> > On Jun 2, 3:19 pm, krz <[email protected]> wrote:
>
> > > Hello,
>
> > > For my programm i use MVP, and UIbinder for drawing the GUI. i wanted
> > > to create an RichTextArea with the toolbar ( richTextToolbar), i spend
> > > now 2 hours trying things out, im totaly frustrated, and dont know how
> > > to do it... can anyone help me?
--
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.