Class JEditorPaneOperator

  • All Implemented Interfaces:
    Outputable, Timeoutable
    Direct Known Subclasses:
    JTextPaneOperator

    public class JEditorPaneOperator
    extends JTextComponentOperator
    Class provides basic functions to operate with JEditorPane (selection, typing, deleting)

    Timeouts used:
    JTextComponentOperator.PushKeyTimeout - time between key pressing and releasing during text typing
    JTextComponentOperator.BetweenKeysTimeout - time to sleep between two chars typing
    JTextComponentOperator.ChangeCaretPositionTimeout - maximum time to change caret position
    JTextComponentOperator.TypeTextTimeout - maximum time to type text
    ComponentOperator.WaitComponentTimeout - time to wait component displayed
    ComponentOperator.WaitFocusTimeout - time to wait component focus
    JScrollBarOperator.OneScrollClickTimeout - time for one scroll click
    JScrollBarOperator.WholeScrollTimeout - time for the whole scrolling
    .
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    See Also:
    Timeouts
    • Field Detail

      • CONTENT_TYPE_DPROP

        public static final java.lang.String CONTENT_TYPE_DPROP
        Identifier for a "content type" property.
        See Also:
        getDump(), Constant Field Values
    • Constructor Detail

      • JEditorPaneOperator

        public JEditorPaneOperator​(javax.swing.JEditorPane b)
        Constructor.
        Parameters:
        b - a component
      • JEditorPaneOperator

        public JEditorPaneOperator​(ContainerOperator cont,
                                   ComponentChooser chooser,
                                   int index)
        Constructs a JEditorPaneOperator object.
        Parameters:
        cont - a container
        chooser - a component chooser specifying searching criteria.
        index - an index between appropriate ones.
      • JEditorPaneOperator

        public JEditorPaneOperator​(ContainerOperator cont,
                                   ComponentChooser chooser)
        Constructs a JEditorPaneOperator object.
        Parameters:
        cont - a container
        chooser - a component chooser specifying searching criteria.
      • JEditorPaneOperator

        public JEditorPaneOperator​(ContainerOperator cont,
                                   int index)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - a container
        index - Ordinal component index.
        Throws:
        TimeoutExpiredException
      • JEditorPaneOperator

        public JEditorPaneOperator​(ContainerOperator cont)
        Constructor. Waits component in container first. Uses cont's timeout and output for waiting and to init operator.
        Parameters:
        cont - a container
        Throws:
        TimeoutExpiredException
    • Method Detail

      • findJEditorPane

        public static javax.swing.JEditorPane findJEditorPane​(java.awt.Container cont,
                                                              ComponentChooser chooser,
                                                              int index)
        Searches JEditorPane in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        index - Ordinal component index.
        Returns:
        JEditorPane instance or null if component was not found.
      • findJEditorPane

        public static javax.swing.JEditorPane findJEditorPane​(java.awt.Container cont,
                                                              ComponentChooser chooser)
        Searches JEditorPane in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        Returns:
        JEditorPane instance or null if component was not found.
      • findJEditorPane

        public static javax.swing.JEditorPane findJEditorPane​(java.awt.Container cont,
                                                              java.lang.String text,
                                                              boolean ce,
                                                              boolean ccs,
                                                              int index)
        Searches JEditorPane by text.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        index - Ordinal component index.
        Returns:
        JEditorPane instance or null if component was not found.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • findJEditorPane

        public static javax.swing.JEditorPane findJEditorPane​(java.awt.Container cont,
                                                              java.lang.String text,
                                                              boolean ce,
                                                              boolean ccs)
        Searches JEditorPane by text.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        Returns:
        JEditorPane instance or null if component was not found.
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • waitJEditorPane

        public static javax.swing.JEditorPane waitJEditorPane​(java.awt.Container cont,
                                                              ComponentChooser chooser,
                                                              int index)
        Waits JEditorPane in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        index - Ordinal component index.
        Returns:
        JEditorPane instance.
        Throws:
        TimeoutExpiredException
      • waitJEditorPane

        public static javax.swing.JEditorPane waitJEditorPane​(java.awt.Container cont,
                                                              ComponentChooser chooser)
        Waits JEditorPane in container.
        Parameters:
        cont - Container to search component in.
        chooser - a component chooser specifying searching criteria.
        Returns:
        JEditorPane instance.
        Throws:
        TimeoutExpiredException
      • waitJEditorPane

        public static javax.swing.JEditorPane waitJEditorPane​(java.awt.Container cont,
                                                              java.lang.String text,
                                                              boolean ce,
                                                              boolean ccs,
                                                              int index)
        Waits JEditorPane by text.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        index - Ordinal component index.
        Returns:
        JEditorPane instance.
        Throws:
        TimeoutExpiredException
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • waitJEditorPane

        public static javax.swing.JEditorPane waitJEditorPane​(java.awt.Container cont,
                                                              java.lang.String text,
                                                              boolean ce,
                                                              boolean ccs)
        Waits JEditorPane by text.
        Parameters:
        cont - Container to search component in.
        text - Component text.
        ce - Compare text exactly.
        ccs - Compare text case sensitively.
        Returns:
        JEditorPane instance.
        Throws:
        TimeoutExpiredException
        See Also:
        Operator.isCaptionEqual(String, String, boolean, boolean)
      • usePageNavigationKeys

        public void usePageNavigationKeys​(boolean yesOrNo)
        Deprecated.
        vlue set by this method is not used anymore: all navigating is performed by TextDriver.
        Notifies whether "PageUp" and "PageDown" should be used to change caret position. If can be useful if text takes some pages.
        Parameters:
        yesOrNo - whether to use "PageUp" and "PageDown"
      • getDump

        public java.util.Hashtable getDump()
        Returns information about component.
        Overrides:
        getDump in class JTextComponentOperator
        Returns:
        a Hashtable containing name-value pairs.
      • addHyperlinkListener

        public void addHyperlinkListener​(javax.swing.event.HyperlinkListener hyperlinkListener)
        Maps JEditorPane.addHyperlinkListener(HyperlinkListener) through queue
      • fireHyperlinkUpdate

        public void fireHyperlinkUpdate​(javax.swing.event.HyperlinkEvent hyperlinkEvent)
        Maps JEditorPane.fireHyperlinkUpdate(HyperlinkEvent) through queue
      • getContentType

        public java.lang.String getContentType()
        Maps JEditorPane.getContentType() through queue
      • getEditorKit

        public javax.swing.text.EditorKit getEditorKit()
        Maps JEditorPane.getEditorKit() through queue
      • getEditorKitForContentType

        public javax.swing.text.EditorKit getEditorKitForContentType​(java.lang.String string)
        Maps JEditorPane.getEditorKitForContentType(String) through queue
      • getPage

        public java.net.URL getPage()
        Maps JEditorPane.getPage() through queue
      • read

        public void read​(java.io.InputStream inputStream,
                         java.lang.Object object)
        Maps JEditorPane.read(InputStream, Object) through queue
      • removeHyperlinkListener

        public void removeHyperlinkListener​(javax.swing.event.HyperlinkListener hyperlinkListener)
        Maps JEditorPane.removeHyperlinkListener(HyperlinkListener) through queue
      • setContentType

        public void setContentType​(java.lang.String string)
        Maps JEditorPane.setContentType(String) through queue
      • setEditorKit

        public void setEditorKit​(javax.swing.text.EditorKit editorKit)
        Maps JEditorPane.setEditorKit(EditorKit) through queue
      • setEditorKitForContentType

        public void setEditorKitForContentType​(java.lang.String string,
                                               javax.swing.text.EditorKit editorKit)
        Maps JEditorPane.setEditorKitForContentType(String, EditorKit) through queue
      • setPage

        public void setPage​(java.lang.String string)
        Maps JEditorPane.setPage(String) through queue
      • setPage

        public void setPage​(java.net.URL uRL)
        Maps JEditorPane.setPage(URL) through queue