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


Java RTText类代码示例

本文整理汇总了Java中com.onegravity.rteditor.api.format.RTText的典型用法代码示例。如果您正苦于以下问题:Java RTText类的具体用法?Java RTText怎么用?Java RTText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RTText类属于com.onegravity.rteditor.api.format包,在下文中一共展示了RTText类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setRichTextEditing

import com.onegravity.rteditor.api.format.RTText; //导入依赖的package包/类
/**
 * Sets the edit mode to plain or rich text and updates the content at the
 * same time. The caller needs to make sure the content matches the correct
 * format (if you pass in html code as plain text the editor will show the
 * html code).
 *
 * @param useRTFormatting True if the edit mode should be rich text, False if the edit
 *                        mode should be plain text
 * @param content         The new content
 */
public void setRichTextEditing(boolean useRTFormatting, String content) {
    assertRegistration();

    if (useRTFormatting != mUseRTFormatting) {
        mUseRTFormatting = useRTFormatting;

        if (mListener != null) {
            mListener.onRichTextEditingChanged(this, mUseRTFormatting);
        }
    }

    RTText rtText = useRTFormatting ?
            new RTHtml<>(RTFormat.HTML, content) :
            new RTPlainText(content);

    setText(rtText);
}
 
开发者ID:Ronak-LM,项目名称:memoir,代码行数:28,代码来源:RTEditText.java

示例2: setRichTextEditing

import com.onegravity.rteditor.api.format.RTText; //导入依赖的package包/类
/**
 * Sets the edit mode to plain or rich text and updates the content at the
 * same time. The caller needs to make sure the content matches the correct
 * format (if you pass in html code as plain text the editor will show the
 * html code).
 *
 * @param useRTFormatting True if the edit mode should be rich text, False if the edit
 *                        mode should be plain text
 * @param content         The new content
 */
public void setRichTextEditing(boolean useRTFormatting, String content) {
    assertRegistration();

    if (useRTFormatting != mUseRTFormatting) {
        mUseRTFormatting = useRTFormatting;

        if (mListener != null) {
            mListener.onRichTextEditingChanged(this, mUseRTFormatting);
        }
    }

    RTText rtText = useRTFormatting ?
            new RTHtml<RTImage, RTAudio, RTVideo>(RTFormat.HTML, content) :
            new RTPlainText(content);

    setText(rtText);
}
 
开发者ID:Ronak-LM,项目名称:memoir,代码行数:28,代码来源:RTEditText.java

示例3: getRichText

import com.onegravity.rteditor.api.format.RTText; //导入依赖的package包/类
/**
 * Same as "String getText(RTFormat format)" but this method returns the
 * RTText instead of just the actual text.
 */
public RTText getRichText(RTFormat format) {
    assertRegistration();

    RTEditable rtEditable = new RTEditable(this);
    return rtEditable.convertTo(format, mMediaFactory);
}
 
开发者ID:Ronak-LM,项目名称:memoir,代码行数:11,代码来源:RTEditText.java


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