loadWidget
public static org.netbeans.api.visual.widget.Widget loadWidget(org.netbeans.api.visual.widget.Scene scene,
PositionableElement element,
java.lang.Class<?> targetType)
throws IllegalActionException,
NameDuplicationException
Load widget of the given PositionableElement and targetType. If there is no widget mapped for the
the target type, it would look for a widget for the target type's parent recursively.
The method would first try finding custom widget class for the targetType. The mappings is
defined in the ObjectWidgets.properties file within widget package. If this fails, it would look for
image of the targetType based on mapping in ImageWidgets.properties file within images package. If this fails too,
it would try loading a Ptolemy icon for the provided NamedObject.
- Parameters:
scene
- The scene where the widget belongs.
element
- The element for which widget is loaded.
targetType
- The targetType used to finding appropriate widget mapped to it.
Usually targetType is the same as namedObject's type.
- Returns:
- A new widget instance for the targetType and namedObject. The
returned instance implements
NamedObjectWidgetInterface
.
- Throws:
IllegalActionException
- if there is a problem loading a object widget or icon.
NameDuplicationException
- if there is a problem loading an icon.