Spinner default [message #121273] |
Sat, 01 April 2006 16:23 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 #121697 is a reply to message #121684] |
Fri, 07 April 2006 16:37 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 #121762 is a reply to message #121749] |
Fri, 07 April 2006 18:28 |
Eclipse User |
|
|
|
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 #121922 is a reply to message #121273] |
Mon, 10 April 2006 06:34 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 #612528 is a reply to message #121273] |
Fri, 07 April 2006 14:45 |
Eclipse User |
|
|
|
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 #612531 is a reply to message #121660] |
Fri, 07 April 2006 16:23 |
Eclipse User |
|
|
|
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 #612538 is a reply to message #121697] |
Fri, 07 April 2006 17:45 |
Eclipse User |
|
|
|
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 #612569 is a reply to message #121273] |
Mon, 10 April 2006 06:34 |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05048 seconds