[
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 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, whats 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, whats NEW about the NEW Yahoo! Messenger?
Find out.
Back to the top