public Toolbar()

in widgets/src/main/java/org/apache/hupa/widgets/editor/Toolbar.java [201:252]


    public Toolbar(RichTextArea richText, ToolbarConstants strings) {
        this.richText = richText;
        this.formatter = richText.getFormatter();
//        this.extended = richText.getFormatter();

        topPanel.setWidth("100%");

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

        if (formatter != null) {
            topPanel.add(bold = createToggleButton(images.bold(), strings.editor_bold()));
            topPanel.add(italic = createToggleButton(images.italic(), strings.editor_italic()));
            topPanel.add(underline = createToggleButton(images.underline(), strings.editor_underline()));
            topPanel.add(backColors = createPushButton(images.backColors(), strings.editor_background()));
            topPanel.add(foreColors = createPushButton(images.foreColors(), strings.editor_foreground()));
            topPanel.add(fontFamily = createPushButton(images.fonts(), strings.editor_font()));
            topPanel.add(fontSize = createPushButton(images.fontSizes(), strings.editor_size()));
            topPanel.add(subscript = createToggleButton(images.subscript(), strings.editor_subscript()));
            topPanel.add(superscript = createToggleButton(images.superscript(), strings.editor_superscript()));
            topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), strings.editor_justifyLeft()));
            topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), strings.editor_justifyCenter()));
            topPanel.add(justifyRight = createPushButton(images.justifyRight(), strings.editor_justifyRight()));
        }

        if (formatter != null) {
            topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.editor_strikeThrough()));
            topPanel.add(indent = createPushButton(images.indent(), strings.editor_indent()));
            topPanel.add(outdent = createPushButton(images.outdent(), strings.editor_outdent()));
            topPanel.add(hr = createPushButton(images.hr(), strings.editor_hr()));
            topPanel.add(ol = createPushButton(images.ol(), strings.editor_ol()));
            topPanel.add(ul = createPushButton(images.ul(), strings.editor_ul()));
            topPanel.add(insertImage = createPushButton(images.insertImage(), strings.editor_insertImage()));
            topPanel.add(createLink = createPushButton(images.createLink(), strings.editor_createLink()));
            topPanel.add(removeLink = createPushButton(images.removeLink(), strings.editor_removeLink()));
            topPanel.add(removeFormat = createPushButton(images.removeFormat(), strings.editor_removeFormat()));
        }


        HTML topEmtyCell = new HTML("");
        topPanel.add(topEmtyCell);
        topPanel.setCellWidth(topEmtyCell, "100%");

        richText.addKeyDownHandler(handler);
        richText.addKeyUpHandler(handler);
        richText.addClickHandler(handler);
        backColorsPicker.addValueChangeHandler(colorHandler);
        foreColorsPicker.addValueChangeHandler(colorHandler);
        fontFamilyPicker.addValueChangeHandler(fontHandler);
        fontSizePicker.addValueChangeHandler(fontHandler);
    }