Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Access project from VE Plugin




"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

01/26/2007 09:36 AM

Please respond to
Discussions people developing code for the Visual Editor project        <ve-dev@xxxxxxxxxxx>

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
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?

--- RLK -- You already have done this. You have done much remote vm work using the proxies in the past. This is no different. When you do IBeanTypeProxy.newInstance() and exception is thrown you will receive an ThrowableProxyException in the IDE and from that you can determine the type of the exception in the remote vm.
 
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?
 
-- RLK -- I'm sure you've done this too. You've worked with JEM in the past. I'm assuming the project is a VE project so that JEM would already be enabled on it. JavaRefFactory.eINSTANCE.reflectType(classname, resourceSetForVE);  where resourceSetForVE is the resource set that the VE is currently using. It will find the class in the VE's classpath.

Many thanks and regards,
 
Janak
-----Original Message-----
From:
ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On Behalf Of Rich Kulp
Sent:
Thursday, January 25, 2007 5:00 PM
To:
Discussions people developing code for the Visual Editor project
Subject:
Re: [ve-dev] Access project from VE Plugin


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

_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top