Feature #1832

RCP: X.X, Calling extension classes and methods from Groovy

Added by Matthieu Decorde about 3 years ago. Updated about 3 years ago.

Status:New Start date:07/29/2016
Priority:Normal Due date:
Assignee:- % Done:

80%

Category:Macros Spent time: -
Target version:TXM 0.7.8

Description

Currently a Groovy script cannot call classes or methods from a TXM extension, and this raises a ClassNotFound exception.

The Groovy ScriptEngine is called with the class loader of the org.txm.rcpapplication plugin. But org.txm.rcpapplication cannot see extensions classes because it does not know about them and does not depend on them.

Solution

Provide our own class loader called TXMClassLoader to the Groovy ScriptEngine, built from the list of all the class loaders of 'active' bundles (plugins and extensions loaded into the platform) at the moment of the first macro call or when the TXMHome preference is changed. TXMClassLoader should auto-update when extensions are added or removed.

History

#1 Updated by Serge Heiden about 3 years ago

  • Subject changed from RCP: X.X, Call extension classes and methods from Groovy to RCP: X.X, Calling extension classes and methods from Groovy
  • Description updated (diff)

#2 Updated by Matthieu Decorde about 3 years ago

  • % Done changed from 0 to 80

the solution worked

Also available in: Atom PDF