Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] Methods of BeanProxyAdapter


Hi,



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

10/27/2005 06:30 AM

Please respond to
Discussions people developing code for the Visual Editor project

To
"ve-Dev@Eclipse. Org" <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] Methods of BeanProxyAdapter





Hello VE Team,

1. In VE 1.0 we used to override the following methods of BeanProxyAdapter:

applied, cancelled, primInstantiateBeanProxy

Will overriding the same methods from BeanProxyAdapter of VE 1.1 have the
same effect?

--- RLK It depends on what you want to do. Check the javadoc on the methods.
They give explanations of what the methods should do and whether for overridding
you should override a different method. Also, many of your classes are similiar
to the standard JFC classes we provide. Check those proxy adapters that correspond
closely to your type to see what they do.

If not which methods should be used in their place?

2. In VE 1.0 after using primInstantiateBeanProxy, getBeanProxy() returned
the newly instantiated proxy. Does this still hold?


--- RLK Again you do not have a bean proxy UNTIL the _expression_ has been invoked. That
is at a later time. That is why any methods that are passed in an IExpression should
use ExpressionProxies. Look at examples of primInstantiateBeanProxy in other proxy adapters.

3. What is the difference between primInstatiateDroppedPart and
primInstantiateThisPart? Should we be overriding these methods instead of
primInstantiateBeanProxy?


--- RLK The difference is that primInstantiateDroppedPart is for all parts that
are not the THIS part. The thispart is the one that is being subclassed in the
current editor session. You may need to do something different if it was a
dropped part instead of a this part.

4. In VE 1.1.0.1 SDK, I am seeing a strange behavior,. When I drop JLabel on
the canvas, I see a black rectangle i.e. background, although 204,204,204 in
property sheet, is black on the canvas. Explicitly settin the background
color in property sheet is not reflected on the canvas.


--- RLK I don't the answer to this one.

5. In ComponentProxyAdapter.postInstantiateStuff, VE sets the newly created
beanProxy on componentManager and then adds to freeForm

In the case of ULC VE, I do the following:

                                                  // Get the method proxy to obtain Swing object underlying a ULCWidget

                                                  IProxyMethod getVisualProxyMethod = TargetVmHelper
                                                                                    .getEnvironmentTypeProxy(getBeanProxyDomain())
                                                                                    .getMethodProxy(
                                                                                                                      _expression_,
                                                                                                                      "getVisualComponent",
                                                                                                                      new String[] { "com.ulcjava.base.application.ULCComponent" });

                                                  // Obtain the proxy for Swing object underlying the ULCWidget

                                                  ExpressionProxy visProxy = _expression_.createSimpleMethodInvoke(
                                                                                    getVisualProxyMethod, TargetVmHelper
                                                                                                                      .getEnvironmentTypeProxy(getBeanProxyDomain()),
                                                                                    new IProxy[] { newbean }, true);

                                                  // Set the swing object proxy on component manager

                                                  getComponentManager().setComponentBeanProxy(visProxy, _expression_,
                                                                                    getModelChangeController());

                                 // Get the method proxy for add to FreeForm dialog on VM

                                 IProxyMethod addMethod =
TargetVmHelper.getEnvironmentTypeProxy(getBeanProxyDomain()).getMethodProxy(
_expression_, "addToFreeForm",
                                                                   new String[] {"com.ulcjava.base.application.ULCComponent"} );

                                 // Add the object to free form

                                 _expression_.createSimpleMethodInvoke(addMethod,
                                                                   TargetVmHelper.getEnvironmentTypeProxy(getBeanProxyDomain()),
                                                                   new IProxy[] {newbean}, false);


As you can see, I am calling createSimpleMethodInvoke twice on the same
_expression_. Is this ok?

--- RLK No problem at all. Expressions are meant to have as many method calls queued up as needed. They
will eventually be executed in the order you added them to the _expression_.


Thanks and regards,

Janak

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


Back to the top