当前位置: 首页>>代码示例>>Java>>正文


Java RichTextArea.addClickListener方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.RichTextArea.addClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java RichTextArea.addClickListener方法的具体用法?Java RichTextArea.addClickListener怎么用?Java RichTextArea.addClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.RichTextArea的用法示例。


在下文中一共展示了RichTextArea.addClickListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RichTextToolbar

import com.google.gwt.user.client.ui.RichTextArea; //导入方法依赖的package包/类
/**
 * 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);
  }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:67,代码来源:RichTextToolbar.java

示例2: RichTextToolbar

import com.google.gwt.user.client.ui.RichTextArea; //导入方法依赖的package包/类
/**
     * 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);
        }
    }
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:58,代码来源:RichTextToolbar.java


注:本文中的com.google.gwt.user.client.ui.RichTextArea.addClickListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。