Up Previous Next Title Page Index Contents

2.1.5 Object Tool commands

The Object Tool menu bar contains a number of commands, many of which are also available in the toolbar. Most commands are also found in the other metamodeling tools; the name of the first menu, Object, will change appropriately in other tools.

The commands for the Properties list are described in Section 2.1.3 above.

New

To create a new object type, press the New toolbar button or select Object | New... from the menu bar.

New Subtype...

By default, new object types are sub-typed from the generic Object type. It is also possible, however, to organize object types into an inheritance hierarchy. You can build such hierarchies below all of the metatypes. Inheritance is mainly data inheritance, based on the property types in non-property tools (i.e. in Graph Tool, Object Tool, Relationship Tool, and Role Tool) and according to the data type in Property Tool. The new object, relationship, role or port type inherits all of the properties of its ancestor type.

There is also some inheritance of behavior, e.g. an object can take part in a binding which includes an ancestor of that object’s type (see Section 2.5.4). Similarly a property whose data type is a given non-property type may also contain non-properties whose types are descendants of the given type.

To create a new object type as a subtype of another object type, select Object | New Subtype... (or hold Shift down and press New in the toolbar) and select the desired ancestor type from the list of available object types. The name of the ancestor for the current object type will be shown in the read-only Ancestor field.

Open

Object | Open... will bring up a list of object types in currently open projects. Selecting an object type from the list will load the object type definition in the Object Tool.

Save

Object | Save and the Save and Save and Close toolbar buttons save the changes to the object type; the latter also closes the Object Tool. The buttons are disabled until the user has changed some field in the Object Tool. Changes to dialogs and symbols are accepted in their respective tools, and thus do not affect the state of these buttons. In a non-Workbench version of MetaEdit+, these buttons are always disabled.

When saving, one of the following messages may appear:
You are not authorized to metamodel!
This means that the current user is not one of the metamodelers set by the system administrator. Contact your system administrator.
Could not obtain the lock for metamodeling for the metatype in project xxx. Lock is held by user xx. Current metamodeling security level is exclusive/single.
This only appears in the multi-user version, and means that someone else is modeling or metamodeling at the same time. If the metamodeling security level is exclusive, then you will have to wait until all other users have logged out, and you have committed or abandoned your transaction, before you can make type changes. If the metamodeling security level is single, then you will have to wait until the other metamodeler has logged out, and you have committed or abandoned your transaction, before you can make changes.

Set Identifier Generator

As an alternative to having an identifying property, Tools | Set Identifier Generator defines a generator for the object type identifier. A separate editor to define the generator will be launched when this menu item is selected.

As such generators are normally short, they omit the usual ‘Report "Report name"’ and ‘EndReport’ keywords. Also, you must avoid using the generator id; command on this object during its identifier generator: id; will try to output the identifier for this object, which will of course call this same generator, leading to an infinite recursion. You can however safely use id; for other objects of this type or others.

When the identifier is generated, no asterisk (*) will be shown before any local name in the Properties list. If the object type has no identifier at all, the name of the type is returned.

To remove an Identifier Generator and revert to displaying one of the properties as the identifier, select that property in the property list and choose Set as Identifier from the pop-up menu (see Figure 2–2 in Section 2.1.3).
As identifiers are calculated to display objects in a textual format in many places in MetaEdit+, errors when running identifier generators are handled by returning the output so far, plus an error message – opening a normal error dialog would be impractical. Infinite recursion when running an identifier generator is prevented by a timeout on such generators, returning an error in a similar way.

Property Dialogs

Tools | Edit Dialog opens a Dialog Editor for the properties of this object type. The default dialog can thus be modified for your needs and taste with this operation. See Chapter 4 for details.

Tools | Generate Default Dialog automatically defines a dialog for this object type, overriding any custom dialog. This default dialog contains a label and entry field for each property, arranged vertically in the order in which they appear in the property list. At the bottom of the default dialog are OK, Cancel and Info... buttons.

Symbol Editor

Tools | Symbol Editor opens a Symbol Editor where the graphical symbol for the object type can be drawn. Symbols can only be edited for types that already exist, thus this button is not available until the type has been saved. See Chapter 3 for details of using the Symbol Editor.

Info Tool

Tools | Info Tool displays an Info Tool for the type, showing which types this type uses, and which other types use this type.

Help

Help | Object Tool displays help about the Object Tool.

Up Previous Next Title Page Index Contents