You can associate an object interactor
with a representation object by using either CSS or the API. The
following CSS extract shows how to proceed:
Tree {
interactor: true;
}
object."ilog.tgo.model.IltNetworkElement" {
interactor: @+objInteractor;
}
Subobject#objInteractor {
class: 'ilog.cpl.interactor.IlpDefaultObjectInteractor';
}
The same configuration can be achieved
through the API, as follows:
IlpTree tree = // ...
IlpTreeController treeController = tree.getController();
// Create an object interactor
IlpObjectInteractor objectInteractor = new IlpDefaultObjectInteractor();
// Associate the object interactor with a given representation object
IlpTreeNode treeNode = // ...
treeController.setObjectInteractor( treeNode, objectInteractor);
// Configuring the specific object interactor is similar to configuring
// a view interactor.
objectInteractor.setGestureAction(IlpGesture.BUTTON3_CLICKED,
new MyAction());
Actions related to mouse and keyboard events can be customized in
the same way as for the view interactor. A pop-up menu factory
can also be defined in the same way as for the view interactor.
Please refer to
Interacting with the tree view.