Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » create a bunch of Button once?
create a bunch of Button once? [message #142355] Fri, 26 October 2007 07:18 Go to next message
Eclipse UserFriend
Originally posted by: caye5200.yahoo.com.cn

hello,

Can i create ButtonArrayGroup bean that is a visual JavaBean?

You drop down the ButtonArrayGroup can create a bunch of Button?
Re: create a bunch of Button once? [message #142555 is a reply to message #142355] Wed, 31 October 2007 21:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.ddress.here

In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
says...
> hello,
>
> Can i create ButtonArrayGroup bean that is a visual JavaBean?
>
> You drop down the ButtonArrayGroup can create a bunch of Button?
>
>

Creating a bean to encapsulate a bunch of buttons is doable, but the
internals will not be modifiable using VE without significant additional
work. Hardly worth the effort if the goal is just to use a different
code styling.

Just accept that no visual designer writes good, concise code; they
write good machine serviceable code. Attempts to get VE to understand
clever code styles are a form of premature optimization.

Best advice is to use VE to create delegate view classes, Composite,
Group, JPanel, etc., try not to look at or modify the generated code,
and certainly don't put logic or event handlers directly in the view
classes. That way, a VE constructed view class containing, say a bunch
of buttons, is effectively a reusable, modifiable VE visual component.
Re: create a bunch of Button once? [message #142562 is a reply to message #142555] Thu, 01 November 2007 01:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: caye5200.yahoo.com.cn

Gbr,
Thank you, i want do that when you drop down the JRadioButtonGroup,VE
can generate
the following code,i have way to change code , but VE not support,
what to do i need also?
private JRadioButton[] jRBArray=null;
private void initialize() {
this.add(getJRadioButtonGroup(), null);
}
  public JRadioButton[] getJRadioButtonGroup(){
if(jRBArray==null)
{
jRBArray=new JRadioButton[2];
jRBArray[0]== new JRadioButton();
jRBArray[0]=.setBounds(new Rectangle(264, 118, 21, 21));
jRBArray[1]== new JRadioButton();
jRBArray[1]=.setBounds(new Rectangle(264, 168, 21, 21));
}
return jRBArray;
}
My Container extends Container and add following method ,look :
public void add(Component[] arg ,Object arg1)
{
for(int i=0;i<arg.length;i++)
{
this.add(arg[i], arg1);
}
}
VE why not support it?

"Gbr" <no@ddress.here> wrote in message
news:MPG.219290b8446899da98968c@news.eclipse.org...
> In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
> says...
>> hello,
>>
>> Can i create ButtonArrayGroup bean that is a visual JavaBean?
>>
>> You drop down the ButtonArrayGroup can create a bunch of Button?
>>
>>
>
> Creating a bean to encapsulate a bunch of buttons is doable, but the
> internals will not be modifiable using VE without significant additional
> work. Hardly worth the effort if the goal is just to use a different
> code styling.
>
> Just accept that no visual designer writes good, concise code; they
> write good machine serviceable code. Attempts to get VE to understand
> clever code styles are a form of premature optimization.
>
> Best advice is to use VE to create delegate view classes, Composite,
> Group, JPanel, etc., try not to look at or modify the generated code,
> and certainly don't put logic or event handlers directly in the view
> classes. That way, a VE constructed view class containing, say a bunch
> of buttons, is effectively a reusable, modifiable VE visual component.
>
Re: create a bunch of Button once? [message #142665 is a reply to message #142562] Fri, 02 November 2007 00:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.ddress.here

If, as a user, you want VE to generate or use code in the style you
show, the answer is: no. Why? The code parser internal to VE has no way
to understand your coding style. The parser does not and cannot read
and write arbitrary/clever coding styles. It has its own machine
serviceable coding style. If your code style is not reasonably similar
to the parser's own (which is entirely determined by VE's parser), the
parser will simply stall out, which is likely what you are already
seeing.

If, as a component developer, you wish to create a new component
(JRadioButtonGroup) that is coded in your particular style, you will
need to create the helper routines that will enable the VE code parser
to read and adjust the source code AST. This is completely supported in
VE, just not well documented. Best to go and read the archived messages
on the VE-DEV list where you can read the questions and answers of
others in the process of creating new components.

A thread that may be helpful is here:
http://dev.eclipse.org/mhonarc/lists/ve-dev/msg00036.html


In article <fgb9gc$i6a$1@build.eclipse.org>, caye5200@yahoo.com.cn
says...
> Gbr,
> Thank you, i want do that when you drop down the JRadioButtonGroup,VE
> can generate
> the following code,i have way to change code , but VE not support,
> what to do i need also?
> private JRadioButton[] jRBArray=null;
> private void initialize() {
> this.add(getJRadioButtonGroup(), null);
> }
>   public JRadioButton[] getJRadioButtonGroup(){
> if(jRBArray==null)
> {
> jRBArray=new JRadioButton[2];
> jRBArray[0]== new JRadioButton();
> jRBArray[0]=.setBounds(new Rectangle(264, 118, 21, 21));
> jRBArray[1]== new JRadioButton();
> jRBArray[1]=.setBounds(new Rectangle(264, 168, 21, 21));
> }
> return jRBArray;
> }
> My Container extends Container and add following method ,look :
> public void add(Component[] arg ,Object arg1)
> {
> for(int i=0;i<arg.length;i++)
> {
> this.add(arg[i], arg1);
> }
> }
> VE why not support it?
>
> "Gbr" <no@ddress.here> wrote in message
> news:MPG.219290b8446899da98968c@news.eclipse.org...
> > In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
> > says...
> >> hello,
> >>
> >> Can i create ButtonArrayGroup bean that is a visual JavaBean?
> >>
> >> You drop down the ButtonArrayGroup can create a bunch of Button?
> >>
> >>
> >
> > Creating a bean to encapsulate a bunch of buttons is doable, but the
> > internals will not be modifiable using VE without significant additional
> > work. Hardly worth the effort if the goal is just to use a different
> > code styling.
> >
> > Just accept that no visual designer writes good, concise code; they
> > write good machine serviceable code. Attempts to get VE to understand
> > clever code styles are a form of premature optimization.
Re: create a bunch of Button once? [message #142673 is a reply to message #142665] Fri, 02 November 2007 00:57 Go to previous message
Eclipse UserFriend
Originally posted by: caye5200.yahoo.com.cn

Gbr,
thank you, I as a component developer, iwant develope a commponentGroup.

"Gbr" <no@ddress.here> wrote in message
news:MPG.21940a5f19e8455398968d@news.eclipse.org...
If, as a user, you want VE to generate or use code in the style you
show, the answer is: no. Why? The code parser internal to VE has no way
to understand your coding style. The parser does not and cannot read
and write arbitrary/clever coding styles. It has its own machine
serviceable coding style. If your code style is not reasonably similar
to the parser's own (which is entirely determined by VE's parser), the
parser will simply stall out, which is likely what you are already
seeing.

If, as a component developer, you wish to create a new component
(JRadioButtonGroup) that is coded in your particular style, you will
need to create the helper routines that will enable the VE code parser
to read and adjust the source code AST. This is completely supported in
VE, just not well documented. Best to go and read the archived messages
on the VE-DEV list where you can read the questions and answers of
others in the process of creating new components.

A thread that may be helpful is here:
http://dev.eclipse.org/mhonarc/lists/ve-dev/msg00036.html


In article <fgb9gc$i6a$1@build.eclipse.org>, caye5200@yahoo.com.cn
says...
> Gbr,
> Thank you, i want do that when you drop down the
> JRadioButtonGroup,VE
> can generate
> the following code,i have way to change code , but VE not support,
> what to do i need also?
> private JRadioButton[] jRBArray=null;
> private void initialize() {
> this.add(getJRadioButtonGroup(), null);
> }
>   public JRadioButton[] getJRadioButtonGroup(){
> if(jRBArray==null)
> {
> jRBArray=new JRadioButton[2];
> jRBArray[0]== new JRadioButton();
> jRBArray[0]=.setBounds(new Rectangle(264, 118, 21, 21));
> jRBArray[1]== new JRadioButton();
> jRBArray[1]=.setBounds(new Rectangle(264, 168, 21, 21));
> }
> return jRBArray;
> }
> My Container extends Container and add following method ,look :
> public void add(Component[] arg ,Object arg1)
> {
> for(int i=0;i<arg.length;i++)
> {
> this.add(arg[i], arg1);
> }
> }
> VE why not support it?
>
> "Gbr" <no@ddress.here> wrote in message
> news:MPG.219290b8446899da98968c@news.eclipse.org...
> > In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
> > says...
> >> hello,
> >>
> >> Can i create ButtonArrayGroup bean that is a visual JavaBean?
> >>
> >> You drop down the ButtonArrayGroup can create a bunch of Button?
> >>
> >>
> >
> > Creating a bean to encapsulate a bunch of buttons is doable, but the
> > internals will not be modifiable using VE without significant additional
> > work. Hardly worth the effort if the goal is just to use a different
> > code styling.
> >
> > Just accept that no visual designer writes good, concise code; they
> > write good machine serviceable code. Attempts to get VE to understand
> > clever code styles are a form of premature optimization.
Re: create a bunch of Button once? [message #616828 is a reply to message #142355] Wed, 31 October 2007 21:17 Go to previous message
Eclipse UserFriend
Originally posted by: no.ddress.here

In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
says...
> hello,
>
> Can i create ButtonArrayGroup bean that is a visual JavaBean?
>
> You drop down the ButtonArrayGroup can create a bunch of Button?
>
>

Creating a bean to encapsulate a bunch of buttons is doable, but the
internals will not be modifiable using VE without significant additional
work. Hardly worth the effort if the goal is just to use a different
code styling.

Just accept that no visual designer writes good, concise code; they
write good machine serviceable code. Attempts to get VE to understand
clever code styles are a form of premature optimization.

Best advice is to use VE to create delegate view classes, Composite,
Group, JPanel, etc., try not to look at or modify the generated code,
and certainly don't put logic or event handlers directly in the view
classes. That way, a VE constructed view class containing, say a bunch
of buttons, is effectively a reusable, modifiable VE visual component.
Re: create a bunch of Button once? [message #616829 is a reply to message #142555] Thu, 01 November 2007 01:17 Go to previous message
Eclipse UserFriend
Originally posted by: caye5200.yahoo.com.cn

Gbr,
Thank you, i want do that when you drop down the JRadioButtonGroup,VE
can generate
the following code,i have way to change code , but VE not support,
what to do i need also?
private JRadioButton[] jRBArray=null;
private void initialize() {
this.add(getJRadioButtonGroup(), null);
}
  public JRadioButton[] getJRadioButtonGroup(){
if(jRBArray==null)
{
jRBArray=new JRadioButton[2];
jRBArray[0]== new JRadioButton();
jRBArray[0]=.setBounds(new Rectangle(264, 118, 21, 21));
jRBArray[1]== new JRadioButton();
jRBArray[1]=.setBounds(new Rectangle(264, 168, 21, 21));
}
return jRBArray;
}
My Container extends Container and add following method ,look :
public void add(Component[] arg ,Object arg1)
{
for(int i=0;i<arg.length;i++)
{
this.add(arg[i], arg1);
}
}
VE why not support it?

"Gbr" <no@ddress.here> wrote in message
news:MPG.219290b8446899da98968c@news.eclipse.org...
> In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
> says...
>> hello,
>>
>> Can i create ButtonArrayGroup bean that is a visual JavaBean?
>>
>> You drop down the ButtonArrayGroup can create a bunch of Button?
>>
>>
>
> Creating a bean to encapsulate a bunch of buttons is doable, but the
> internals will not be modifiable using VE without significant additional
> work. Hardly worth the effort if the goal is just to use a different
> code styling.
>
> Just accept that no visual designer writes good, concise code; they
> write good machine serviceable code. Attempts to get VE to understand
> clever code styles are a form of premature optimization.
>
> Best advice is to use VE to create delegate view classes, Composite,
> Group, JPanel, etc., try not to look at or modify the generated code,
> and certainly don't put logic or event handlers directly in the view
> classes. That way, a VE constructed view class containing, say a bunch
> of buttons, is effectively a reusable, modifiable VE visual component.
>
Re: create a bunch of Button once? [message #616840 is a reply to message #142562] Fri, 02 November 2007 00:08 Go to previous message
Eclipse UserFriend
Originally posted by: no.ddress.here

If, as a user, you want VE to generate or use code in the style you
show, the answer is: no. Why? The code parser internal to VE has no way
to understand your coding style. The parser does not and cannot read
and write arbitrary/clever coding styles. It has its own machine
serviceable coding style. If your code style is not reasonably similar
to the parser's own (which is entirely determined by VE's parser), the
parser will simply stall out, which is likely what you are already
seeing.

If, as a component developer, you wish to create a new component
(JRadioButtonGroup) that is coded in your particular style, you will
need to create the helper routines that will enable the VE code parser
to read and adjust the source code AST. This is completely supported in
VE, just not well documented. Best to go and read the archived messages
on the VE-DEV list where you can read the questions and answers of
others in the process of creating new components.

A thread that may be helpful is here:
http://dev.eclipse.org/mhonarc/lists/ve-dev/msg00036.html


In article <fgb9gc$i6a$1@build.eclipse.org>, caye5200@yahoo.com.cn
says...
> Gbr,
> Thank you, i want do that when you drop down the JRadioButtonGroup,VE
> can generate
> the following code,i have way to change code , but VE not support,
> what to do i need also?
> private JRadioButton[] jRBArray=null;
> private void initialize() {
> this.add(getJRadioButtonGroup(), null);
> }
>   public JRadioButton[] getJRadioButtonGroup(){
> if(jRBArray==null)
> {
> jRBArray=new JRadioButton[2];
> jRBArray[0]== new JRadioButton();
> jRBArray[0]=.setBounds(new Rectangle(264, 118, 21, 21));
> jRBArray[1]== new JRadioButton();
> jRBArray[1]=.setBounds(new Rectangle(264, 168, 21, 21));
> }
> return jRBArray;
> }
> My Container extends Container and add following method ,look :
> public void add(Component[] arg ,Object arg1)
> {
> for(int i=0;i<arg.length;i++)
> {
> this.add(arg[i], arg1);
> }
> }
> VE why not support it?
>
> "Gbr" <no@ddress.here> wrote in message
> news:MPG.219290b8446899da98968c@news.eclipse.org...
> > In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
> > says...
> >> hello,
> >>
> >> Can i create ButtonArrayGroup bean that is a visual JavaBean?
> >>
> >> You drop down the ButtonArrayGroup can create a bunch of Button?
> >>
> >>
> >
> > Creating a bean to encapsulate a bunch of buttons is doable, but the
> > internals will not be modifiable using VE without significant additional
> > work. Hardly worth the effort if the goal is just to use a different
> > code styling.
> >
> > Just accept that no visual designer writes good, concise code; they
> > write good machine serviceable code. Attempts to get VE to understand
> > clever code styles are a form of premature optimization.
Re: create a bunch of Button once? [message #616841 is a reply to message #142665] Fri, 02 November 2007 00:57 Go to previous message
Eclipse UserFriend
Originally posted by: caye5200.yahoo.com.cn

Gbr,
thank you, I as a component developer, iwant develope a commponentGroup.

"Gbr" <no@ddress.here> wrote in message
news:MPG.21940a5f19e8455398968d@news.eclipse.org...
If, as a user, you want VE to generate or use code in the style you
show, the answer is: no. Why? The code parser internal to VE has no way
to understand your coding style. The parser does not and cannot read
and write arbitrary/clever coding styles. It has its own machine
serviceable coding style. If your code style is not reasonably similar
to the parser's own (which is entirely determined by VE's parser), the
parser will simply stall out, which is likely what you are already
seeing.

If, as a component developer, you wish to create a new component
(JRadioButtonGroup) that is coded in your particular style, you will
need to create the helper routines that will enable the VE code parser
to read and adjust the source code AST. This is completely supported in
VE, just not well documented. Best to go and read the archived messages
on the VE-DEV list where you can read the questions and answers of
others in the process of creating new components.

A thread that may be helpful is here:
http://dev.eclipse.org/mhonarc/lists/ve-dev/msg00036.html


In article <fgb9gc$i6a$1@build.eclipse.org>, caye5200@yahoo.com.cn
says...
> Gbr,
> Thank you, i want do that when you drop down the
> JRadioButtonGroup,VE
> can generate
> the following code,i have way to change code , but VE not support,
> what to do i need also?
> private JRadioButton[] jRBArray=null;
> private void initialize() {
> this.add(getJRadioButtonGroup(), null);
> }
>   public JRadioButton[] getJRadioButtonGroup(){
> if(jRBArray==null)
> {
> jRBArray=new JRadioButton[2];
> jRBArray[0]== new JRadioButton();
> jRBArray[0]=.setBounds(new Rectangle(264, 118, 21, 21));
> jRBArray[1]== new JRadioButton();
> jRBArray[1]=.setBounds(new Rectangle(264, 168, 21, 21));
> }
> return jRBArray;
> }
> My Container extends Container and add following method ,look :
> public void add(Component[] arg ,Object arg1)
> {
> for(int i=0;i<arg.length;i++)
> {
> this.add(arg[i], arg1);
> }
> }
> VE why not support it?
>
> "Gbr" <no@ddress.here> wrote in message
> news:MPG.219290b8446899da98968c@news.eclipse.org...
> > In article <ffs4bc$q1e$1@build.eclipse.org>, caye5200@yahoo.com.cn
> > says...
> >> hello,
> >>
> >> Can i create ButtonArrayGroup bean that is a visual JavaBean?
> >>
> >> You drop down the ButtonArrayGroup can create a bunch of Button?
> >>
> >>
> >
> > Creating a bean to encapsulate a bunch of buttons is doable, but the
> > internals will not be modifiable using VE without significant additional
> > work. Hardly worth the effort if the goal is just to use a different
> > code styling.
> >
> > Just accept that no visual designer writes good, concise code; they
> > write good machine serviceable code. Attempts to get VE to understand
> > clever code styles are a form of premature optimization.
Previous Topic:recommended GUI builder
Next Topic:annotates="//@members.14",how can get?
Goto Forum:
  


Current Time: Thu Apr 25 11:37:37 GMT 2024

Powered by FUDForum. Page generated in 0.04097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top