Example usage for com.google.gwt.user.client.ui RichTextArea addClickListener

List of usage examples for com.google.gwt.user.client.ui RichTextArea addClickListener

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui RichTextArea addClickListener.

Prototype

@Deprecated
public void addClickListener(ClickListener listener) 

Source Link

Usage

From source file:cazcade.vortex.widgets.client.misc.toolbar.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 *
 * @param richText the rich text area to be controlled
 *//*from  www  .ja v  a  2s . co  m*/
public RichTextToolbar(@Nonnull final RichTextArea richText, final boolean large) {
    super();
    this.richText = richText;
    basic = richText.getBasicFormatter();
    extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        if (large) {
            topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
            topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        }
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        if (large) {
            topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
            topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
            topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        }
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        if (large) {
            topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
        }
    }

    if (basic != null) {
        if (large) {
            bottomPanel.add(backColors = createColorList("Background"));
            bottomPanel.add(foreColors = createColorList("Foreground"));
        }
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:com.apress.progwt.client.college.gui.ext.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * // w  w  w  . j  ava2s  .c  o  m
 * @param richText
 *            the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Foreground"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't
        // hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:com.google.gwt.gears.sample.gwtnote.client.ui.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * /*w  w  w  .ja  v a 2s.com*/
 * @param richText the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Foreground"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:com.jcommerce.gwt.client.widgets.richTextBox.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * //  www . ja  v a2 s.c  om
 * @param richText the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");
    richText.addStyleName("hasRichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Foreground"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:com.ritchey.athleticEventManage.client.ui.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * /*  w ww.  java  2s  .c om*/
 * @param richText the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");

    if (basic != null) {

        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Foreground"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:com.ritchey.studentSuccessManage.client.ui.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * //www.  ja  va  2 s  .  c o  m
 * @param richText the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");

    if (basic != null) {

        //      topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        //      topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        //      topPanel.add(underline = createToggleButton(images.underline(),
        //          strings.underline()));
        //      topPanel.add(subscript = createToggleButton(images.subscript(),
        //          strings.subscript()));
        //      topPanel.add(superscript = createToggleButton(images.superscript(),
        //          strings.superscript()));
        //      topPanel.add(justifyLeft = createPushButton(images.justifyLeft(),
        //          strings.justifyLeft()));
        //      topPanel.add(justifyCenter = createPushButton(images.justifyCenter(),
        //          strings.justifyCenter()));
        //      topPanel.add(justifyRight = createPushButton(images.justifyRight(),
        //          strings.justifyRight()));
    }

    if (extended != null) {
        //      topPanel.add(strikethrough = createToggleButton(images.strikeThrough(),
        //          strings.strikeThrough()));
        //      topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        //      topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        //      topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        //      topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        //      topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        //      topPanel.add(insertImage = createPushButton(images.insertImage(),
        //          strings.insertImage()));
        //      topPanel.add(createLink = createPushButton(images.createLink(),
        //          strings.createLink()));
        //      topPanel.add(removeLink = createPushButton(images.removeLink(),
        //          strings.removeLink()));
        //      topPanel.add(removeFormat = createPushButton(images.removeFormat(),
        //          strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Foreground"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:jw.bznetwork.client.rt.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * //from   w  ww  . java2s .  co  m
 * @param richText
 *            the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText, boolean allowImageUpload) {
    this.allowImageUpload = allowImageUpload;
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");
    richText.addStyleName("hasRichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Foreground"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook
        // them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:net.pleso.odbui.client.widgets.richtext.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * /*from   www .  ja v a  2 s.c om*/
 * @param richText the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.setWidth("100%");
    outer.add(topPanel);
    //outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    disclosurePanel.setContent(outer);
    disclosurePanel.addEventHandler(new DisclosureHandlerImpl());
    verticalOuterDisclosure.setWidth("100%");
    verticalOuterDisclosure.add(outer);
    verticalOuterDisclosure.add(disclosurePanel);
    disclosurePanel.setHeader(horizontalHeader);

    horizontalOuterDisclosure.add(verticalOuterDisclosure);

    initWidget(horizontalOuterDisclosure);
    setStyleName("gwt-RichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        //      bottomPanel.add(backColors = createColorList("Background"));
        //      bottomPanel.add(foreColors = createColorList("Foreground"));
        //      bottomPanel.add(fonts = createFontList());
        //      bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:org.iucn.sis.client.ui.richtexteditor.RichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * /*  w  w  w  .jav  a  2  s.c  om*/
 * @param richText
 *            the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");
    richText.addStyleName("hasRichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        // topPanel.add(justifyLeft = createPushButton(images.justifyLeft(),
        // strings.justifyLeft()));
        // topPanel.add(justifyCenter =
        // createPushButton(images.justifyCenter(),
        // strings.justifyCenter()));
        // topPanel.add(justifyRight =
        // createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        // topPanel.add(strikethrough =
        // createToggleButton(images.strikeThrough(),
        // strings.strikeThrough()));
        // topPanel.add(indent = createPushButton(images.indent(),
        // strings.indent()));
        // topPanel.add(outdent = createPushButton(images.outdent(),
        // strings.outdent()));
        // topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        // topPanel.add(insertImage = createPushButton(images.insertImage(),
        // strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        // bottomPanel.add(foreColors = createColorList("Foreground"));
        // bottomPanel.add(fonts = createFontList());
        // bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook
        // them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}

From source file:org.kuali.continuity.admin.main.client.controls.RichTextToolbar.java

License:Educational Community License

/**
 * Creates a new toolbar that drives the given rich text area.
 * /*  www .jav  a 2  s  .  co  m*/
 * @param richText the rich text area to be controlled
 */
public RichTextToolbar(RichTextArea richText) {
    this.richText = richText;
    this.basic = richText.getBasicFormatter();
    this.extended = richText.getExtendedFormatter();

    outer.add(topPanel);
    outer.add(bottomPanel);
    topPanel.setWidth("100%");
    bottomPanel.setWidth("100%");

    initWidget(outer);
    setStyleName("gwt-RichTextToolbar");
    richText.addStyleName("hasRichTextToolbar");

    if (basic != null) {
        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(subscript = createToggleButton(images.subscript(), strings.subscript()));
        topPanel.add(superscript = createToggleButton(images.superscript(), strings.superscript()));
        topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.justifyLeft()));
        topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.justifyCenter()));
        topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.justifyRight()));
    }

    if (extended != null) {
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));
        topPanel.add(indent = createPushButton(images.indent(), strings.indent()));
        topPanel.add(outdent = createPushButton(images.outdent(), strings.outdent()));
        topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
        topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
        topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
        topPanel.add(insertImage = createPushButton(images.insertImage(), strings.insertImage()));
        topPanel.add(createLink = createPushButton(images.createLink(), strings.createLink()));
        topPanel.add(removeLink = createPushButton(images.removeLink(), strings.removeLink()));
        topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.removeFormat()));
    }

    if (basic != null) {
        bottomPanel.add(backColors = createColorList("Background"));
        bottomPanel.add(foreColors = createColorList("Text Color"));
        bottomPanel.add(fonts = createFontList());
        bottomPanel.add(fontSizes = createFontSizes());

        // We only use these listeners for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyboardListener(listener);
        richText.addClickListener(listener);
    }
}