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,

(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


Back to the top