Example usage for com.vaadin.ui RichTextArea setStyleName

List of usage examples for com.vaadin.ui RichTextArea setStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui RichTextArea setStyleName.

Prototype

public void setStyleName(String style);

Source Link

Document

Sets one or more user-defined style names of the component, replacing any previous user-defined styles.

Usage

From source file:fr.amapj.view.engine.popup.formpopup.AbstractFormPopup.java

License:Open Source License

protected RichTextArea addRichTextAeraField(String title, Object propertyId) {
    RichTextArea f = new RichTextArea(title);
    binder.bind(f, propertyId);//from w  w  w.  ja  va2 s .  com

    f.setNullRepresentation("");
    f.setStyleName(ChameleonTheme.TEXTFIELD_BIG);
    f.setWidth("80%");
    form.addComponent(f);

    return f;
}

From source file:org.hip.vif.admin.admin.ui.SendMailView.java

License:Open Source License

/** @param inGroups {@link GroupContainer}
 * @param inTask {@link SendMailTask} */
public SendMailView(final GroupContainer inGroups, final SendMailTask inTask) {
    final IMessages lMessages = Activator.getMessages();
    final VerticalLayout lLayout = initLayout(lMessages, "admin.send.mail.title.page"); //$NON-NLS-1$

    lLayout.addComponent(new Label(lMessages.getMessage("admin.send.remark"), ContentMode.HTML)); //$NON-NLS-1$
    lLayout.addComponent(RiplaViewHelper.createSpacer());

    final LabelValueTable lTable = new LabelValueTable();
    final ListSelect lGroups = new ListSelect();
    lGroups.setContainerDataSource(inGroups);
    lGroups.setRows(Math.min(SELECT_SIZE, inGroups.size()));
    lGroups.setStyleName(VIF_STYLE);//from ww w . j a  v a  2 s  .  co m
    lGroups.setMultiSelect(true);
    lGroups.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    lGroups.setItemCaptionPropertyId(GroupContainer.PROPERTY_CAPTION);
    lGroups.focus();
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.select"), lGroups); //$NON-NLS-1$

    final TextField lSubject = new TextField();
    lSubject.setWidth(WIDTH, Unit.PIXELS);
    lSubject.setStyleName(VIF_STYLE);
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.subject"), lSubject); //$NON-NLS-1$

    final RichTextArea lBody = new RichTextArea();
    lBody.setStyleName("vif-editor " + VIF_STYLE); //$NON-NLS-1$
    lBody.setWidth(WIDTH, Unit.PIXELS);
    lTable.addRowEmphasized(lMessages.getMessage("admin.send.mail.label.body"), lBody); //$NON-NLS-1$
    lLayout.addComponent(lTable);

    send = new Button(lMessages.getMessage("admin.send.mail.button.send")); //$NON-NLS-1$
    // send.setClickShortcut(KeyCode.ENTER);
    send.addClickListener(new Button.ClickListener() {
        @Override
        @SuppressWarnings("unchecked")
        public void buttonClick(final ClickEvent inEvent) {
            if (!isValid(lGroups, lSubject, lBody)) {
                Notification.show(lMessages.getMessage("admin.send.mail.msg.not.valid"), //$NON-NLS-1$
                        Type.WARNING_MESSAGE);
                return;
            }
            if (!inTask.processGroups((Collection<GroupWrapper>) lGroups.getValue(),
                    lSubject.getValue().toString(), lBody.getValue())) {
                Notification.show(lMessages.getMessage("admin.send.mail.msg.errmsg"), Type.WARNING_MESSAGE); //$NON-NLS-1$
            }
        }
    });
    lLayout.addComponent(send);
}

From source file:org.hip.vif.admin.groupadmin.ui.CompletionView.java

License:Open Source License

private RichTextArea createEditField(final String inContent, final int inHeight) {
    final RichTextArea outEditor = new RichTextArea();
    outEditor.setWidth("70%"); //$NON-NLS-1$
    outEditor.setHeight(inHeight, Unit.PIXELS);
    outEditor.setValue(inContent);//www  .j a v  a  2  s .c  om
    outEditor.setStyleName("vif-editor"); //$NON-NLS-1$
    return outEditor;
}

From source file:org.hip.vif.web.util.VIFViewHelper.java

License:Open Source License

/** Helper method to create a text field.
 *
 * @param inContent String the field's content
 * @param inWidth int the field width (in pixels)
 * @param inHeight int the field width (in pixels)
 * @param inValidator {@link Validator} the field's validator or <code>null</code>, if no validation is applied
 * @return {@link RichTextArea} */
public static RichTextArea createTextArea(final String inContent, final int inWidth, final int inHeight,
        final Validator inValidator) {
    final RichTextArea out = new RichTextArea();
    out.setValue(inContent);/*from w ww .  java2  s  .co  m*/
    if (inValidator != null) {
        out.addValidator(inValidator);
    }
    out.setWidth(inWidth, Unit.PIXELS);
    out.setHeight(inHeight, Unit.PIXELS);
    out.setStyleName("vif-editor"); //$NON-NLS-1$
    return out;
}