Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] separator




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

07/18/2005 12:45 AM

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





Dear VE Team:

Two questions:

1. Suppressing generation of var and instanciation stmt for a bean:

>>> GM >>>
Off hand, my first approach would be to treat this (in codegen) as a special
property that is set on the toolbar.  CodeGen will treat is as a "special"
property settings on the tool bar, but the decoder helper that is associated
with this new feature will create a Separator instance with the proper
allocation tree.
>>>>>

I created a separate feature on ULCMenu and for ULCSeparator, in codegen
generate, addSepartor() and in decoder create an instance of ULCSeparator.

The code looks as follows:

                private ULCMenu ulcMenu = null;

                private ULCMenu getUlcMenu() {
                                 if (ulcMenu == null) {
                                                  ulcMenu = new ULCMenu();
                                                  ULCSeparator ulcMenuSeparator = new ULCSeparator();
                                                  ulcMenu.addSeparator();
                                 }
                                 return ulcMenu;
                }

The question is:

How do I suppress the generation of ULCSeparator ulcMenuSeparator = new
ULCSeparator();?



If the PreSet commands places the instance of the separator as a *member* (BeanSubClass, or Method), VE will generate an instance (global/local).  The feature that you have created should not override the default, which is to place an instance as a *property*.

My assumption here is that the separators will not have any property set on it.
In general, will be great if the instance of the separator from the addSeparator() have not properties... so it is not promotable.

-------------------------------------

2. import stmt for an inner class:

For ULCToolBar life is bit easy in ULC. I can continue to us
ULCToolBar.add(ULCComponent)  method (instead of the convenience method
addSeparator()) because ULCToolBar$ULCSeparator descends from ULCComponent.
But there is one problem.

The separator for ULCToolBar is an inner public class of ULCToolBar nameley
ULCToolBar$ULCSeparator. The codegen generates an import statement:

    import com.ulcjava.base.application.ULCToolBar.ULCSeparator;

This is a compilation error and perhaps a bug : For inner class shouldn't it
import the outer class?

How do I get it to generate:                 import com.ulcjava.base.application.ULCToolBar?



Every CodeExpressionRef has a freqImports (public List getReqImports()).  The decoder is responsible to update this list as it generates its content (see the ConstructorDecoderHelper.generate() as an example).
When the _expression_ is inserted to the CU, it will also insert the needed imports.


Thanks and regards,

Janak

"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
07/15/2005 02:44 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] separator







Hi,

The separators for toolbar and menu are not supported in Swing VE.

In ULC we have ULCSeparator like JSeparator of swing.

I would like to generate addSeparator() method on tool bar and menu. But at
the same time suppress the generation of new ULCSepartor() _expression_ and
also suppress generation of global or local var and getters.

In general is there a way to suppress generation of instantiation, variables
and getters?

Can I do the following:

In override file for ULCSeparator specify a CodeGenHelperClass that extends
AbstractExpressionDecoder.

The helper for decoder extends from ConstructorDecoderHelper and generates
nothing!

Or is there a better way to do separator?

Thanks,

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