<< Prev | - Up - |
The Inspector functor is available for import at the URI 'x-oz://system/Inspector'
. It exports the following application programmer's interface:
inspect
{Inspector.inspect
X
}
opens a new Inspector window if none exists, then displays X
in the active widget.
inspectN
{Inspector.inspectN
+I
X
}
opens a new Inspector window if none exists, then displays X
in the widget with number I
, counting from zero. Note that the chosen widget must have been created already. This is always the case for number zero.
configure
{Inspector.configure
+Key
+Value
}
sets the configuration option with key Key
to value Value
. The following sections starting with Section 5.2 explain in detail which keys and values are valid parameters.
configureN
{Inspector.configureN
+I
+Key
X
}
behaves like configure
but directly addresses the widget number I
which must be existing already.
close
{Inspector.close}
closes the Inspector window, if any.
'class'
Inspector.new
+OptionRecord
creates are new Inspector instance. This function replaces the old class field for safety reasons. Extensions are still possible by using adapter construction. This object is concurrency safe and can be used in any space. +OptionRecord
denotes a record containing user options, with unit
the empty case. Of course, all features must denote a valid option.
object
Inspector.object
is the default instance of the Inspector and is implicitly used by Inspect
, Inspector.inspectN
, Inspector.configure
, Inspector.configureN
and Inspector.close
. This object is creating using the above Inspector.new
function.
reflect
Inspector.reflect
exports the reflection function used by the inspector to reflect deep space values. Use at your own risk.
reflect
Inspector.unreflect
exports the unreflection function used by the inspector. Use at your own risk.
The inspector object provides the methods shown below.
inspect(
X
)
inspects the value X
.
inspectN(
+N
X
)
inspects the value denoted by X
using widget number N
. Keep in mind then the corresponding widget must have been created already.
configureEntry(
+Key
+Value
)
tells the inspector to update the option denoted by Key
with value Value
.
close
closes and unmaps the inspector object.
This section covers global Inspector options.
inspectorWidth
{Inspector.configure inspectorWidth
+I
}
adjusts the Inspector's horizontal window dimension to I
pixels. Defaults to 600.
inspectorDepth
{Inspector.configure inspectorDepth
+I
}
adjusts the Inspector's vertical window dimension to I
pixels. Defaults to 400.
inspectorOptionsRange
{Inspector.configure inspectorOptionsRange
+A
}
determines which widgets will be affected by reconfiguration. A
can be either 'active'
or 'all'
, with the obvious meaning.
This section explains how to configure the value representation using the API.
widgetTreeWidth
{Inspector.configure widgetTreeWidth
+I
}
adjusts the global width traversal limit to I
. Defaults to 50.
widgetTreeDepth
{Inspector.configure widgetTreeDepth
+I
}
adjusts the global depth traversal limit to I
. Defaults to 15.
widgetTreeDisplayMode
{Inspector.configure widgetTreeDisplayMode
+B
}
switches between tree and graph representation, depending on whether B
denotes true
or false
, respectively.
widgetUseNodeSet
{Inspector.configure widgetUseNodeSet
+I
}
determines the subtree alignment. If I
is 1
, the standard aligment is used. A value of 2
selects fixed width indentation.
widgetShowStrings
{Inspector.configure widgetShowStrings
+B
}
switches between normal and readable representation of strings. It defaults to false
.
This section explains how to configure the visual aspects of node drawing using the API.
widgetTreeFont
{Inspector.configure widgetTreeFont font(family:
+F
size:
+S
weight:
+W
)}
selects the widget font as follows:
+F
denotes either 'courier'
or 'helvetica'
.
+S
denotes any integer out of {10, 12, 14, 18, 24}
.
+W
denotes either 'normal'
or 'bold'
.
The default is font(family:'courier' size:12 weight:'normal')
.
widgetContextMenuFont
{Inspector.configure widgetContextMenuFont
+V
)}
selects the font used to draw the context menus. V
denotes any valid X font description. It defaults to '-adobe-helvetica-bold-r-*-*-*-100-*'
.
{Inspector.configure
+A
+Color
)}
assigns color Color
to item type A
. Color
denotes an atom describing any valid hexadecimal RGB color code. A
is composed of a type prefix and a 'Color' suffix. For example,
{Inspector.configure intColor '#AAFF11'}
chooses to draw integer nodes with color '#AAFF11'
. The complete list of known types is shown in table Figure 5.1.
|
|
|
|
|
|
|
|
|
| Oz variables | |
| Oz finite domain variables | |
| record/tuple labels | |
| record features | |
| widget backround | |
| using occurence of graph reference | |
| defining occurence of graph reference | |
| the generic value | |
| parentheses around mixfix tuples | |
| separator between feature and subtree | |
| left arrow | |
| down arrow | |
| separators such as | |
| background color used for mappings | |
| background color used for selections |
Equivalence relations are registered using the statement
{Inspector.configure widgetRelationList ['RelationName'(RelFun) /* ... more relations */]}
Every RelFun
is expected to compute the characteristic function of its relation and therefore follows the pattern
fun {RelFun X Y}
/* computations resulting true or false */
end
These functions should not have side effects. Again, the implementation currently only supports the replacement of the all relations.
Oz allows to add new types to the system. The Inspector is able to display such values without beeing rebuilt provided that they can be distinguished using Value.status
and transformed to a built-in type. In this case, it is sufficient to add a new mapping function attached to that type. In the default case, the inspector will use Value.toVirtualString
to obtain a useful representation of the unknown value. Depending on its type, the value will be monitored und updated, too.
For example, to introduce weak dictionaries to the inspector use the code shown below.
local
fun {ItemFun V W D}
{WeakDictionary.items V}
end
Key = case {Value.status {WeakDictionary.new _}} of det(T) then T [] _ then generic end
TypeKey = {VirtualString.toAtom Key#'Menu'}
in
{Inspector.configure TypeKey menu(nil nil [auto('Show Contents'(ItemFun))] nil)}
end
See Section 5.5.2 for details about how ItemFun
is built.
<< Prev | - Up - |