Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Preventing setting of bean property on target VM


Hi,

I meant don't even have it as a "hidden" property in the beaninfo. Don't return it at all. The reason is that even "hidden" properties can be set if they are found in the code itself. "hidden" just means that it won't show up on the property sheet, but it is still a property that gets modeled. If it is not modeled then we won't see and we will never call it.

However, you may want to still have it with the isDesignTime() because if you now use this bean (bean1) in another bean (bean2), and somewhere within the initialize() method of bean1 the datatype is set, then it will be set. This is because we don't do any interpretation of used beans. We simply instantiate them. Since that means their code will run, the setdatatype will be called on bean1 within its own code.

Rich


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

06/07/2006 10:18 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] Preventing setting of bean property on target VM





Hi Rich,
 
Thanks.
 
By removing the property you mean hiding it in the BeanInfo? Will hiding it help?
 
Actually I tried both:
 
1. hiding "dataType" property in BeanInfo and
2. Using the !Beans.isDesignTime() conditional.
 
It seems that in VE 1.1 the call setDataType is still slipping through. Cleaning the cache (by clean build and open/close project) did not help (or may be it did not happen properly).
 
Moreover, in earlier VE versions with IvjBeanInfo there were methods to suppress parent's properties. How does one do it now?
 
Thanks and regards,
 
Janak
-----Original Message-----
From:
ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On Behalf Of Rich Kulp
Sent:
Wednesday, June 07, 2006 7:28 PM
To:
Discussions people developing code for the Visual Editor project
Subject:
Re: [ve-dev] Preventing setting of bean property on target VM


Hi,


(2) is the best because there is no way to prevent a method from being executed in all cases. Something could slip through.


The only way is to not have data type be a property. Remove it from the BeanInfo and it won't be a settable property and it won't see it as a property when parsing the code.


Rich


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

06/06/2006 06:50 PM

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] Preventing setting of bean property on target VM







Hi,

Is there a way to prevent a property from being set on a bean in the target
VM?

Example:

In ULC, we have textfield. Now if a datatype is set with setDataType() on
textfield, then, by design, set/getText() throw UnsupportedMethod exception.

dataType is not a design time property as it does not affect layout.

I can think of two ways to prevent setDataType from being executed on the
bean in target VM

1. In VE, in the proxy - ULCTextFieldProxyAdapter - intercept the property
in the applied() method and do nothing.

Or

2. In generated code for ULCTextFiled  manually insert a conditional:

               if (!Beans.isDesignTime()) {
                                ulcTextField.setDataType(...);
               }

Is there another or better way?

Thanks and regards,

Janak

_______________________________________________
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