Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Property check
Property check [message #104212] Mon, 29 August 2005 17:23 Go to next message
Eclipse UserFriend
Originally posted by: lgodl.2die4.com

Hi, I have a bean I created which throw an exception when “foo” (a
property of the Bean) does not respect the requirements so VE show the
exclamation mark over my component.

I also have a property named “bar” that should throw an exception when the
requirements are not meant. The thing is that the requirements of the
“bar” property needs to know what are others components of the same type
in the java application. I did this using a “static” variable shared
between every components of the type. So when I use VE to create an
application which use my component I add the first one, set its
properties, add the second one which recognize that there is already a
component of the type in the application. My problem is that if I delete
the first component every other component (already existing ones and new
ones) believe the first component is still in the application since no
code of my bean is being executed when the component is removed. Is there
a way to notify the other components that it is no longer present? Or is
there any method of my javabean that could be called when a component is
deleted from the application in VE?

Thanks
Re: Property check [message #105309 is a reply to message #104212] Tue, 06 September 2005 15:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lgodl.2die4.com

Any idea?

Thanks
Re: Property check [message #105698 is a reply to message #104212] Thu, 08 September 2005 13:15 Go to previous message
Joe Winchester is currently offline Joe WinchesterFriend
Messages: 496
Registered: July 2009
Senior Member
Hi Johnny,

> Hi, I have a bean I created which throw an exception when ?foo? (a
> property of the Bean) does not respect the requirements so VE show the
> exclamation mark over my component.
> I also have a property named ?bar? that should throw an exception when
> the requirements are not meant. The thing is that the requirements of
> the ?bar? property needs to know what are others components of the same
> type in the java application.

Interesting problem. I think the easiest way would be if you did the
notification and listening intra your own JavaBeans. For example, when
you determine that the "bar" property is valid or invalid make yourself
a property change listener of the beans you queried, and then whenever
their values change you just re-query. The problem we have is that
right now I don't think there is a way when you realize that the
property is invalid you can signal to the VE that it has become invalid.
We only check the validity status by looking for thrown exceptions
when the set method is called from the VE to the JavaBean. What we
should do is provide a generic way for an ad-hoc JavaBean to signal a
bad property.

There is a mechanism for Vetoeable changes where when a property is set
the "bar" JavaBean could reject the change but I don't recall exactly
how it works. We don't currently do anything with this in the VE but it
might be that this would be the way, where the method call that changes
the JavaBean that signals the change that gets vetoed by the "bar"
JavaBean would be the one that gets signalled in error.

A twist on the above would be that if in the "bar" JavaBean when you
recompute that something is bad if you signal an exception, then as long
as it is on the same thread as the method that has just been changed
that is wrong then this will signal a change in the VE, although it
won't be on the "bar" JavaBean - it will be on whatever change cause
"bar" to go bad, although this might actually be the desired effect.

There is a way to install custom BeanProxyAdapters for your JavaBean and
its related ones to do what you want but to start with I think we should
try to find a way that avoids this.

Could you take a look at the vetoeable property change stuff in the spec
and also think about how you'd like to signal the bad "bar" property and
let us know what API you'd like to see and then we should be able to
open a bugzilla and hopefully get a good change implemented.

Best regards and many thanks,

Joe
Re: Property check [message #610667 is a reply to message #104212] Tue, 06 September 2005 15:10 Go to previous message
Eclipse UserFriend
Originally posted by: lgodl.2die4.com

Any idea?

Thanks
Re: Property check [message #610700 is a reply to message #104212] Thu, 08 September 2005 13:15 Go to previous message
Joe Winchester is currently offline Joe WinchesterFriend
Messages: 496
Registered: July 2009
Senior Member
Hi Johnny,

> Hi, I have a bean I created which throw an exception when ?foo? (a
> property of the Bean) does not respect the requirements so VE show the
> exclamation mark over my component.
> I also have a property named ?bar? that should throw an exception when
> the requirements are not meant. The thing is that the requirements of
> the ?bar? property needs to know what are others components of the same
> type in the java application.

Interesting problem. I think the easiest way would be if you did the
notification and listening intra your own JavaBeans. For example, when
you determine that the "bar" property is valid or invalid make yourself
a property change listener of the beans you queried, and then whenever
their values change you just re-query. The problem we have is that
right now I don't think there is a way when you realize that the
property is invalid you can signal to the VE that it has become invalid.
We only check the validity status by looking for thrown exceptions
when the set method is called from the VE to the JavaBean. What we
should do is provide a generic way for an ad-hoc JavaBean to signal a
bad property.

There is a mechanism for Vetoeable changes where when a property is set
the "bar" JavaBean could reject the change but I don't recall exactly
how it works. We don't currently do anything with this in the VE but it
might be that this would be the way, where the method call that changes
the JavaBean that signals the change that gets vetoed by the "bar"
JavaBean would be the one that gets signalled in error.

A twist on the above would be that if in the "bar" JavaBean when you
recompute that something is bad if you signal an exception, then as long
as it is on the same thread as the method that has just been changed
that is wrong then this will signal a change in the VE, although it
won't be on the "bar" JavaBean - it will be on whatever change cause
"bar" to go bad, although this might actually be the desired effect.

There is a way to install custom BeanProxyAdapters for your JavaBean and
its related ones to do what you want but to start with I think we should
try to find a way that avoids this.

Could you take a look at the vetoeable property change stuff in the spec
and also think about how you'd like to signal the bad "bar" property and
let us know what API you'd like to see and then we should be able to
open a bugzilla and hopefully get a good change implemented.

Best regards and many thanks,

Joe
Previous Topic:stop parsing a method
Next Topic:Eclipse Visual Editor 1.1.0.1 Maintenance Release Ships Today
Goto Forum:
  


Current Time: Tue Apr 16 08:09:58 GMT 2024

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

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

Back to the top