Home » Modeling » Epsilon » [EOL] How to call constructor when using Native
| | |
Re: [EOL] How to call constructor when using Native [message #529681 is a reply to message #529666] |
Mon, 26 April 2010 18:10 |
Yu Sun Messages: 58 Registered: July 2009 |
Member |
|
|
Thanks Dimitrios and Steffen. The problem has been solved. I used the new syntax and it works perfect!
However, I do still have one problem regarding Native remaining:
In the initial Eclipse WS, I have a Plugin Project A, which contains a EOL program, and a popup menu event handler to run EOL by Java (I used the EolStandaloneExample).
Then, in the runtime Eclipse WS, I can right-click on the model and run the EOL on the selected model. It works well.
The problem comes when I use Native to call my own classes.
I put my class (e.g., testnative.MyUtility.java) into a plug-in project in the initial Eclipse WS (I refered to http:// www.eclipse.org/gmt/epsilon/doc/articles/call-java-from-epsi lon/), and setup the Tool Extension Point.
Then, in the runtime Eclipse WS, if I create a new EOL in the runtime WS, and use Native('testnative.MyUtility.java'), it works perfect! which means that I setup the extension point correctly.
But, if I run the right-click popup menu option, it will say that "Type MyUtility not found...."
Later, I checked the article again(http:// www.eclipse.org/gmt/epsilon/doc/articles/call-java-from-epsi lon/), and it says "To invoke the tool you have two options: You can either run a new Eclipse instance, or export the plugin and place it in the dropins folder of your installation. Then you can invoke the tool using the following EOL program. "
I thought that since the EOL is in the initial Eclipse WS, maybe I should export the plugin. So I just exported the plugin contain MyUtility.java and put it in the plugin folder of the initial Eclipse. But the right-click running in the runtime Eclipse still cannot find the type. In stead, if you create an EOL in the initial Eclipse WS, it works well, which means that the exported plugin is also setup correctly.
To sum up, I have a plugin containing a java class that I want to use as Nativa in EOL. It has been setup, so that we can use Native to call it either by running a EOL file created in runtime Eclipse, or running a EOL file in initial Eclipse. However, it cannot be found if we trigger the popup menu option in runtime Eclipse (EOL is in the initial Eclipse WS and being called by the event handler).
Sorry for the wordy description. I really appreciate if you can give me some advice.
Thanks a lot.
Yu
|
|
|
Re: [EOL] How to call constructor when using Native [message #529693 is a reply to message #529681] |
Mon, 26 April 2010 19:04 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Yu,
When preparing the context you should also add this line:
context.getNativeTypeDelegates().add(new
ExtensionPointToolNativeTypeDelegate());
(The reason why EolStandaloneExample doesn't contain this line is that
it is meant to be executable outside Eclipse too)
Cheers,
Dimitris
Yu Sun wrote:
> Thanks Dimitrios and Steffen. The problem has been solved. I used the
> new syntax and it works perfect!
>
> However, I do still have one problem regarding Native remaining:
>
> In the initial Eclipse WS, I have a Plugin Project A, which contains a
> EOL program, and a popup menu event handler to run EOL by Java (I used
> the EolStandaloneExample).
>
> Then, in the runtime Eclipse WS, I can right-click on the model and run
> the EOL on the selected model. It works well.
>
> The problem comes when I use Native to call my own classes.
>
> I put my class (e.g., testnative.MyUtility.java) into a plug-in project
> in the initial Eclipse WS (I refered to
> http://www.eclipse.org/gmt/epsilon/doc/articles/call-java-fr om-epsilon/),
> and setup the Tool Extension Point.
> Then, in the runtime Eclipse WS, if I create a new EOL in the runtime
> WS, and use Native('testnative.MyUtility.java'), it works perfect! which
> means that I setup the extension point correctly.
>
> But, if I run the right-click popup menu option, it will say that "Type
> MyUtility not found...."
>
> Later, I checked the article
> again( http://www.eclipse.org/gmt/epsilon/doc/articles/call-java-fr om-epsilon/),
> and it says "To invoke the tool you have two options: You can either run
> a new Eclipse instance, or export the plugin and place it in the
> dropins folder of your installation. Then you can invoke the tool using
> the following EOL program. "
>
> I thought that since the EOL is in the initial Eclipse WS, maybe I
> should export the plugin. So I just exported the plugin contain
> MyUtility.java and put it in the plugin folder of the initial Eclipse.
> But the right-click running in the runtime Eclipse still cannot find the
> type. In stead, if you create an EOL in the initial Eclipse WS, it works
> well, which means that the exported plugin is also setup correctly.
>
> To sum up, I have a plugin containing a java class that I want to use as
> Nativa in EOL. It has been setup, so that we can use Native to call it
> either by running a EOL file created in runtime Eclipse, or running a
> EOL file in initial Eclipse. However, it cannot be found if we trigger
> the popup menu option in runtime Eclipse (EOL is in the initial Eclipse
> WS and being called by the event handler).
>
> Sorry for the wordy description. I really appreciate if you can give me
> some advice.
>
> Thanks a lot.
>
> Yu
>
|
|
| | | |
Re: [EOL] How to call constructor when using Native [message #588675 is a reply to message #529666] |
Mon, 26 April 2010 18:10 |
Yu Sun Messages: 58 Registered: July 2009 |
Member |
|
|
Thanks Dimitrios and Steffen. The problem has been solved. I used the new syntax and it works perfect!
However, I do still have one problem regarding Native remaining:
In the initial Eclipse WS, I have a Plugin Project A, which contains a EOL program, and a popup menu event handler to run EOL by Java (I used the EolStandaloneExample).
Then, in the runtime Eclipse WS, I can right-click on the model and run the EOL on the selected model. It works well.
The problem comes when I use Native to call my own classes.
I put my class (e.g., testnative.MyUtility.java) into a plug-in project in the initial Eclipse WS (I refered to http://www.eclipse.org/gmt/epsilon/doc/articles/call-java-fr om-epsilon/), and setup the Tool Extension Point.
Then, in the runtime Eclipse WS, if I create a new EOL in the runtime WS, and use Native('testnative.MyUtility.java'), it works perfect! which means that I setup the extension point correctly.
But, if I run the right-click popup menu option, it will say that "Type MyUtility not found...."
Later, I checked the article again( http://www.eclipse.org/gmt/epsilon/doc/articles/call-java-fr om-epsilon/), and it says "To invoke the tool you have two options: You can either run a new Eclipse instance, or export the plugin and place it in the dropins folder of your installation. Then you can invoke the tool using the following EOL program. "
I thought that since the EOL is in the initial Eclipse WS, maybe I should export the plugin. So I just exported the plugin contain MyUtility.java and put it in the plugin folder of the initial Eclipse. But the right-click running in the runtime Eclipse still cannot find the type. In stead, if you create an EOL in the initial Eclipse WS, it works well, which means that the exported plugin is also setup correctly.
To sum up, I have a plugin containing a java class that I want to use as Nativa in EOL. It has been setup, so that we can use Native to call it either by running a EOL file created in runtime Eclipse, or running a EOL file in initial Eclipse. However, it cannot be found if we trigger the popup menu option in runtime Eclipse (EOL is in the initial Eclipse WS and being called by the event handler).
Sorry for the wordy description. I really appreciate if you can give me some advice.
Thanks a lot.
Yu
|
|
|
Re: [EOL] How to call constructor when using Native [message #588682 is a reply to message #588675] |
Mon, 26 April 2010 19:04 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Yu,
When preparing the context you should also add this line:
context.getNativeTypeDelegates().add(new
ExtensionPointToolNativeTypeDelegate());
(The reason why EolStandaloneExample doesn't contain this line is that
it is meant to be executable outside Eclipse too)
Cheers,
Dimitris
Yu Sun wrote:
> Thanks Dimitrios and Steffen. The problem has been solved. I used the
> new syntax and it works perfect!
>
> However, I do still have one problem regarding Native remaining:
>
> In the initial Eclipse WS, I have a Plugin Project A, which contains a
> EOL program, and a popup menu event handler to run EOL by Java (I used
> the EolStandaloneExample).
>
> Then, in the runtime Eclipse WS, I can right-click on the model and run
> the EOL on the selected model. It works well.
>
> The problem comes when I use Native to call my own classes.
>
> I put my class (e.g., testnative.MyUtility.java) into a plug-in project
> in the initial Eclipse WS (I refered to
> http://www.eclipse.org/gmt/epsilon/doc/articles/call-java-fr om-epsilon/),
> and setup the Tool Extension Point.
> Then, in the runtime Eclipse WS, if I create a new EOL in the runtime
> WS, and use Native('testnative.MyUtility.java'), it works perfect! which
> means that I setup the extension point correctly.
>
> But, if I run the right-click popup menu option, it will say that "Type
> MyUtility not found...."
>
> Later, I checked the article
> again( http://www.eclipse.org/gmt/epsilon/doc/articles/call-java-fr om-epsilon/),
> and it says "To invoke the tool you have two options: You can either run
> a new Eclipse instance, or export the plugin and place it in the
> dropins folder of your installation. Then you can invoke the tool using
> the following EOL program. "
>
> I thought that since the EOL is in the initial Eclipse WS, maybe I
> should export the plugin. So I just exported the plugin contain
> MyUtility.java and put it in the plugin folder of the initial Eclipse.
> But the right-click running in the runtime Eclipse still cannot find the
> type. In stead, if you create an EOL in the initial Eclipse WS, it works
> well, which means that the exported plugin is also setup correctly.
>
> To sum up, I have a plugin containing a java class that I want to use as
> Nativa in EOL. It has been setup, so that we can use Native to call it
> either by running a EOL file created in runtime Eclipse, or running a
> EOL file in initial Eclipse. However, it cannot be found if we trigger
> the popup menu option in runtime Eclipse (EOL is in the initial Eclipse
> WS and being called by the event handler).
>
> Sorry for the wordy description. I really appreciate if you can give me
> some advice.
>
> Thanks a lot.
>
> Yu
>
|
|
| | |
Goto Forum:
Current Time: Tue Sep 24 04:36:14 GMT 2024
Powered by FUDForum. Page generated in 0.04859 seconds
|