Beispiel #1
0
    def _completeToken(self, token):
        """ Adds a token to be completed """
        style = SimpleAttributeSet()

        style.addAttribute(StyleConstants.Foreground, self.infoColor)

        self.doc.insertString(self.output.caretPosition, token, style)
Beispiel #2
0
    def write(self, data, color=Color.black, prefix='\n'):
        style = SimpleAttributeSet()

        if color is not None:
            style.addAttribute(StyleConstants.Foreground, color)

        self.document.insertString(self.document.getLength(), prefix + data, style)
        self.textpane.caretPosition = self.document.getLength()
Beispiel #3
0
    def __addOutput(self, color, msg):
        """ Adds the output to the text area using a given color """
        style = SimpleAttributeSet()

        if color:
            style.addAttribute(StyleConstants.Foreground, color)

        self.doc.insertString(self.doc.length, msg, style)
        self.output.caretPosition = self.doc.length
Beispiel #4
0
    def __addOutput(self, color, msg):
        """ Adds the output to the text area using a given color """
        from javax.swing.text import BadLocationException
        style = SimpleAttributeSet()

        if color:
            style.addAttribute(StyleConstants.Foreground, color)

        self.doc.insertString(self.doc.length, msg, style)
        self.text_pane.caretPosition = self.doc.length
Beispiel #5
0
    def __addOutput(self, color, msg):
        """ Adds the output to the text area using a given color """
        from javax.swing.text import BadLocationException
        style = SimpleAttributeSet()

        if color:
            style.addAttribute(StyleConstants.Foreground, color)

        self.doc.insertString(self.doc.length, msg, style)
        self.text_pane.caretPosition = self.doc.length
Beispiel #6
0
 def addOutput(self, color, msg):
     style = SimpleAttributeSet()
     if color:
         style.addAttribute(StyleConstants.Foreground, color)
     try:
         self.target.insertString(self.target.length, msg, style)
     except BadLocationException:
         Log.log(Log.ERROR, self, "")
     if jEdit.getBooleanProperty("options.jython.cleanDirtyFlag"):
         self.target.dirty = 0