Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Are factory methods supported by Visual Editor?

Hi Gili,
 
Thanks!
 
-------------
1. So this means that, when I drop a ULCLabel from the palette on the canvas, there is no way to generate:
 
private ULCLabel ulcLabel = null;  // declaration for global
 
 
ULCLabel getUlcLabel() {
    if (ulcLabel == null) {
      ulcLabel = ComponentFactory.createLabel();
    }
    return ulcLabel;
}
 
 
-----------------
 
2. Moreover, we have a class ULCFiller. When a filler dropped from the palette into a container say ULCBoxPane on canvas, I would like to generate
 
       box.add(ULCFiller.createHorizontalStrut(150));
 
Note that there is no local or global var for filler and also no new ULCFiller stmt - it just uses a static method with an argument.
 
Is it possible to generate this kind of code?
 
------------
 
3. Then there is Separator.
 
When I drop a separator from palette on a Menu or ToolBar on the canvas, I would like to generate:
 
    menu.addSeparator();
 
Again note that there is no local or global var for Separator and no new ULCSeparator() stmt.
 
Is it possible to generate this kind of code?
 
-----------
 
4. In general how does one:
 
1. Customize code gen for a bean instantiation
2. Suppress generation of instance / local var for a bean
 
-----------
Thanks and regards,
 
Janak
-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On Behalf Of Dr Gili Mendel
Sent: Tuesday, September 20, 2005 1:46 PM
To: Discussions people developing code for the Visual Editor project
Subject: Re: [ve-dev] Are factory methods supported by Visual Editor?


At this time VE will only deal with a static assignments, e.g.,  ULCLabel l = ComponentFactory.createLabel(), where createLabel() is a static method.  This is since the Parse Tree can be evaluated, as is, on the target VM.

We plan to add generic method invocation with https://bugs.eclipse.org/bugs/show_bug.cgi?id=49432


------------
Dr. Gili Mendel
IBM
Software Development
RTP Raleigh, NC
(919)543 6408, tie: 441 6408



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

09/20/2005 08:14 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] Are factory methods supported by Visual Editor?





Hello,

Is it possible to specify factory methods instead of
constructors for the code generation part of VE?

I.e. what I want to get generated is the following:
   ComponentFactory.createLabel()
instead of
   new ULCLabel()

Thanks and regards,

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


Back to the top