]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/custom/BidiSegmentEvent.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / custom / BidiSegmentEvent.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2012 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.custom;
15
16
17 import org.eclipse.swt.events.*;
18
19 /**
20  * This event is sent to BidiSegmentListeners when a line is to
21  * be measured or rendered in a bidi locale.
22  * The segments field can be used in conjunction with the segmentsChars
23  * field or by itself. Setting only the segmentsChars field has no effect.
24  * When used by itself, the segments field specify text ranges in the line
25  * that should be treated as separate segments for bidi reordering.  Each
26  * segment will be reordered and rendered separately.
27  * <p>
28  * The elements in the segments field specify the start offset of
29  * a segment relative to the start of the line. They must follow
30  * the following rules:</p>
31  * <ul>
32  * <li>elements must be in ascending order and must not have duplicates
33  * <li>elements must not exceed the line length
34  * </ul>
35  * In addition, the first element may be set to zero and the last element may
36  * be set to the end of the line but this is not required.
37  * <p>
38  * The segments field may be left null if the entire line should
39  * be reordered as is.
40  * </p>
41  * A BidiSegmentListener may be used when adjacent segments of
42  * right-to-left text should not be reordered relative to each other.
43  * For example, within a Java editor, you may wish multiple
44  * right-to-left string literals to be reordered differently than the
45  * bidi algorithm specifies.
46  *
47  * Example:
48  * <pre>
49  *      stored line = "R1R2R3" + "R4R5R6"
50  *              R1 to R6 are right-to-left characters. The quotation marks
51  *              are part of the line text. The line is 13 characters long.
52  *
53  *      segments = null:
54  *              entire line will be reordered and thus the two R2L segments
55  *              swapped (as per the bidi algorithm).
56  *              visual line (rendered on screen) = "R6R5R4" + "R3R2R1"
57  *
58  *      segments = [0, 5, 8]
59  *              "R1R2R3" will be reordered, followed by [blank]+[blank] and
60  *              "R4R5R6".
61  *              visual line = "R3R2R1" + "R6R5R4"
62  * </pre>
63  *
64  * <p>
65  * The segments and segmentsChars fields can be used together to obtain different
66  * types of bidi reordering and text display. The application can use these two fields
67  * to insert Unicode Control Characters in specific offsets in the line, the character
68  * at segmentsChars[i] is inserted at the offset specified by segments[i]. When both fields
69  * are set, the rules for the segments field are less restrictive:
70  * </p>
71  * <ul>
72  * <li>elements must be in ascending order, duplicates are allowed
73  * <li>elements must not exceed the line length
74  * </ul>
75  *
76  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
77  */
78 public class BidiSegmentEvent extends SegmentEvent {
79
80         static final long serialVersionUID = -3712986188155944253L;
81
82 BidiSegmentEvent(StyledTextEvent e) {
83         super(e);
84 }
85 }