Class CTextArea

    • Constructor Detail

      • CTextArea

        public CTextArea()
        Constructs a new TextArea. A default model is set, the initial string is null, and rows/columns are set to 0.
      • CTextArea

        public CTextArea​(String text)
        Constructs a new TextArea with the specified text displayed. A default model is created and rows/columns are set to 0.
        Parameters:
        text - the text to be displayed, or null
      • CTextArea

        public CTextArea​(int rows,
                         int columns)
        Constructs a new empty TextArea with the specified number of rows and columns. A default model is created, and the initial string is null.
        Parameters:
        rows - the number of rows >= 0
        columns - the number of columns >= 0
        Throws:
        IllegalArgumentException - if the rows or columns arguments are negative.
      • CTextArea

        public CTextArea​(String text,
                         int rows,
                         int columns)
        Constructs a new TextArea with the specified text and number of rows and columns. A default model is created.
        Parameters:
        text - the text to be displayed, or null
        rows - the number of rows >= 0
        columns - the number of columns >= 0
        Throws:
        IllegalArgumentException - if the rows or columns arguments are negative.
      • CTextArea

        public CTextArea​(Document doc)
        Constructs a new JTextArea with the given document model, and defaults for all of the other arguments (null, 0, 0).
        Parameters:
        doc - the model to use
      • CTextArea

        public CTextArea​(Document doc,
                         String text,
                         int rows,
                         int columns)
        Constructs a new JTextArea with the specified number of rows and columns, and the given model. All of the constructors feed through this constructor.
        Parameters:
        doc - the model to use, or create a default one if null
        text - the text to be displayed, null if none
        rows - the number of rows >= 0
        columns - the number of columns >= 0
        Throws:
        IllegalArgumentException - if the rows or columns arguments are negative.
      • CTextArea

        public CTextArea​(JTextArea textArea)
        Create a JScrollArea with a JTextArea. (use Cpmpiere Colors, Line wrap)
        Parameters:
        textArea -
    • Method Detail

      • setMandatory

        public void setMandatory​(boolean mandatory)
        Set Editor Mandatory
        Specified by:
        setMandatory in interface CEditor
        Parameters:
        mandatory - true, if you have to enter data
      • isMandatory

        public boolean isMandatory()
        Is Field mandatory
        Specified by:
        isMandatory in interface CEditor
        Returns:
        true, if mandatory
      • setReadWrite

        public void setReadWrite​(boolean rw)
        Enable Editor
        Specified by:
        setReadWrite in interface CEditor
        Parameters:
        rw - true, if you can enter/select data
      • isReadWrite

        public boolean isReadWrite()
        Is it possible to edit
        Specified by:
        isReadWrite in interface CEditor
        Returns:
        true, if editable
      • setBackground

        public void setBackground​(boolean error)
        Set Background based on editable / mandatory / error
        Specified by:
        setBackground in interface CEditor
        Parameters:
        error - if true, set background to error color, otherwise mandatory/editable
      • setBackground

        public void setBackground​(Color color)
        Set Background color
        Overrides:
        setBackground in class JComponent
        Parameters:
        color - color
      • setForeground

        public void setForeground​(Color color)
        Set Foreground color
        Overrides:
        setForeground in class JComponent
        Parameters:
        color -
      • setValue

        public void setValue​(Object value)
        Set Editor to value
        Specified by:
        setValue in interface CEditor
        Parameters:
        value - value of the editor
      • getValue

        public Object getValue()
        Return Editor value
        Specified by:
        getValue in interface CEditor
        Returns:
        current value
      • getDisplay

        public String getDisplay()
        Return Display Value
        Specified by:
        getDisplay in interface CEditor
        Returns:
        displayed String value
      • setText

        public void setText​(String text)
        Set Text and position top
        Parameters:
        text -
      • getText

        public String getText()
        Get Text
        Returns:
        text
      • append

        public void append​(String text)
        Append text
        Parameters:
        text -
      • setColumns

        public void setColumns​(int cols)
        Set Columns
        Parameters:
        cols -
      • getColumns

        public int getColumns()
        Get Columns
        Returns:
        columns
      • setRows

        public void setRows​(int rows)
        Set Rows
        Parameters:
        rows -
      • getRows

        public int getRows()
        Get Rows
        Returns:
        rows
      • setCaretPosition

        public void setCaretPosition​(int pos)
        Set Text Caret Position
        Parameters:
        pos -
      • getCaretPosition

        public int getCaretPosition()
        Get Text Caret Position
        Returns:
        position
      • setEditable

        public void setEditable​(boolean edit)
        Set Text Editable
        Parameters:
        edit -
      • isEditable

        public boolean isEditable()
        Is Text Editable
        Returns:
        true if editable
      • setLineWrap

        public void setLineWrap​(boolean wrap)
        Set Text Line Wrap
        Parameters:
        wrap -
      • setWrapStyleWord

        public void setWrapStyleWord​(boolean word)
        Set Text Wrap Style Word
        Parameters:
        word -
      • setOpaque

        public void setOpaque​(boolean isOpaque)
        Set Opaque
        Overrides:
        setOpaque in class JComponent
        Parameters:
        isOpaque -
      • setMargin

        public void setMargin​(Insets m)
        Set Text Margin
        Parameters:
        m - insets