public class LinkedPositionGroup extends Object
Normally, new positions are given a sequence number
which can be used by
clients, e.g. in the UI as tab stop weight. If NO_STOP
is used as weight, a position will not be visited.
If NO_STOP
is used for all positions, the first position in a document is taken as
the only stop as to comply with the behavior of the old linked position
infrastructure.
Clients may instantiate this class.
Modifier and Type | Field and Description |
---|---|
static int |
NO_STOP
Sequence number constant declaring that a position should not be stopped by. |
Constructor and Description |
---|
LinkedPositionGroup() |
Modifier and Type | Method and Description |
---|---|
void |
addPosition(LinkedPosition position)
Adds a position to this group.
|
LinkedPosition[] |
getPositions()
Returns the positions contained in the receiver as an array.
|
boolean |
isEmpty()
Returns whether this group contains any positions.
|
boolean |
isEmtpy()
Deprecated.
As of 3.1, replaced by
isEmpty() |
public static final int NO_STOP
Sequence number
constant declaring that a position should not be stopped by.public void addPosition(LinkedPosition position) throws BadLocationException
BadLocationException
is thrown.
Positions added using this method are owned by this group afterwards and may not be updated or modified thereafter.
Once a group has been added to a LinkedModeModel
, it
becomes sealed and no positions may be added any more.
position
- the position to addBadLocationException
- if the position is invalid or conflicts with
other positions in the groupIllegalStateException
- if the group has already been added to a
modelpublic boolean isEmpty()
true
if this group is empty, false
otherwisepublic boolean isEmtpy()
isEmpty()
true
if this group is empty, false
otherwisepublic LinkedPosition[] getPositions()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.