[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [ve-dev] Access project from VE Plugin
|
Hi
Rich,
Thanks
for the prompt reply.
Couple
of questions please:
1. If
there is an error/exception (say while instantiating a class) in target VM, how
do I convey it to the VE?
2. You
said I can use JEM to get IType. I am sorry I did not understand. I have a class
name. I want to find out if the class exists on the Project (in which Visual
Classes are being created) class path. All this I want to do in VE (i.e in my
Plugin class). Is this possible? Could you please point me to relevant
documentation?
Many
thanks and regards,
Janak
Hi,
The short answer is you cannot
instantiate (i.e. new aclass()) of a class in a project within Eclipse. It is
not meant to be. That is why we use the remote vm. There are classloader
problems, jvm version problems, etc.
As for IType, you can use JEM to get it. For the JavaClass for your
class, use getReflectionType() and cast to IType.
Rich
"Janak Mulani"
<janak.mulani@xxxxxxxxx> Sent by: ve-dev-bounces@xxxxxxxxxxx
01/25/2007 10:32 AM
Please respond
to Discussions people developing code for the Visual Editor
project
<ve-dev@xxxxxxxxxxx> |
|
To
| "ve-Dev@Eclipse. Org"
<ve-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| [ve-dev] Access project from VE
Plugin |
|
Dear VE Team,
1. How does one get access to the JavaProject
of the Visual Class from the
VE plug-in?
2. Is it possible to access
a particular class from that project and
instantiate it say in the Plugin
class?
Thanks and regards,
Janak
PS: I could do the
following from the Plugin class, but it doesn't seem to
be the right way
and also I can't create an instance of IType:
IResource r
=
ResourcesPlugin.getWorkspace().getRoot().findMember("ULCVELocalContainer");
IProject project = (IProject) r;
IJavaProject javaProject =
JemProjectUtilities.getJavaProject(project);
try
{
IType type
=
javaProject.findType("com.canoo.ve.licensecheck.LoadedClassCheck");
if
(type.isClass()) {
System.out.println("Class found");
}
} catch (JavaModelException e) {
// TODO Auto-generated catch
block
e.printStackTrace();
}
_______________________________________________
ve-dev mailing
list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev