Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] Facing problems in working with the custom widgets


Hi,

To the VE, myCustomWidget.addElement(...) isn't a property on myCustomWidget, so it ignores those statements when it parses the code. So it won't add anything. A property is of the form getSomething()/setSomething(Something).

But, we also don't parse Vectors, so even if you had done myCustomWidget.getElements().addElement(...) we would ignore it.

Sorry about this,

Rich



shobana ramaswamy <shobanaramaswamy@xxxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

07/14/2006 07:16 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] Facing problems in working with the custom widgets





Hi Rich,
 
Thanks for the reply.
 
I have extracted the ComponentGraphicalEditPart from the ScrollingGraphicalViewer of the current EditDomain for my custom widget.
 
The following is the code that I am trying to use
 
Note: variable componentGraphicalEditPart editpart for MyCustomWidget.
 
//Code Starts here
 
JavaObjectInstance javaObjectInstance = (JavaObjectInstance) componentGraphicalEditPart.getModel();
 
IBeanProxy customWidgetBeanproxy = BeanProxyUtilities.getBeanProxy((JavaObjectInstance) javaObjectInstance);
 
try {
 
IMethodProxy methodProxy = customWidgetBeanproxy.getTypeProxy().getMethodProxy("getElements");
 
IBeanProxy elementsBeanProxy = methodProxy.invoke(customWidgetBeanproxy);
 
CollectionBeanProxyWrapper elementsWrapper = new CollectionBeanProxyWrapper(elementsBeanProxy);
 
IteratorBeanProxyWrapper elementsItr = elementsWrapper.iterator();
 
IStringBeanProxy elementProxy;
 
Vector elements = new Vector(elementsWrapper.size());
 
while (elementsItr.hasNext())
{
 
elementProxy = (IStringBeanProxy) elementsItr.next();
 
elements.add(elementProxy.stringValue());
}
}
catch (ThrowableProxy e)
{
e.printStackTrace();
}
 
Thanks,
Shobana.R


Rich Kulp <richkulp@xxxxxxxxxx>
wrote:


Hi,


How are you invoking the addElement() exactly through the beanproxy?


Are there any errors in the .log file?


When you invoke it the second time, does add the first one again so that there are two?


Thanks,

Rich


shobana ramaswamy <shobanaramaswamy@xxxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

07/13/2006 06:48 AM
Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>

To
ve-dev@xxxxxxxxxxx
cc
Subject
[ve-dev] Facing problems in working with the custom widgets







Hi All,
 
I am facing some problems with the implementation of custom widgets for my application. I have a custom widget that has a property of type Vector (Holding a set of values). I use the CustomWidget as follows,
 
public void mycustomWidget()
{
   if(mycustomwidget1==null)
   {
      myCustomwidget1 = new MyCustomWidget();
      ……….
      myCustomwidget1.addElement("aaa");
      myCustomwidget1.addElement("bbb");
   }
   return myCustomwidget1;
}
 
The addElement() method in the MyCustomWidget class is as follows
 
public void addElement(String element)
{
  if(!(element.equals("")))
  {
    elements.add(element);
  }
}
 
public Vector getElements()
{
return elements;
}
 
For one of my wizard, I have to extract the editpart for the custom widget and using bean proxy get the elements added to that custom widget.
But when I invoke the addElement ()’ method through the beanproxy, I get only the first element added. Only the first call to addElement is recognized.
Can any body please help me resolve this? I need to get all the elements added.
 
Please help me in this regard.
Thanks in advance.
 
Regards,
Shobana.R


Find out what India is talking about on Yahoo! Answers India.
So, what’s NEW about the NEW Yahoo! Messenger?
Find out._______________________________________________
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

 


Find out what India is talking about on Yahoo! Answers India.
So, what’s NEW about the NEW Yahoo! Messenger?
Find out._______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top