EXTEND CLASS statement
The EXTEND CLASS
statement extends an existing class.
Syntax
EXTEND CLASS name
[{
objectName1 [objectCaption1] [imageSetting1],
...
objectNameM [objectCaptionM] [imageSettingM]
}]
[: parent1, ..., parentN];
Description
The EXTEND CLASS
statement extends an existing custom class with additional parent classes and new static objects. You can also extend abstract classes by adding parent classes to them.
Parameters
-
name
Class name. A composite ID.
-
objectName1, ..., objectNameM
Names of new static objects of the specified class. Each name is defined by a simple ID. Name values are stored in the
System.staticName
system property. -
objectCaption1, ..., objectCaptionM
Captions of new static objects of the specified class. Each caption is a string literal. If the caption is not defined, the name of the static object will be its caption. Caption values are stored in the
System.staticCaption
system property. -
imageSetting1, ..., imageSettingM
Settings for displaying icons in the captions of new static objects of this class. By default, the presence or absence of an icon is controlled by the parameters
settings.defaultImagePathRankingThreshold
andsettings.defaultAutoImageRankingThreshold
. TheHTML
class value used for displaying the icon is stored in the system propertySystem.image[StaticObject]
. This option allows you to manually configure the icon display. It can have one of two forms:-
IMAGE [fileExpr]
Specifying the relative path to the image file that will be displayed as the icon in the caption of the static object. If
fileExpr
is not specified, the default icon display mode is activated.-
fileExpr
Expression whose value specifies the path to the image file. The path is specified relative to the
images
directory.
-
-
NOIMAGE
Keyword indicating that the static object's caption should have no icon.
-
-
parent1, ..., parentN
A list of names of new parent classes. Each name is defined by a composite ID.
Examples
CLASS ABSTRACT Shape;
CLASS Box : Shape;
CLASS Quadrilateral;
EXTEND CLASS Box : Quadrilateral; // Adding inheritance
CLASS ShapeType {
point 'Dot',
segment 'Line segment'
}
EXTEND CLASS ShapeType { // Adding a static object
circle 'Circle'
}