Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » [JEM] newbie questions
[JEM] newbie questions [message #79330] Mon, 07 February 2005 17:16 Go to next message
Eclipse UserFriend
Originally posted by: newbie.newbie.org

Hi guys,

I have a requirements to manage JavaBean components (BeanInfo
introspection, prototyping, etc.). Components are not of visual type.

As far as I understand JEM have this ability. But as a newbie (no VE
experience too) I fail to grasp the main use cases. So here are the bulk
of questions that I have. Thanks in advance for everyone who will help:

1. In Java Project properties I can see contributed BeanInfo Path page.
So I guess, I can add additional path to jar file that contain JavaBean
and jem.beaninfo plugin will be able to introspect JavaBeans from this
jar as well as from the current project sources.
- Is that correct?
- So, why it don't show my simple JavaBeanTest class that I created?
- How to 'turn on' introspection in current project programmatically?

2. Let say I have bunch of external jars and I added them to BeanInfo
Path page.
- How then can I get the BeanInfos?
- Is that BeanInfoEntry is what I need to get an actual BeanInfo?
- What is a use case of this introspection in terms of JEM api?
- In org.eclipse.beaninfo.registrations I fail to understand an
override concept. What is it used for?

3. JEM provide an ability to 'run' JavaBeans in remote VM.
- What is a main use case here?
- Does introspection happening in separate VM too?

4. Does any documentation exists on JEM?

-alex.
Re: [JEM] newbie questions [message #79388 is a reply to message #79330] Mon, 07 February 2005 19:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Do you need to access the BeanInfo programatically? Or do you mean that
you want the Visual Editor to see the beaninfo for your non visual classes?

If you want to access them programatically, you need to:

Initialization: Do this once for each project during an Eclipse session.
This tells you are now interested in getting the BeanInfo for a project.

ResourceSet projectRSet = BeaninfoNature.getRuntime(IProject
project).getResourceSet();

Then to get the BeanInfo for a class:

JavaClass jc =
JavaRefFactory.EINSTANCE.reflect("fully-qualified-classname ", projectRSet);

jc.getProperties() <- This will return the properties
jc.getEvents() <- This will return the events.

On the Beaninfo tab you add the jars that contain the BeanInfo for
classes that are in the standard java build path of your project. The
BeanInfo paths contain the BeanInfo jars, while the build path contains
the classes.

JEM provides the capability to run in a remote vm because the VM that is
running the IDE may be a different VM than what the project is compiling
against. It also provides safety since things done in the remote vm by
user code (the code from the project) doesn't run in the same VM as the
IDE and so it can't cause Eclipse to crash.

Also JEM uses a remote vm to do the introspection.

Newbie wrote:
> Hi guys,
>
> I have a requirements to manage JavaBean components (BeanInfo
> introspection, prototyping, etc.). Components are not of visual type.
>
> As far as I understand JEM have this ability. But as a newbie (no VE
> experience too) I fail to grasp the main use cases. So here are the bulk
> of questions that I have. Thanks in advance for everyone who will help:
>
> 1. In Java Project properties I can see contributed BeanInfo Path page.
> So I guess, I can add additional path to jar file that contain JavaBean
> and jem.beaninfo plugin will be able to introspect JavaBeans from this
> jar as well as from the current project sources.
> - Is that correct?
> - So, why it don't show my simple JavaBeanTest class that I created?
> - How to 'turn on' introspection in current project programmatically?
>
> 2. Let say I have bunch of external jars and I added them to BeanInfo
> Path page.
> - How then can I get the BeanInfos?
> - Is that BeanInfoEntry is what I need to get an actual BeanInfo?
> - What is a use case of this introspection in terms of JEM api?
> - In org.eclipse.beaninfo.registrations I fail to understand an
> override concept. What is it used for?
>
> 3. JEM provide an ability to 'run' JavaBeans in remote VM.
> - What is a main use case here?
> - Does introspection happening in separate VM too?
>
> 4. Does any documentation exists on JEM?
>
> -alex.

--
Thanks,
Rich Kulp
Re: [JEM] newbie questions [message #79402 is a reply to message #79388] Mon, 07 February 2005 22:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexsmr.NOJUNK.sympatico.ca

Thanks Rich for response:

Rich Kulp wrote:
> Do you need to access the BeanInfo programatically? Or do you mean that
> you want the Visual Editor to see the beaninfo for your non visual classes?

Yes, I want to use JEM programatically to build plugins and create sort
of component palette and other UI's to manipulate components. I
certainly want to reuse as much as possible from JEM UI (BeanInfo Path,
etc.), but I'm still do not getting a general architecture of JEM.

> If you want to access them programatically, you need to:
>
> Initialization: Do this once for each project during an Eclipse session.
> This tells you are now interested in getting the BeanInfo for a project.
>
> ResourceSet projectRSet = BeaninfoNature.getRuntime(IProject
> project).getResourceSet();

Do I have to enable BeaninfoNature for the project? Or this *is* an
enablement? What does it do?

>
> Then to get the BeanInfo for a class:
>
> JavaClass jc =
> JavaRefFactory.EINSTANCE.reflect("fully-qualified-classname ", projectRSet);
>
> jc.getProperties() <- This will return the properties
> jc.getEvents() <- This will return the events.
>
> On the Beaninfo tab you add the jars that contain the BeanInfo for
> classes that are in the standard java build path of your project. The
> BeanInfo paths contain the BeanInfo jars, while the build path contains
> the classes.

But this JavaClass is not exactly a BeanInfo... How would I get
BeanDescriptor or an Icon for the component?

>
> JEM provides the capability to run in a remote vm because the VM that is
> running the IDE may be a different VM than what the project is compiling
> against. It also provides safety since things done in the remote vm by
> user code (the code from the project) doesn't run in the same VM as the
> IDE and so it can't cause Eclipse to crash.
>
> Also JEM uses a remote vm to do the introspection.

Does this means that it is safe to work with components that were built
and should be run with jdk 5.0? Is JEM generally compable with jdk 5.0?

>
> Newbie wrote:
>
>> Hi guys,
>>
>> I have a requirements to manage JavaBean components (BeanInfo
>> introspection, prototyping, etc.). Components are not of visual type.
>>
>> As far as I understand JEM have this ability. But as a newbie (no VE
>> experience too) I fail to grasp the main use cases. So here are the
>> bulk of questions that I have. Thanks in advance for everyone who will
>> help:
>>
>> 1. In Java Project properties I can see contributed BeanInfo Path
>> page. So I guess, I can add additional path to jar file that contain
>> JavaBean and jem.beaninfo plugin will be able to introspect JavaBeans
>> from this jar as well as from the current project sources.
>> - Is that correct?
>> - So, why it don't show my simple JavaBeanTest class that I created?
>> - How to 'turn on' introspection in current project programmatically?
>>
>> 2. Let say I have bunch of external jars and I added them to BeanInfo
>> Path page.
>> - How then can I get the BeanInfos?
>> - Is that BeanInfoEntry is what I need to get an actual BeanInfo?
>> - What is a use case of this introspection in terms of JEM api?
>> - In org.eclipse.beaninfo.registrations I fail to understand an
>> override concept. What is it used for?
>>
>> 3. JEM provide an ability to 'run' JavaBeans in remote VM.
>> - What is a main use case here?
>> - Does introspection happening in separate VM too?
>>
>> 4. Does any documentation exists on JEM?
>>
>> -alex.
>
>
Re: [JEM] newbie questions [message #79501 is a reply to message #79402] Tue, 08 February 2005 15:03 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

>>
>> ResourceSet projectRSet = BeaninfoNature.getRuntime(IProject
>> project).getResourceSet();
>
>
> Do I have to enable BeaninfoNature for the project? Or this *is* an
> enablement? What does it do?

Doing getRuntime does two things, one it enables the BeanInfo nature for
the project if not already existing, and two it tells the JEM model to
use BeanInfo for this session of Eclipse. If this wasn't done, then JEM
would just return classes, fields, and methods. It wouldn't do
introspection to get properties, events, and operations.

The enabling of JEM for a session is done because JEM without BeanInfo
is used in non-Eclipse and non-BeanInfo situations and those cases don't
want BeanInfo overhead.

>
>>
>> Then to get the BeanInfo for a class:
>>
>> JavaClass jc =
>> JavaRefFactory.EINSTANCE.reflect("fully-qualified-classname ",
>> projectRSet);
>>
>> jc.getProperties() <- This will return the properties
>> jc.getEvents() <- This will return the events.
>>
>> On the Beaninfo tab you add the jars that contain the BeanInfo for
>> classes that are in the standard java build path of your project. The
>> BeanInfo paths contain the BeanInfo jars, while the build path
>> contains the classes.
>
>
> But this JavaClass is not exactly a BeanInfo... How would I get
> BeanDescriptor or an Icon for the component?
>

Use:

BeanDecorator bd =
org.eclipse.jem.internal.beaninfo.core.Utilities.getBeanDeco rator(javaclass);

to get the bean decorator.

Use:

javaClass.getProperties() to the get properties for the class or
getAllProperties() to get all properties including superclass
properties. Then on each property returned use:

PropertyDecorator pd =
Utilities.getPropertyDecorator(EStructuralFeature);

Ignore for now that these are marked internal. Eventually they will be
renamed to API but we haven't gotton around to it yet.

>>
>> JEM provides the capability to run in a remote vm because the VM that
>> is running the IDE may be a different VM than what the project is
>> compiling against. It also provides safety since things done in the
>> remote vm by user code (the code from the project) doesn't run in the
>> same VM as the IDE and so it can't cause Eclipse to crash.
>>
>> Also JEM uses a remote vm to do the introspection.
>
>
> Does this means that it is safe to work with components that were built
> and should be run with jdk 5.0? Is JEM generally compable with jdk 5.0?

At this time, we don't support 5.0. It may work, it may not. We haven't
done any tests at all. When we step up to Eclipse 3.1, and by the time
Eclipse 3.1 is complete, we will be supporting 5.0.

--
Thanks,
Rich Kulp
Re: [JEM] newbie questions [message #605053 is a reply to message #79330] Mon, 07 February 2005 19:20 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Do you need to access the BeanInfo programatically? Or do you mean that
you want the Visual Editor to see the beaninfo for your non visual classes?

If you want to access them programatically, you need to:

Initialization: Do this once for each project during an Eclipse session.
This tells you are now interested in getting the BeanInfo for a project.

ResourceSet projectRSet = BeaninfoNature.getRuntime(IProject
project).getResourceSet();

Then to get the BeanInfo for a class:

JavaClass jc =
JavaRefFactory.EINSTANCE.reflect("fully-qualified-classname ", projectRSet);

jc.getProperties() <- This will return the properties
jc.getEvents() <- This will return the events.

On the Beaninfo tab you add the jars that contain the BeanInfo for
classes that are in the standard java build path of your project. The
BeanInfo paths contain the BeanInfo jars, while the build path contains
the classes.

JEM provides the capability to run in a remote vm because the VM that is
running the IDE may be a different VM than what the project is compiling
against. It also provides safety since things done in the remote vm by
user code (the code from the project) doesn't run in the same VM as the
IDE and so it can't cause Eclipse to crash.

Also JEM uses a remote vm to do the introspection.

Newbie wrote:
> Hi guys,
>
> I have a requirements to manage JavaBean components (BeanInfo
> introspection, prototyping, etc.). Components are not of visual type.
>
> As far as I understand JEM have this ability. But as a newbie (no VE
> experience too) I fail to grasp the main use cases. So here are the bulk
> of questions that I have. Thanks in advance for everyone who will help:
>
> 1. In Java Project properties I can see contributed BeanInfo Path page.
> So I guess, I can add additional path to jar file that contain JavaBean
> and jem.beaninfo plugin will be able to introspect JavaBeans from this
> jar as well as from the current project sources.
> - Is that correct?
> - So, why it don't show my simple JavaBeanTest class that I created?
> - How to 'turn on' introspection in current project programmatically?
>
> 2. Let say I have bunch of external jars and I added them to BeanInfo
> Path page.
> - How then can I get the BeanInfos?
> - Is that BeanInfoEntry is what I need to get an actual BeanInfo?
> - What is a use case of this introspection in terms of JEM api?
> - In org.eclipse.beaninfo.registrations I fail to understand an
> override concept. What is it used for?
>
> 3. JEM provide an ability to 'run' JavaBeans in remote VM.
> - What is a main use case here?
> - Does introspection happening in separate VM too?
>
> 4. Does any documentation exists on JEM?
>
> -alex.

--
Thanks,
Rich Kulp
Re: [JEM] newbie questions [message #605057 is a reply to message #79388] Mon, 07 February 2005 22:09 Go to previous message
Eclipse UserFriend
Originally posted by: alexsmr.NOJUNK.sympatico.ca

Thanks Rich for response:

Rich Kulp wrote:
> Do you need to access the BeanInfo programatically? Or do you mean that
> you want the Visual Editor to see the beaninfo for your non visual classes?

Yes, I want to use JEM programatically to build plugins and create sort
of component palette and other UI's to manipulate components. I
certainly want to reuse as much as possible from JEM UI (BeanInfo Path,
etc.), but I'm still do not getting a general architecture of JEM.

> If you want to access them programatically, you need to:
>
> Initialization: Do this once for each project during an Eclipse session.
> This tells you are now interested in getting the BeanInfo for a project.
>
> ResourceSet projectRSet = BeaninfoNature.getRuntime(IProject
> project).getResourceSet();

Do I have to enable BeaninfoNature for the project? Or this *is* an
enablement? What does it do?

>
> Then to get the BeanInfo for a class:
>
> JavaClass jc =
> JavaRefFactory.EINSTANCE.reflect("fully-qualified-classname ", projectRSet);
>
> jc.getProperties() <- This will return the properties
> jc.getEvents() <- This will return the events.
>
> On the Beaninfo tab you add the jars that contain the BeanInfo for
> classes that are in the standard java build path of your project. The
> BeanInfo paths contain the BeanInfo jars, while the build path contains
> the classes.

But this JavaClass is not exactly a BeanInfo... How would I get
BeanDescriptor or an Icon for the component?

>
> JEM provides the capability to run in a remote vm because the VM that is
> running the IDE may be a different VM than what the project is compiling
> against. It also provides safety since things done in the remote vm by
> user code (the code from the project) doesn't run in the same VM as the
> IDE and so it can't cause Eclipse to crash.
>
> Also JEM uses a remote vm to do the introspection.

Does this means that it is safe to work with components that were built
and should be run with jdk 5.0? Is JEM generally compable with jdk 5.0?

>
> Newbie wrote:
>
>> Hi guys,
>>
>> I have a requirements to manage JavaBean components (BeanInfo
>> introspection, prototyping, etc.). Components are not of visual type.
>>
>> As far as I understand JEM have this ability. But as a newbie (no VE
>> experience too) I fail to grasp the main use cases. So here are the
>> bulk of questions that I have. Thanks in advance for everyone who will
>> help:
>>
>> 1. In Java Project properties I can see contributed BeanInfo Path
>> page. So I guess, I can add additional path to jar file that contain
>> JavaBean and jem.beaninfo plugin will be able to introspect JavaBeans
>> from this jar as well as from the current project sources.
>> - Is that correct?
>> - So, why it don't show my simple JavaBeanTest class that I created?
>> - How to 'turn on' introspection in current project programmatically?
>>
>> 2. Let say I have bunch of external jars and I added them to BeanInfo
>> Path page.
>> - How then can I get the BeanInfos?
>> - Is that BeanInfoEntry is what I need to get an actual BeanInfo?
>> - What is a use case of this introspection in terms of JEM api?
>> - In org.eclipse.beaninfo.registrations I fail to understand an
>> override concept. What is it used for?
>>
>> 3. JEM provide an ability to 'run' JavaBeans in remote VM.
>> - What is a main use case here?
>> - Does introspection happening in separate VM too?
>>
>> 4. Does any documentation exists on JEM?
>>
>> -alex.
>
>
Re: [JEM] newbie questions [message #605091 is a reply to message #79402] Tue, 08 February 2005 15:03 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

>>
>> ResourceSet projectRSet = BeaninfoNature.getRuntime(IProject
>> project).getResourceSet();
>
>
> Do I have to enable BeaninfoNature for the project? Or this *is* an
> enablement? What does it do?

Doing getRuntime does two things, one it enables the BeanInfo nature for
the project if not already existing, and two it tells the JEM model to
use BeanInfo for this session of Eclipse. If this wasn't done, then JEM
would just return classes, fields, and methods. It wouldn't do
introspection to get properties, events, and operations.

The enabling of JEM for a session is done because JEM without BeanInfo
is used in non-Eclipse and non-BeanInfo situations and those cases don't
want BeanInfo overhead.

>
>>
>> Then to get the BeanInfo for a class:
>>
>> JavaClass jc =
>> JavaRefFactory.EINSTANCE.reflect("fully-qualified-classname ",
>> projectRSet);
>>
>> jc.getProperties() <- This will return the properties
>> jc.getEvents() <- This will return the events.
>>
>> On the Beaninfo tab you add the jars that contain the BeanInfo for
>> classes that are in the standard java build path of your project. The
>> BeanInfo paths contain the BeanInfo jars, while the build path
>> contains the classes.
>
>
> But this JavaClass is not exactly a BeanInfo... How would I get
> BeanDescriptor or an Icon for the component?
>

Use:

BeanDecorator bd =
org.eclipse.jem.internal.beaninfo.core.Utilities.getBeanDeco rator(javaclass);

to get the bean decorator.

Use:

javaClass.getProperties() to the get properties for the class or
getAllProperties() to get all properties including superclass
properties. Then on each property returned use:

PropertyDecorator pd =
Utilities.getPropertyDecorator(EStructuralFeature);

Ignore for now that these are marked internal. Eventually they will be
renamed to API but we haven't gotton around to it yet.

>>
>> JEM provides the capability to run in a remote vm because the VM that
>> is running the IDE may be a different VM than what the project is
>> compiling against. It also provides safety since things done in the
>> remote vm by user code (the code from the project) doesn't run in the
>> same VM as the IDE and so it can't cause Eclipse to crash.
>>
>> Also JEM uses a remote vm to do the introspection.
>
>
> Does this means that it is safe to work with components that were built
> and should be run with jdk 5.0? Is JEM generally compable with jdk 5.0?

At this time, we don't support 5.0. It may work, it may not. We haven't
done any tests at all. When we step up to Eclipse 3.1, and by the time
Eclipse 3.1 is complete, we will be supporting 5.0.

--
Thanks,
Rich Kulp
Previous Topic:paintComponent ignored ?
Next Topic:inner classes and exceptions
Goto Forum:
  


Current Time: Wed Jul 17 17:18:35 GMT 2024

Powered by FUDForum. Page generated in 0.03422 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top