def __init__(self, **kwargs):
     if not kwargs.has_key('StyleName'):
         kwargs['StyleName'] = "gwt-RichTextArea"
     self.impl = RichTextAreaImplStandard()
     FocusWidget.__init__(self, self.impl.getElement(), **kwargs)
Example #2
0
 def __init__(self, **kwargs):
     if not kwargs.has_key("StyleName"):
         kwargs["StyleName"] = "gwt-RichTextArea"
     self.impl = RichTextAreaImplStandard()
     FocusWidget.__init__(self, self.impl.getElement(), **kwargs)
class RichTextArea(FocusWidget):
    """*
    * Creates a new, blank {@link RichTextArea} object with no stylesheet.
    """
    def __init__(self, **kwargs):
        if not kwargs.has_key('StyleName'):
            kwargs['StyleName'] = "gwt-RichTextArea"
        self.impl = RichTextAreaImplStandard()
        FocusWidget.__init__(self, self.impl.getElement(), **kwargs)

    """*
    * Gets the basic rich text formatting interface.
    *
    * @return <code>None</code> if basic formatting is not supported
    """

    def getBasicFormatter(self):
        if self.impl.isBasicEditingSupported():
            return self.impl

        return None

    """*
    * Gets the full rich text formatting interface.
    *
    * @return <code>None</code> if full formatting is not supported
    """

    def getExtendedFormatter(self):
        if self.impl.isExtendedEditingSupported():
            return self.impl

        return None

    def getHTML(self):
        return self.impl.getHTML()

    def getText(self):
        return self.impl.getText()

    def setFocus(self, focused):
        # There are different problems on each browser when you try to focus an
        # unattached rich text iframe, so just cut it off early.
        if self.isAttached():
            self.impl.setFocus(focused)

    def setHTML(self, html):
        self.impl.setHTML(html)

    def setText(self, text):
        self.impl.setText(text)

    def onAttach(self):
        FocusWidget.onAttach(self)
        self.impl.initElement()

    def onDetach(self):
        FocusWidget.onDetach(self)
        self.impl.uninitElement()
Example #4
0
class RichTextArea(FocusWidget):

    """*
    * Creates a new, blank {@link RichTextArea} object with no stylesheet.
    """

    def __init__(self, **kwargs):
        if not kwargs.has_key("StyleName"):
            kwargs["StyleName"] = "gwt-RichTextArea"
        self.impl = RichTextAreaImplStandard()
        FocusWidget.__init__(self, self.impl.getElement(), **kwargs)

    """*
    * Gets the basic rich text formatting interface.
    *
    * @return <code>None</code> if basic formatting is not supported
    """

    def getBasicFormatter(self):
        if self.impl.isBasicEditingSupported():
            return self.impl

        return None

    """*
    * Gets the full rich text formatting interface.
    *
    * @return <code>None</code> if full formatting is not supported
    """

    def getExtendedFormatter(self):
        if self.impl.isExtendedEditingSupported():
            return self.impl

        return None

    def getHTML(self):
        return self.impl.getHTML()

    def getText(self):
        return self.impl.getText()

    def setFocus(self, focused):
        # There are different problems on each browser when you try to focus an
        # unattached rich text iframe, so just cut it off early.
        if self.isAttached():
            self.impl.setFocus(focused)

    def setHTML(self, html):
        self.impl.setHTML(html)

    def setText(self, text):
        self.impl.setText(text)

    def onAttach(self):
        FocusWidget.onAttach(self)
        self.impl.initElement()

    def onDetach(self):
        FocusWidget.onDetach(self)
        self.impl.uninitElement()