Package org.netbeans.jemmy.util
Class TextStyleChooser
- java.lang.Object
-
- org.netbeans.jemmy.util.AbstractTextStyleChooser
-
- org.netbeans.jemmy.util.TextStyleChooser
-
- All Implemented Interfaces:
JTextComponentOperator.TextChooser
public class TextStyleChooser extends AbstractTextStyleChooser
Defines searching criteria forjavax.swing.text.StyledDocumentJTextComponentOperator.getPositionByText(String, JTextComponentOperator.TextChooser, int).- Author:
- Alexandre Iline (alexandre.iline@sun.com)
-
-
Constructor Summary
Constructors Constructor Description TextStyleChooser()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckElement(javax.swing.text.StyledDocument doc, javax.swing.text.Element element, int offset)Should return true if position fulfils criteria.java.lang.StringgetDescription()Returns a printable description of the criteria.voidsetAlignment(int alignment)Adds alignment checking to the criteria.voidsetBackground(java.awt.Color background)Adds backgroung color checking to the criteria.voidsetBold(boolean bold)Adds boldness checking to the criteria.voidsetFontFamily(java.lang.String fontFamily)Adds font family checking to the criteria.voidsetFontSize(int fontSize)Adds font size checking to the criteria.voidsetForeground(java.awt.Color foreground)Adds foregroung color checking to the criteria.voidsetItalic(boolean italic)Adds italic style checking to the criteria.voidsetStrike(boolean strike)Adds strikeness checking to the criteria.voidsetUnderstrike(boolean understrike)Adds understrikeness checking to the criteria.voidunsetAlignment()Removes alignment checking from the criteria.voidunsetBackground()Removes backgroung color checking from the criteria.voidunsetBold()Removes boldness checking from the criteria.voidunsetFontFamily()Removes font family checking from the criteria.voidunsetFontSize()Removes font size checking from the criteria.voidunsetForeground()Removes foregroung color checking from the criteria.voidunsetItalic()Removes italic style checking from the criteria.voidunsetStrike()Removes strikeness checking from the criteria.voidunsetUnderstrike()Removes understrikeness checking from the criteria.-
Methods inherited from class org.netbeans.jemmy.util.AbstractTextStyleChooser
checkPosition
-
-
-
-
Method Detail
-
setBold
public void setBold(boolean bold)
Adds boldness checking to the criteria.- Parameters:
bold- Specifies if font needs to be bold.
-
unsetBold
public void unsetBold()
Removes boldness checking from the criteria.
-
setItalic
public void setItalic(boolean italic)
Adds italic style checking to the criteria.- Parameters:
italic- Specifies if font needs to be italic.
-
unsetItalic
public void unsetItalic()
Removes italic style checking from the criteria.
-
setStrike
public void setStrike(boolean strike)
Adds strikeness checking to the criteria.- Parameters:
strike- Specifies if font needs to be striked.
-
unsetStrike
public void unsetStrike()
Removes strikeness checking from the criteria.
-
setUnderstrike
public void setUnderstrike(boolean understrike)
Adds understrikeness checking to the criteria.- Parameters:
understrike- Specifies if font needs to be understriked.
-
unsetUnderstrike
public void unsetUnderstrike()
Removes understrikeness checking from the criteria.
-
setFontSize
public void setFontSize(int fontSize)
Adds font size checking to the criteria.- Parameters:
fontSize- Specifies a font size.
-
unsetFontSize
public void unsetFontSize()
Removes font size checking from the criteria.
-
setAlignment
public void setAlignment(int alignment)
Adds alignment checking to the criteria.- Parameters:
alignment- Specifies a text alignment.
-
unsetAlignment
public void unsetAlignment()
Removes alignment checking from the criteria.
-
setFontFamily
public void setFontFamily(java.lang.String fontFamily)
Adds font family checking to the criteria.- Parameters:
fontFamily- Specifies a font family.
-
unsetFontFamily
public void unsetFontFamily()
Removes font family checking from the criteria.
-
setBackground
public void setBackground(java.awt.Color background)
Adds backgroung color checking to the criteria.- Parameters:
background- Specifies a background color.
-
unsetBackground
public void unsetBackground()
Removes backgroung color checking from the criteria.
-
setForeground
public void setForeground(java.awt.Color foreground)
Adds foregroung color checking to the criteria.- Parameters:
foreground- Specifies a foreground color.
-
unsetForeground
public void unsetForeground()
Removes foregroung color checking from the criteria.
-
checkElement
public boolean checkElement(javax.swing.text.StyledDocument doc, javax.swing.text.Element element, int offset)Description copied from class:AbstractTextStyleChooserShould return true if position fulfils criteria.- Specified by:
checkElementin classAbstractTextStyleChooser- Parameters:
doc- a styled document to be searched.element- an element to be checked.offset- checked position.- Returns:
- true if position fits the criteria.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:JTextComponentOperator.TextChooserReturns a printable description of the criteria.- Specified by:
getDescriptionin interfaceJTextComponentOperator.TextChooser- Specified by:
getDescriptionin classAbstractTextStyleChooser- Returns:
- a description of this chooser.
-
-