Class AbstractTextStyleChooser

  • All Implemented Interfaces:
    JTextComponentOperator.TextChooser
    Direct Known Subclasses:
    TextStyleChooser

    public abstract class AbstractTextStyleChooser
    extends java.lang.Object
    implements JTextComponentOperator.TextChooser
    Makes easier to implement searching criteria for javax.swing.text.StyledDocument JTextComponentOperator.getPositionByText(String, JTextComponentOperator.TextChooser, int).
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean checkElement​(javax.swing.text.StyledDocument doc, javax.swing.text.Element element, int offset)
      Should return true if position fulfils criteria.
      boolean checkPosition​(javax.swing.text.Document document, int offset)
      Checkes if position fits the criteria.
      abstract java.lang.String getDescription()
      Returns a printable description of the criteria.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractTextStyleChooser

        public AbstractTextStyleChooser()
        Constructor.
    • Method Detail

      • checkElement

        public abstract boolean checkElement​(javax.swing.text.StyledDocument doc,
                                             javax.swing.text.Element element,
                                             int offset)
        Should return true if position fulfils criteria.
        Parameters:
        doc - a styled document to be searched.
        element - an element to be checked.
        offset - checked position.
        Returns:
        true if position fits the criteria.
      • checkPosition

        public final boolean checkPosition​(javax.swing.text.Document document,
                                           int offset)
        Description copied from interface: JTextComponentOperator.TextChooser
        Checkes if position fits the criteria.
        Specified by:
        checkPosition in interface JTextComponentOperator.TextChooser
        Parameters:
        document - a document to be checked.
        offset - a checked position
        Returns:
        true if the position fits the criteria.