javax.swing.text

Class PlainDocument

  • All Implemented Interfaces:
    Serializable, Document

    public class PlainDocument
    extends AbstractDocument
    A plain document that maintains no character attributes. The default element structure for this document is a map of the lines in the text. The Element returned by getDefaultRootElement is a map of the lines, and each child element represents a line. This model does not maintain any character level attributes, but each line can be tagged with an arbitrary set of attributes. Line to offset, and offset to line translations can be quickly performed using the default root element. The structure information of the DocumentEvent's fired by edits will indicate the line structure changes.

    The default content storage management is performed by a gapped buffer implementation (GapContent). It supports editing reasonably large documents with good efficiency when the edits are contiguous or clustered, as is typical.

    Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

    See Also:
    Document, AbstractDocument
    • Field Detail

      • tabSizeAttribute

        public static final String tabSizeAttribute
        Name of the attribute that specifies the tab size for tabs contained in the content. The type for the value is Integer.
        See Also:
        Constant Field Values
      • lineLimitAttribute

        public static final String lineLimitAttribute
        Name of the attribute that specifies the maximum length of a line, if there is a maximum length. The type for the value is Integer.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PlainDocument

        public PlainDocument()
        Constructs a plain text document. A default model using GapContent is constructed and set.
      • PlainDocument

        public PlainDocument(AbstractDocument.Content c)
        Constructs a plain text document. A default root element is created, and the tab size set to 8.
        Parameters:
        c - the container for the content

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/text/PlainDocument.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, PlainDocument

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut