本文整理汇总了Java中com.ibm.icu.text.Bidi.DIRECTION_LEFT_TO_RIGHT属性的典型用法代码示例。如果您正苦于以下问题:Java Bidi.DIRECTION_LEFT_TO_RIGHT属性的具体用法?Java Bidi.DIRECTION_LEFT_TO_RIGHT怎么用?Java Bidi.DIRECTION_LEFT_TO_RIGHT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ibm.icu.text.Bidi
的用法示例。
在下文中一共展示了Bidi.DIRECTION_LEFT_TO_RIGHT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: directionFromFlags
private byte directionFromFlags() {
/* if the text contains AN and neutrals, then some neutrals may become RTL */
if (!((flags & MASK_RTL) != 0 ||
((flags & DirPropFlag(AN)) != 0 &&
(flags & MASK_POSSIBLE_N) != 0))) {
return Bidi.DIRECTION_LEFT_TO_RIGHT;
} else if ((flags & MASK_LTR) == 0) {
return Bidi.DIRECTION_RIGHT_TO_LEFT;
} else {
return MIXED;
}
}
示例2: createControl
@Override
protected void createControl(Composite parent, int styles) {
// Use LEFT_TO_RIGHT unless otherwise specified.
if ((styles & SWT.RIGHT_TO_LEFT) == 0 && (styles & SWT.LEFT_TO_RIGHT) == 0)
styles |= SWT.LEFT_TO_RIGHT;
final int baseLevel= (styles & SWT.RIGHT_TO_LEFT) != 0 ? Bidi.DIRECTION_RIGHT_TO_LEFT : Bidi.DIRECTION_LEFT_TO_RIGHT;
super.createControl(parent, styles);
fBackspaceManager= new SmartBackspaceManager();
fBackspaceManager.install(this);
StyledText text= getTextWidget();
text.addBidiSegmentListener(new BidiSegmentListener() {
public void lineGetSegments(BidiSegmentEvent event) {
if (redraws()) {
try {
event.segments= getBidiLineSegments(getDocument(), baseLevel, widgetOffset2ModelOffset(event.lineOffset), event.lineText);
} catch (BadLocationException e) {
// don't touch the segments
}
}
}
});
}
示例3: Chunk
public Chunk(String text)
{
this( text, 0, Bidi.DIRECTION_LEFT_TO_RIGHT, Bidi.DIRECTION_LEFT_TO_RIGHT, null );
}
示例4: ChunkGenerator
public ChunkGenerator( FontMappingManager fontManager,
ITextContent textContent, boolean bidiProcessing,
boolean fontSubstitution )
{
this.fontManager = fontManager;
this.textContent = textContent;
this.text = textContent.getText();
this.bidiProcessing = bidiProcessing;
this.fontSubstitution = fontSubstitution;
if ( text == null || text.length( ) == 0 )
return;
if ( bidiProcessing )
{
//FIXME implement the getDirection() method in ComputedStyle.
if ( CSSConstants.CSS_RTL_VALUE.equals( textContent
.getComputedStyle( ).getDirection( ) ) )
{
bidiSplitter = new BidiSplitter( new Chunk( text, 0,
Bidi.DIRECTION_RIGHT_TO_LEFT,
Bidi.DIRECTION_RIGHT_TO_LEFT ) );
}
else
{
bidiSplitter = new BidiSplitter( new Chunk( text, 0,
Bidi.DIRECTION_LEFT_TO_RIGHT,
Bidi.DIRECTION_LEFT_TO_RIGHT ) );
}
}
if ( null == bidiSplitter )
{
fontSplitter = new FontSplitter( fontManager, new Chunk( text ),
textContent, fontSubstitution );
}
else
{
if ( bidiSplitter.hasMore( ) )
{
fontSplitter = new FontSplitter( fontManager, bidiSplitter
.getNext( ), textContent, fontSubstitution );
}
}
}
示例5: isLeftToRight
/**
* Return true if the line is all left-to-right text and the base direction
* is left-to-right.
*
* @return true if the line is all left-to-right text and the base direction
* is left-to-right.
*
* @throws IllegalStateException if this call is not preceded by a successful
* call to <code>setPara</code>
* @stable ICU 3.8
*/
public boolean isLeftToRight()
{
return (getDirection() == Bidi.DIRECTION_LEFT_TO_RIGHT && (paraLevel & 1) == 0);
}
示例6: baseIsLeftToRight
/**
* Return true if the base direction is left-to-right
*
* @return true if the base direction is left-to-right
*
* @throws IllegalStateException if this call is not preceded by a successful
* call to <code>setPara</code> or <code>setLine</code>
*
* @stable ICU 3.8
*/
public boolean baseIsLeftToRight()
{
return (getParaLevel() == Bidi.DIRECTION_LEFT_TO_RIGHT);
}