javax.swing.text

Interface Highlighter

    • Method Detail

      • install

        void install(JTextComponent c)
        Called when the UI is being installed into the interface of a JTextComponent. This can be used to gain access to the model that is being navigated by the implementation of this interface.
        Parameters:
        c - the JTextComponent editor
      • deinstall

        void deinstall(JTextComponent c)
        Called when the UI is being removed from the interface of a JTextComponent. This is used to unregister any listeners that were attached.
        Parameters:
        c - the JTextComponent editor
      • paint

        void paint(Graphics g)
        Renders the highlights.
        Parameters:
        g - the graphics context.
      • addHighlight

        Object addHighlight(int p0,
                          int p1,
                          Highlighter.HighlightPainter p)
                            throws BadLocationException
        Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
        Parameters:
        p0 - the beginning of the range >= 0
        p1 - the end of the range >= p0
        p - the painter to use for the actual highlighting
        Returns:
        an object that refers to the highlight
        Throws:
        BadLocationException - for an invalid range specification
      • removeHighlight

        void removeHighlight(Object tag)
        Removes a highlight from the view.
        Parameters:
        tag - which highlight to remove
      • removeAllHighlights

        void removeAllHighlights()
        Removes all highlights this highlighter is responsible for.
      • changeHighlight

        void changeHighlight(Object tag,
                           int p0,
                           int p1)
                             throws BadLocationException
        Changes the given highlight to span a different portion of the document. This may be more efficient than a remove/add when a selection is expanding/shrinking (such as a sweep with a mouse) by damaging only what changed.
        Parameters:
        tag - which highlight to change
        p0 - the beginning of the range >= 0
        p1 - the end of the range >= p0
        Throws:
        BadLocationException - for an invalid range specification
      • getHighlights

        Highlighter.Highlight[] getHighlights()
        Fetches the current list of highlights.
        Returns:
        the highlight list

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 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/text/Highlighter.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, Highlighter

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