/** * Initialize this example. */ @ShowcaseSource @Override public Widget onInitialize() { // 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%"); // Add the components to a panel Grid grid = new Grid(2, 1); grid.setStyleName("cw-RichText"); grid.setWidget(0, 0, toolbar); grid.setWidget(1, 0, area); return grid; }
protected void onRender(Element parent, int index) { super.onRender(parent, index); final RichTextArea area = new RichTextArea(); area.setSize("1000", "600"); new OrderService().getOrderTemplate(new OrderService.Listener() { public void onSuccess(String content) { area.setHTML(content); } }); RichTextToolbar toolbar = new RichTextToolbar(area); // toolbar.setWidth("100%"); // Add the components to a panel Grid grid = new Grid(2, 1); grid.setStyleName("cw-RichText"); grid.setWidget(0, 0, toolbar); grid.setWidget(1, 0, area); // grid.setSize("100%", "100%"); add(grid); Button button = new Button("Save"); add(button); }
public void setFont(final String fontName, final RichTextArea.FontSize fontSize) { Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() { // Need a delay for Firefox browser @Override public boolean execute() { rta.getFormatter().setFontName(fontName); if (fontSize != null) { rta.getFormatter().setFontSize(fontSize); } return false; } }, 100); }
/** * {@inheritDoc} */ @Override public HasHTML addTextArea(final RichTextElementDTO richTextElement, final FoldPanel sectionPanel, final boolean draftMode) { if (draftMode) { final RichTextArea textArea = new RichTextArea(); textArea.setHTML(richTextElement.getText()); textArea.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { globalFormatterArray[0] = textArea.getFormatter(); } }); sectionPanel.add(textArea); return textArea; } else { final HTML html = new HTML(); final String value = richTextElement.getText(); if (ClientUtils.isBlank(value)) { html.setText(I18N.CONSTANTS.reportEmptySection()); html.addStyleName(STYLE_PROJECT_REPORT_FIELD_EMPTY); } else { html.setHTML(value); html.addStyleName(STYLE_PROJECT_REPORT_FIELD); } sectionPanel.add(html); return null; } }
/** * {@inheritDoc} */ @Override public HasHTML addKeyQuestion(final KeyQuestionDTO keyQuestion, final FoldPanel sectionPanel, final boolean draftMode) { keyQuestionState.increaseCount(); keyQuestion.setNumber(keyQuestionState.getCount()); // Rich text field. final RichTextArea textArea = new RichTextArea(); final RichTextElementDTO richTextElementDTO = keyQuestion.getRichTextElementDTO(); if (richTextElementDTO != null) { textArea.setHTML(richTextElementDTO.getText()); } // Compas icon. final ImageResource icon; if (ClientUtils.isBlank(textArea.getText())) { icon = ToolbarImages.IMAGES.compasRed(); } else { icon = ToolbarImages.IMAGES.compasGreen(); keyQuestionState.increaseValids(); } sectionPanel.addToolButton(icon, new ClickHandler() { @Override public void onClick(ClickEvent event) { KeyQuestionDialog.getDialog(keyQuestion, textArea, sectionPanel, sectionPanel.getToolButtonCount(), keyQuestionState, draftMode).show(); } }); return textArea; }
private static Dialog getDialog() { if (keyQuestionDialog == null) { final Dialog dialog = new Dialog(); dialog.setButtons(Dialog.OKCANCEL); dialog.setModal(true); dialog.setWidth("640px"); dialog.setResizable(false); dialog.setLayout(new RowLayout(Orientation.VERTICAL)); // Question label final Label questionLabel = new Label("key-question"); questionLabel.addStyleName("project-report-key-question-label"); dialog.add(questionLabel); // Text area final RichTextArea textArea = new RichTextArea(); textArea.setStyleName("project-report-key-question"); dialog.add(textArea); // Toolbar final ToolBar toolBar = new ToolBar(); ReportsView.createRichTextToolbar(toolBar, new RichTextArea.Formatter[] {textArea.getFormatter()}); dialog.setTopComponent(toolBar); // Cancel button dialog.getButtonById(Dialog.CANCEL).addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { dialog.hide(); } }); keyQuestionDialog = dialog; } return keyQuestionDialog; }
public void initToolBar(RichTextArea richtext) { if(!initiated) { initiated = true; //Save the reference to the RichText area we refer to and get the interfaces to the stylings styleText = richtext; styleTextFormatter = styleText.getFormatter(); //Add KeyUp and Click-Handler to the RichText, so that we can actualize the toolbar if neccessary styleText.addKeyUpHandler(evHandler); styleText.addClickHandler(evHandler); } }
public TextAreaExample() { super("Text Area"); TextArea text = new TextArea(); text.setCharacterWidth(30); text.setVisibleLines(5); add(text); RichTextArea rich = new RichTextArea(); rich.setHTML("Rich <i>text</i> <b>area</b>"); add(rich); }
public void refresh() { BeanObject article = getCurState().getArticle(); if (article != null && article.getString(IArticleCatagory.ID) != null) { contentPanelGeneral.updateValues(article.getProperties()); RichTextArea wid = (RichTextArea)grid.getWidget(1, 0); wid.setText(article.getString("content")); // this.article = null; } else { contentPanelGeneral.clearValues(); getCurState().setEditting(false); } }
public CubaRichTextToolbarWidget(RichTextArea richText) { super(richText); }
@Override protected void createRichTextToolbar(RichTextArea rta) { formatter = new CubaRichTextToolbarWidget(rta); }
/** * Creates a new toolbar that drives the given rich text area. * * @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); } }
/** * Creates a new toolbar that drives the given rich text area. * * @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 handlers for updating status, so don't hook them up // unless at least basic editing is supported. richText.addKeyUpHandler(handler); richText.addClickHandler(handler); } }
@Override public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) { getWidget().client = client; getWidget().id = uidl.getId(); if (uidl.hasAttribute("fontName")) { RichTextArea.FontSize fontSize = null; if (uidl.hasAttribute("fontSize")) { int fontSizeValue = uidl.getIntAttribute("fontSize"); for (RichTextArea.FontSize fontSizesConstant : fontSizesConstants) { if (fontSizesConstant.getNumber() == fontSizeValue) { fontSize = fontSizesConstant; } } } getWidget().setFont(uidl.getStringAttribute("fontName"), fontSize); } if (uidl.hasAttribute("insertHtml")) { getWidget().insertHtml(uidl.getStringAttribute("insertHtml")); } if (uidl.hasVariable("text")) { String newValue = uidl.getStringVariable("text"); if (!SharedUtil.equals(newValue, cachedValue)) { getWidget().setValue(newValue); cachedValue = newValue; } } if (!isRealUpdate(uidl)) { return; } getWidget().setEnabled(isEnabled()); getWidget().setReadOnly(isReadOnly()); getWidget().immediate = getState().immediate; int newMaxLength = uidl.hasAttribute("maxLength") ? uidl .getIntAttribute("maxLength") : -1; if (newMaxLength >= 0) { if (getWidget().maxLength == -1) { getWidget().keyPressHandler = getWidget().rta .addKeyPressHandler(getWidget()); } getWidget().maxLength = newMaxLength; } else if (getWidget().maxLength != -1) { getWidget().getElement().setAttribute("maxlength", ""); getWidget().maxLength = -1; getWidget().keyPressHandler.removeHandler(); } if (uidl.hasAttribute("selectAll")) { getWidget().selectAll(); } }
public static Dialog getDialog(final KeyQuestionDTO keyQuestion, final RichTextArea textArea, final FoldPanel panel, final int toolButtonIndex, final KeyQuestionState keyQuestionState, boolean enabled) { final Dialog dialog = getDialog(); dialog.setHeadingHtml(I18N.MESSAGES.reportKeyQuestionDialogTitle(Integer.toString(keyQuestion.getNumber()))); // Question label final Label question = (Label) dialog.getWidget(0); question.setTitle(keyQuestion.getLabel()); // Rich text editor final RichTextArea dialogTextArea = (RichTextArea) dialog.getWidget(1); dialogTextArea.setHTML(textArea.getHTML()); final boolean wasValid = !"".equals(textArea.getText()); // OK Button final Button okButton = dialog.getButtonById(Dialog.OK); okButton.removeAllListeners(); if (enabled) { dialog.getTopComponent().enable(); dialogTextArea.setEnabled(true); okButton.setVisible(true); okButton.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { dialog.hide(); textArea.setHTML(dialogTextArea.getHTML()); final boolean isValid = !"".equals(dialogTextArea.getText()); final ToolbarImages images = GWT.create(ToolbarImages.class); if (isValid) { panel.setToolButtonImage(toolButtonIndex, images.compasGreen()); if (!wasValid) keyQuestionState.increaseValids(); } else { panel.setToolButtonImage(toolButtonIndex, images.compasRed()); if (wasValid) keyQuestionState.decreaseValids(); } } }); } else { okButton.setVisible(false); dialog.getTopComponent().disable(); dialogTextArea.setEnabled(false); } return dialog; }
/** * Creates a new toolbar that drives the given rich text area. * * @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 handlers for updating status, so don't hook // them up // unless at least basic editing is supported. richText.addKeyUpHandler(handler); richText.addClickHandler(handler); } }
/** * Creates a new toolbar that drives the given rich text area. * * @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(fonts = createFontList()); bottomPanel.add(fontSizes = createFontSizes()); // bottomPanel.add(foreColors = createColorList("Foreground")); bottomPanel.add(foreColors); foreColors.addValueChangeHandler(handler); foreColors.setText(TEXT_FOREGROUND); foreColors.addStyleName("rdn-TextBoxShort"); // bottomPanel.add(backColors = createColorList("Background")); bottomPanel.add(backColors); backColors.addValueChangeHandler(handler); backColors.setText(TEXT_BACKGROUND); backColors.addStyleName("rdn-TextBoxShort"); // We only use these handlers for updating status, so don't hook // them up unless at least basic editing is supported. richText.addKeyUpHandler(handler); richText.addClickHandler(handler); } }
public RichTextToolbar(RichTextArea richtext) { this(); initToolBar(richtext); }
/** * Creates a new toolbar that drives the given rich text area. * * @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 handlers for updating status, so don't hook them up // unless at least basic editing is supported. richText.addKeyUpHandler(handler); richText.addClickHandler(handler); } }
public JSTextPane() { loaded = false; tries = 0; container = new SimplePanel(); OpenJWT.setElementFloat(container.getElement(), "left"); richTextArea = new RichTextArea(); richTextArea.setSize("100%", "100%"); container.add(richTextArea); boldBt = new JSButton(); boldBt.addStyleName("bold"); boldBt.setPixelWidth(30); boldBt.addClickListener(this); italicBt = new JSButton(); italicBt.addStyleName("italic"); italicBt.setPixelWidth(30); italicBt.addClickListener(this); underlineBt = new JSButton(); underlineBt.addStyleName("underline"); underlineBt.setPixelWidth(30); underlineBt.addClickListener(this); justifyLeftBt = new JSButton(); justifyLeftBt.addStyleName("justifyLeft"); justifyLeftBt.setPixelWidth(30); justifyLeftBt.addClickListener(this); justifyCenterBt = new JSButton(); justifyCenterBt.addStyleName("justifyCenter"); justifyCenterBt.setPixelWidth(30); justifyCenterBt.addClickListener(this); justifyRightBt = new JSButton(); justifyRightBt.addStyleName("justifyRight"); justifyRightBt.setPixelWidth(30); justifyRightBt.addClickListener(this); insertImgBt = new JSButton(); insertImgBt.addStyleName("insertImg"); insertImgBt.setPixelWidth(30); insertImgBt.addClickListener(this); addComponent(boldBt); addComponent(italicBt); addComponent(underlineBt); addComponent(justifyLeftBt); addComponent(justifyCenterBt); addComponent(justifyRightBt); if (richTextArea.getExtendedFormatter() != null) addComponent(insertImgBt);; addRow(); addComponent(container); addStyleName("textPane"); }
/** * Creates a new toolbar that drives the given rich text area. * * @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) { topPanel.add(backColors = createColorList("Background")); topPanel.add(foreColors = createColorList("Foreground")); topPanel.add(fonts = createFontList()); topPanel.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); } }
protected void initUI() { RichTextArea area = new RichTextArea(); }