com.atlassian.confluence.pageobjects.component.editor
Class EditorContent

java.lang.Object
  extended by com.atlassian.confluence.pageobjects.component.ConfluenceAbstractPageComponent
      extended by com.atlassian.confluence.pageobjects.component.editor.EditorContent
All Implemented Interfaces:
PageComponent

public class EditorContent
extends ConfluenceAbstractPageComponent


Field Summary
 
Fields inherited from class com.atlassian.confluence.pageobjects.component.ConfluenceAbstractPageComponent
driver, pageBinder, waiter
 
Constructor Summary
EditorContent()
           
 
Method Summary
 void clear()
           
 void focusOnTinyMce()
           
 String getCurrentSelectionText()
          Returns the text of the current editor selection.
 String getHtml()
          Returns the current content of the Editor as HTML.
 RenderedContent getRenderedContent()
          Returns a RenderedContent object which lets you easily access elements in the editor iframe without having to manually switch frames.
 void leaveFocus()
           
 void placeCursor(String selector, int position)
          Positions the cursor at the specified position in the first matched element for the provided CSS selector.
 void placeCursorAtStart(String selector)
          Positions the cursor at the start of the first matched element for the provided CSS selector.
 void putCursorAtStartOfElementWithSelectorAndIndex(String selector, int elementIndex)
          Place the cursor at the start of the element matching the given selector and index.
 void putCursorAtStartOfFirstElementWithSelector(String selector)
          Place the cursor at the start of the first element matching the given selector.
 void selectElementWithSelectorAndIndex(String selector, int elementIndex)
           
 void selectFirstElementWithSelector(String selector)
          Select the first element matching the given selector.
 void selectFirstParagraph()
           
 void setContent(String content)
           
 void type(String content)
          Type content in the editor.
 void typeInColumn(int column, String content)
          Type content in the given column index.
 void typeInFooter(String content)
          Type content in the footer of a page layout.
 void typeInHeader(String content)
          Type content in the header of a page layout.
 
Methods inherited from class com.atlassian.confluence.pageobjects.component.ConfluenceAbstractPageComponent
getComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorContent

public EditorContent()
Method Detail

focusOnTinyMce

public void focusOnTinyMce()

leaveFocus

public void leaveFocus()

getRenderedContent

public RenderedContent getRenderedContent()
Returns a RenderedContent object which lets you easily access elements in the editor iframe without having to manually switch frames.


setContent

public void setContent(String content)

clear

public void clear()

type

public void type(String content)
Type content in the editor. It assumes that no page layout has been applied.


typeInColumn

public void typeInColumn(int column,
                         String content)
Type content in the given column index. It assumes that a column page layout has been applied. Note the column index is 1-based.


typeInHeader

public void typeInHeader(String content)
Type content in the header of a page layout. It assumes a complex page layout has been applied.


typeInFooter

public void typeInFooter(String content)
Type content in the footer of a page layout. It assumes a complex page layout has been applied.


getHtml

public String getHtml()
Returns the current content of the Editor as HTML.


selectFirstParagraph

public void selectFirstParagraph()

selectFirstElementWithSelector

public void selectFirstElementWithSelector(String selector)
Select the first element matching the given selector.


selectElementWithSelectorAndIndex

public void selectElementWithSelectorAndIndex(String selector,
                                              int elementIndex)

placeCursorAtStart

public void placeCursorAtStart(String selector)
Positions the cursor at the start of the first matched element for the provided CSS selector.


placeCursor

public void placeCursor(String selector,
                        int position)
Positions the cursor at the specified position in the first matched element for the provided CSS selector. Doesn't work for IE very well.


putCursorAtStartOfElementWithSelectorAndIndex

public void putCursorAtStartOfElementWithSelectorAndIndex(String selector,
                                                          int elementIndex)
Place the cursor at the start of the element matching the given selector and index. Seems to work in Firefox & IE, although the moxiecode docs indicate that the 'true' second parameter doesn't do anything in IE. If this method turns out to be consistent we could refactor putCursorAtStartOfFirstElementWithSelector(String) into it.

Parameters:
selector - see tiny_mce_src.DOMUtils.select
elementIndex - index of matched element to select, 0-indexed

putCursorAtStartOfFirstElementWithSelector

public void putCursorAtStartOfFirstElementWithSelector(String selector)
Place the cursor at the start of the first element matching the given selector.

Parameters:
selector - see tiny_mce_src.DOMUtils.select

getCurrentSelectionText

public String getCurrentSelectionText()
Returns the text of the current editor selection.



Copyright © 2003-2012 Atlassian. All Rights Reserved.