Search Mailing List Archives
[protege-discussion] Code generation and listeners
tudorache at stanford.edu
Wed Apr 8 17:10:49 PDT 2009
This hasn't been requested before, but it seems reasonable :)
You can retrieve the wrapped instance (not nice, but it works), by
casting the object to a AbstractWrappedInstance and call on it:
Then, you can attach to it any Protege listener.
Paradies, Simon wrote:
> Hi all,
> How can I use listeners when using the Java code generation feature?
> There does not seem to be a possibility to do that.
> For instance, when creating a concept like
> concept = factory.createConcept(null);
> I know of no way to add a listener to the created concept.
> The only way seems to provide a name like
> concept = factory.createConcept(name);
> with which I would be able to retrieve the concept using the "normal"
> API and then adding listeners.
> A second possibility would be to manually add this feature to the
> generated Java code.
> Is there another workaround and wouldn't it be nice to have the adding
> and removing listeners feature also to be auto-generated;)?
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
More information about the protege-discussion