org.odftoolkit.simple.common.navigation
Class TextStyleNavigation

java.lang.Object
  extended by org.odftoolkit.simple.common.navigation.Navigation
      extended by org.odftoolkit.simple.common.navigation.TextStyleNavigation

public class TextStyleNavigation
extends Navigation

A derived Navigation class used to navigate the text content, which can search the document and find matched style properties and return TextSelection instance(s).


Constructor Summary
TextStyleNavigation(Map<OdfStyleProperty,String> props, TextDocument doc)
          Construct TextStyleNavigation with style properties condition and navigation scope.
 
Method Summary
 boolean hasNext()
          Check if has next TextSelection with satisfied style.
 boolean match(Node element)
          Check if the element has specified style properties, which are stated when the TextStyleNavigation created.
 Selection nextSelection()
          Get next TextSelection.
 
Methods inherited from class org.odftoolkit.simple.common.navigation.Navigation
getNextMatchElement, getNextMatchElementInTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextStyleNavigation

public TextStyleNavigation(Map<OdfStyleProperty,String> props,
                           TextDocument doc)
Construct TextStyleNavigation with style properties condition and navigation scope.

Parameters:
props - the matched style properties conditions
doc - the navigation search scope
Method Detail

hasNext

public boolean hasNext()
Check if has next TextSelection with satisfied style.

Specified by:
hasNext in class Navigation
Returns:
true if document still has more matched Selection, and vice versa
See Also:
Navigation.hasNext()

nextSelection

public Selection nextSelection()
Get next TextSelection.

Specified by:
nextSelection in class Navigation
Returns:
the next Selection result
See Also:
Navigation.nextSelection()

match

public boolean match(Node element)
Check if the element has specified style properties, which are stated when the TextStyleNavigation created.

Specified by:
match in class Navigation
Parameters:
element - navigate this element
Returns:
true if this element has the specified style properties false if not match


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.