Show in Frame No Frame
Up Previous Next Title Page Index Contents Search

9.4.6 Control

The API commands in this category are for reporting runtime state of MetaEdit+ itself, or running MetaEdit+ commands, rather than reading or writing the model and design data.

Please note that all command line parameters (see Section 10.1) can be utilized via the API as well. They all follow the format MENull command (MENull receiver, string*), with a string argument for each colon in the command name.

Similarly, all command line string functions (see Section 10.2) can be utilized via the API as well. They all follow the format string command (MENull receiver, string*), with a string argument for each colon in the command name.

boolean forGraphRun(MEOop receiver, string forGraphRun)

For the receiver argument, a Graph MEOop, run the generator named in the second argument, a string. Returns a boolean indicating whether the generation proceeded without fatal errors.

string textForGraphRun (MEOop receiver, string textForGraphRun, string preRun)

For the receiver argument, a Graph MEOop, run the generator named in the second argument, a string. If the third argument, a string, is non-empty, first run the generator named there. Returns the contents of the default screen output stream produced by the generator(s).

string textForRun (MENull receiver, string textForRun, MEAnyArray stack, MEAnyArray arguments, string preRun)

The first argument is an MENull. Runs the generator named in the second argument, textForRun, a string. The third argument, stack, is the MERL element stack, an MEAnyArray generally containing an MEOop MEAny for the graph, and possibly with subsequent stack elements for an object, subgraph, property or string element. It can also be called with no graph on the stack: there must be at least one element on the stack, but it can be e.g. an empty MEAny string, if no stack is needed. The fourth argument, arguments, is an MEAnyArray for the arguments supplied to the generator, generally empty or containing String MEAnys; any MEOop MEAnys will be converted to a string representation before being used as an argument. If the fifth argument, preRun, a string, is non-empty, first run the generator named there. Returns the contents of the default screen output stream produced by the generator(s).

string generatorNames(METype receiver)

Return a string containing the names of the generators defined in the receiver argument, a Graph METype, one per line.

MENull open (MEOop receiver)

Opens the receiver argument in a graph representation. Will prompt with a list dialog in MetaEdit+ if there is more than one possibility.

MENull animate (MEOop receiver, MEOop animate)

Opens the specified graph and highlights the specified NonProperty. The receiver argument is the MEOop of the graph, the second is the MEOop of the NonProperty. This will never prompt.

MENull animateAll (MEOop receiver, MEOopArray animateAll)

Opens the specified diagram and highlights the specified ObjectReprs. The receiver argument is the MEOop of the diagram, the second is the MEOopArray of the ObjectReprs. This will never prompt.

MENull animateNone (MEOop receiver)

Turns off all highlighting in any editor open on the diagram. Does not open the diagram.

MENull refresh (MEOop receiver)

Refreshes the display of the receiver argument, which is an MEOop of any conceptual or representational instance.

boolean isDirty (MENull receiver)

Returns a Boolean indicating whether there are any changes to persistent data that are not yet committed to the repository.

boolean isLogout (MENull receiver)

Returns a Boolean indicating whether MetaEdit+ is logged out of the repository. Initially true, false once logged in (from early during the login process).

MEOopArray copiedObjects (MENull receiver)

Returns the MEOops of objects currently in the copy buffer. Bindings in the copy buffer are ignored. This is a useful way of allowing users to select an object in MetaEdit+, and have your application know which object was selected: rather than just selecting the object, they can select and copy it.

MEAnyArray waitForBindingCreation (MENull receiver, int waitForBindingCreation)

Returns an MEAny array containing information about a binding creation that was started before the timeout, or an empty MEAny array if it times out. The 3-element return array is: the graph representation (MEAny of MEOop), relationship type (MEAny of METype), and first object representation (MEAny of MEOop).

MEAnyArray waitForBindingFinalization (MENull receiver, int waitForBindingFinalization, MEOop in)

Returns an MEAny array: empty if it times out; containing the diagram and two MENulls if binding creation was cancelled (either during the duration of this call or before it, i.e. the diagram does not currently have an open editor in binding creation mode); or containing the diagram, new bindingRepr and binding if successful.

MEOopArray openedGraphReprs (MENull receiver)

Return the MEOops of all representation graphs that are currently open in editors, uppermost first.

boolean startMemento (MENull receiver, string label)

Start an Undo Memento to contain the following API operations, up to the next stopMemento command. The first argument is an MENull. The second argument is the label for the Undo Memento, a short string describing what the commands do. The return value is a boolean showing whether the operation was successful.

boolean stopMemento (MENull receiver, string label)

Stop the current Undo Memento, collecting all the commands since the preceding startMemento into an undoable operation. The first argument is an MENull. The second argument is the label for the Undo Memento, which must match the label given in the preceding startMemento, which must still be the current memento. The return value is a boolean showing whether the operation was successful.

string lockAll (MENull receiver, MEOopArray lockAll)

Lock the objects supplied as MEOops in the second argument, for the current user for the duration of the current transaction. Returns an empty string on success, or a string listing the objects that could not be locked on failure. Only necessary in the multi-user version.

Show in Frame No Frame
Up Previous Next Title Page Index Contents Search