Skip to main content

HyperlinkCollection Class

A collection of the Hyperlink objects.

Declaration

export class HyperlinkCollection extends Collection<Hyperlink>

Inherited Members

Inheritance

Collection<T>
HyperlinkCollection

Methods

create(position, hyperlinkInfo) Method

Creates a new Hyperlink object with the specified settings and adds it to the collection.

Declaration

create(
    position: number | IInterval,
    hyperlinkInfo: HyperlinkInfo
): Hyperlink

Parameters

Name Type Description
position number | IInterval

The hyperlink position or interval.

hyperlinkInfo HyperlinkInfo

An object that contains hyperlink settings.

Returns

Type Description
Hyperlink

The newly created hyperlink.

Remarks

var text = "Visit our site";
var url = "https://www.devexpress.com/";
var tooltip = "DevExpress site";

richEdit.beginUpdate();
richEdit.history.beginTransaction();
var subDocument = richEdit.selection.activeSubDocument;

var position = richEdit.selection.active;
position = subDocument.insertParagraph(position).interval.end;
position = subDocument.hyperlinks.create(position, new DevExpress.RichEdit.HyperlinkInfo(text, url, "", tooltip)).interval.end;
subDocument.insertParagraph(position);

richEdit.endUpdate();
richEdit.history.endTransaction();

find(position) Method

Returns a list of hyperlinks that traverse the specified position or interval.

Declaration

find(
    position: number | IInterval
): Hyperlink[]

Parameters

Name Type Description
position number | IInterval

A document position or interval.

Returns

Type Description
Hyperlink[]

A list of hyperlinks.