Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Spinner default
Spinner default [message #121273] Sat, 01 April 2006 16:23 Go to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

I using Eclipse 3.2M5a with VE 1.2M2. I want to set the swing number
spinner default to 300 when it displays initially. I know how to hardcode
it. However, I want to set the default in the number spinner's VE
properties. How do I do it in VE?
Re: Spinner default [message #121637 is a reply to message #121273] Fri, 07 April 2006 14:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

Are there any Spinner bean properties that set the default to some number
other than zer when using VE?
Re: Spinner default [message #121649 is a reply to message #121273] Fri, 07 April 2006 14:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

How do you do it through code?

Richard wrote:
> I using Eclipse 3.2M5a with VE 1.2M2. I want to set the swing number
> spinner default to 300 when it displays initially. I know how to
> hardcode it. However, I want to set the default in the number spinner's
> VE properties. How do I do it in VE?
>

--
Thanks,
Rich Kulp
Re: Spinner default [message #121660 is a reply to message #121649] Fri, 07 April 2006 15:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

private JSpinner getJSpinner() {
if (jSpinner == null) {
jSpinner = new JSpinner();
jSpinner.setBounds(new Rectangle(40, 17, 54, 20));
jSpinner.setValue(300); <--- My code
}
return jSpinner;
}
Re: Spinner default [message #121671 is a reply to message #121660] Fri, 07 April 2006 16:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The problem is that setValue takes a java.lang.Object and so it can take
anything. This is because JSpinner uses a model, and a model takes
java.lang.Objects. The problem is that the default model for a JSpinner
takes Integers (not int's, so you must be using 1.5 code with AutoBoxing
if setValue(300) works. We don't support 1.5 new syntax features like
autoboxing). But since it takes an Object we don't know what is valid so
we can't put up a property editor to handle this.

Richard wrote:
> private JSpinner getJSpinner() {
> if (jSpinner == null) {
> jSpinner = new JSpinner();
> jSpinner.setBounds(new Rectangle(40, 17, 54, 20));
> jSpinner.setValue(300); <--- My code
> }
> return jSpinner;
> }
>
>

--
Thanks,
Rich Kulp
Re: Spinner default [message #121684 is a reply to message #121660] Fri, 07 April 2006 16:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

If the model properties of the my spinner object in VE would have accepted
my integer values and behaved to according the java documentation, I would
not have to manually code that at all. But it did not.

http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SpinnerN umberModel.html
Re: Spinner default [message #121697 is a reply to message #121684] Fri, 07 April 2006 16:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

sorry, Rich. i guess we were responding at the same time. Why can't you
let the programmer set property values in the bean properties and let
eclipse assemble or compile a constructor for that property?
Re: Spinner default [message #121710 is a reply to message #121697] Fri, 07 April 2006 17:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Because we don't have a code editor there. The property editors are for
it where it knows the type. If it needs to be some piece of code then
the java editor pane should be used instead.

Richard wrote:
> sorry, Rich. i guess we were responding at the same time. Why can't you
> let the programmer set property values in the bean properties and let
> eclipse assemble or compile a constructor for that property?
>

--
Thanks,
Rich Kulp
Re: Spinner default [message #121736 is a reply to message #121684] Fri, 07 April 2006 18:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

yes. I am using J2SE 1.5. 1.4.2 is archived. Is there an effort to get
eclipse to up speed with 1.5?
Re: Spinner default [message #121749 is a reply to message #121736] Fri, 07 April 2006 18:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jefmyers.us.ibm.com

Eclipse SDK is up to speed with 1.5 (and is keeping pace with 1.6) VE
however is not.

- Jeff
Re: Spinner default [message #121762 is a reply to message #121749] Fri, 07 April 2006 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jefmyers.us.ibm.com

And even if the VE supported autoboxing syntax, there's still no way to
divine that it's looking for an int value to be passed into the Object
parameter to the setValue() method.

- Keff
Re: Spinner default [message #121774 is a reply to message #121749] Fri, 07 April 2006 18:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

OK. Thanks. I will be more patient and wait.
Re: Spinner default [message #121852 is a reply to message #121774] Sat, 08 April 2006 16:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

i will wait until VE catches up to j2se 1.5 and greater.
Re: Spinner default [message #121922 is a reply to message #121273] Mon, 10 April 2006 06:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johannes.testori.shark-soft.com

hi,
i had the same problem. so i subclassed SpinnerNumberModel to create my
own model and added getters and setters with type "int" that delegate to
the original getters/setters (min, max, value).
kind regards,
hannes
Re: Spinner default [message #121959 is a reply to message #121922] Mon, 10 April 2006 12:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

Thanks. In this case, some kind of code editor and/or something automatic
that compiles java code like the constructors or the getters/setters would
nice to have. I hate to say this but it is the truth. I have seen
something in another open source IDE. However, since this is not a show
stopper, just a SMALL inconvenience SO FAR and the eclipse
support/maintenance is light years better than the other open source java
IDE SO FAR, I will wait for eclipse to catch up with their competitors.
Re: Spinner default [message #122033 is a reply to message #121852] Mon, 10 April 2006 19:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

I will probably enter a bug/enhancement report in bugzilla, too.
Re: Spinner default [message #123195 is a reply to message #121922] Fri, 14 April 2006 23:31 Go to previous message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

hannes,

thanks. your work around worked.
Re: Spinner default [message #612526 is a reply to message #121273] Fri, 07 April 2006 14:38 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Are there any Spinner bean properties that set the default to some number
other than zer when using VE?
Re: Spinner default [message #612528 is a reply to message #121273] Fri, 07 April 2006 14:45 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

How do you do it through code?

Richard wrote:
> I using Eclipse 3.2M5a with VE 1.2M2. I want to set the swing number
> spinner default to 300 when it displays initially. I know how to
> hardcode it. However, I want to set the default in the number spinner's
> VE properties. How do I do it in VE?
>

--
Thanks,
Rich Kulp
Re: Spinner default [message #612529 is a reply to message #121649] Fri, 07 April 2006 15:11 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
private JSpinner getJSpinner() {
if (jSpinner == null) {
jSpinner = new JSpinner();
jSpinner.setBounds(new Rectangle(40, 17, 54, 20));
jSpinner.setValue(300); <--- My code
}
return jSpinner;
}
Re: Spinner default [message #612531 is a reply to message #121660] Fri, 07 April 2006 16:23 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The problem is that setValue takes a java.lang.Object and so it can take
anything. This is because JSpinner uses a model, and a model takes
java.lang.Objects. The problem is that the default model for a JSpinner
takes Integers (not int's, so you must be using 1.5 code with AutoBoxing
if setValue(300) works. We don't support 1.5 new syntax features like
autoboxing). But since it takes an Object we don't know what is valid so
we can't put up a property editor to handle this.

Richard wrote:
> private JSpinner getJSpinner() {
> if (jSpinner == null) {
> jSpinner = new JSpinner();
> jSpinner.setBounds(new Rectangle(40, 17, 54, 20));
> jSpinner.setValue(300); <--- My code
> }
> return jSpinner;
> }
>
>

--
Thanks,
Rich Kulp
Re: Spinner default [message #612534 is a reply to message #121660] Fri, 07 April 2006 16:24 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
If the model properties of the my spinner object in VE would have accepted
my integer values and behaved to according the java documentation, I would
not have to manually code that at all. But it did not.

http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SpinnerN umberModel.html
Re: Spinner default [message #612535 is a reply to message #121684] Fri, 07 April 2006 16:37 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
sorry, Rich. i guess we were responding at the same time. Why can't you
let the programmer set property values in the bean properties and let
eclipse assemble or compile a constructor for that property?
Re: Spinner default [message #612538 is a reply to message #121697] Fri, 07 April 2006 17:45 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Because we don't have a code editor there. The property editors are for
it where it knows the type. If it needs to be some piece of code then
the java editor pane should be used instead.

Richard wrote:
> sorry, Rich. i guess we were responding at the same time. Why can't you
> let the programmer set property values in the bean properties and let
> eclipse assemble or compile a constructor for that property?
>

--
Thanks,
Rich Kulp
Re: Spinner default [message #612542 is a reply to message #121684] Fri, 07 April 2006 18:23 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
yes. I am using J2SE 1.5. 1.4.2 is archived. Is there an effort to get
eclipse to up speed with 1.5?
Re: Spinner default [message #612544 is a reply to message #121736] Fri, 07 April 2006 18:26 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
Eclipse SDK is up to speed with 1.5 (and is keeping pace with 1.6) VE
however is not.

- Jeff
Re: Spinner default [message #612545 is a reply to message #121749] Fri, 07 April 2006 18:28 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
And even if the VE supported autoboxing syntax, there's still no way to
divine that it's looking for an int value to be passed into the Object
parameter to the setValue() method.

- Keff
Re: Spinner default [message #612546 is a reply to message #121749] Fri, 07 April 2006 18:31 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
OK. Thanks. I will be more patient and wait.
Re: Spinner default [message #612560 is a reply to message #121774] Sat, 08 April 2006 16:36 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
i will wait until VE catches up to j2se 1.5 and greater.
Re: Spinner default [message #612569 is a reply to message #121273] Mon, 10 April 2006 06:34 Go to previous message
Eclipse UserFriend
Originally posted by: johannes.testori.shark-soft.com

hi,
i had the same problem. so i subclassed SpinnerNumberModel to create my
own model and added getters and setters with type "int" that delegate to
the original getters/setters (min, max, value).
kind regards,
hannes
Re: Spinner default [message #612574 is a reply to message #121922] Mon, 10 April 2006 12:28 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Thanks. In this case, some kind of code editor and/or something automatic
that compiles java code like the constructors or the getters/setters would
nice to have. I hate to say this but it is the truth. I have seen
something in another open source IDE. However, since this is not a show
stopper, just a SMALL inconvenience SO FAR and the eclipse
support/maintenance is light years better than the other open source java
IDE SO FAR, I will wait for eclipse to catch up with their competitors.
Re: Spinner default [message #612585 is a reply to message #121852] Mon, 10 April 2006 19:29 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
I will probably enter a bug/enhancement report in bugzilla, too.
Re: Spinner default [message #612653 is a reply to message #121922] Fri, 14 April 2006 23:31 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
hannes,

thanks. your work around worked.
Previous Topic:Noob Questin - Using VE to create a wizard
Next Topic:visual editor window is not coming
Goto Forum:
  


Current Time: Mon Sep 23 10:23:41 GMT 2024

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

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

Back to the top