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?




------------
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 12:56 PM

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

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
RE: [ve-dev] Are factory methods supported by Visual Editor?





 
-------------
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;
}
 
>  The ConstructorDecoderHelper will generate what ever the javaInstance.getAllocation() is.  it is up to the commands to set the proper ParseTree
 
-----------------
 
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));

>  ha... A different decoder is used here..  I beleive that at this time, it will only deal with a new FooBar()...
> This is support we need to add (please open a defect)... for now you will have to create your own decoder.
 

------------
 
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();

> This is a method invocation... which is on the queue for us to support :-(

Is it possible to generate this kind of code?

> Not in a "nice" way. ... the ugly harcoded way could be (and I am embarrased to say this out loud :-(
> is to fluff up a addSeperator feature, and create the propert decoder/proxy for it.
 
-----------
 
4. In general how does one:
 
1. Customize code gen for a bean instantiation
> The only support is via the Constructor, and the GLOBAL/LOCAL mechanism.

2. Suppress generation of instance / local var for a bean
> We are working now on implicit beans (like a ContentPane for a JFrame).... but it will go into 1.2

 
-----------
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

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


Back to the top