Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » DateSpinner with date only
DateSpinner with date only [message #112900] Sat, 10 December 2005 01:08 Go to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

I am using eclipse 3.1.1 and the ve plugin. I am using the swing JSpinner
and the spinnerDateModel beans from J2SE 1.4.2 to create a date spinner.
Unfortunately, I am having a problem with eliminating the time in the
date. I want a non-time date only. Someone told me to use a string date
format property or method. I could not find it in the ve bean for
JSpinner. Can someone help me please?
Re: DateSpinner with date only [message #112927 is a reply to message #112900] Sat, 10 December 2005 17:37 Go to previous messageGo to next message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
Richard,

Unfortunately you can't directly set the date format from the Properties
view, because the format isn't a Java bean property of the DateEditor
class (it's specified in the constructor of the class). So you'll need
to edit the code by hand to achieve this. Try something like this:

private JSpinner getJSpinner() {
if (jSpinner == null) {
jSpinner = new JSpinner();
jSpinner.setBounds(new Rectangle(83, 41, 131, 29));
SpinnerDateModel spinnerDateModel = new SpinnerDateModel();
jSpinner.setModel(spinnerDateModel);
JSpinner.DateEditor editor = new JSpinner.DateEditor(jSpinner,
"MM/dd/yy");
jSpinner.setEditor(editor);
}
return jSpinner;
}

The date format specified in the DateEditor constructor is the format
used by the SimpleDateFormat class:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDate Format.html

Hope this helps,
- Jeff

Richard wrote:
> I am using eclipse 3.1.1 and the ve plugin. I am using the swing
> JSpinner and the spinnerDateModel beans from J2SE 1.4.2 to create a date
> spinner. Unfortunately, I am having a problem with eliminating the time
> in the date. I want a non-time date only. Someone told me to use a
> string date format property or method. I could not find it in the ve
> bean for JSpinner. Can someone help me please?
>
Re: DateSpinner with date only [message #112940 is a reply to message #112927] Sat, 10 December 2005 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

Jeff,

thanks a billion. It will try it.
Re: DateSpinner with date only [message #112953 is a reply to message #112940] Sat, 10 December 2005 23:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

It worked. It really worked! Thanks a trillion. It is a shame that the
bean does not all properties of JSpinner. Otherwise, the ve would be more
rebust.
Re: DateSpinner with date only [message #113574 is a reply to message #112953] Sat, 17 December 2005 17:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

Why the VE implementors have not made all properties of the swing
components accessible in the VE beans? VE would be very robust and you
could it is RAD or Rapid Application Development if they did that.
Re: DateSpinner with date only [message #113587 is a reply to message #113574] Sat, 17 December 2005 22:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: MFEMFEM.cboenospam.com

Richard wrote:
> Why the VE implementors have not made all properties of the swing
> components accessible in the VE beans? VE would be very robust and you
> could it is RAD or Rapid Application Development if they did that.

Have you tried the Show Advanced Properties button in the tool bar of
the Properties view?
Re: DateSpinner with date only [message #113600 is a reply to message #113587] Sun, 18 December 2005 01:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

Yes. I did. for some strange reason it replaced my JSpinner.DateEditor
instance and the setEditor statements and placed them in the getDateEditor
method. I tried reproduced that effect on another date spinner and I could
not do it.
Re: DateSpinner with date only [message #113613 is a reply to message #113574] Sun, 18 December 2005 14:37 Go to previous messageGo to next message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
As I explained in an earlier posting, the JSpinner class (or more
specifically the JSpinner Editor classes) does not follow the Java Beans
spec because some of its properties are specified in the constructor.
Because of this, support for these properties must be custom coded into
the Visual Editor. This hasn't been done for the JSpinner class yet -
but you can open a enhancement request to get support added here:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=VE&b ug_severity=enhancement
In the request specify which features/settings you'd like to set from
the Properties view, that aren't showing up now.

Thanks,
- Jeff
Re: DateSpinner with date only [message #113624 is a reply to message #113613] Sun, 18 December 2005 14:44 Go to previous message
Eclipse UserFriend
Originally posted by: milnfalcon4163.yahoo.com

Thanks. I will enter the reguest. In fact, I meke it into the habit of
using eclipse bugzilla database when I when See some thing missing, having
problems or want an enhancement,.., etc. I will do anything to support my
visual or RAD programming. Thanks
Re: DateSpinner with date only [message #611525 is a reply to message #112900] Sat, 10 December 2005 17:37 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
Richard,

Unfortunately you can't directly set the date format from the Properties
view, because the format isn't a Java bean property of the DateEditor
class (it's specified in the constructor of the class). So you'll need
to edit the code by hand to achieve this. Try something like this:

private JSpinner getJSpinner() {
if (jSpinner == null) {
jSpinner = new JSpinner();
jSpinner.setBounds(new Rectangle(83, 41, 131, 29));
SpinnerDateModel spinnerDateModel = new SpinnerDateModel();
jSpinner.setModel(spinnerDateModel);
JSpinner.DateEditor editor = new JSpinner.DateEditor(jSpinner,
"MM/dd/yy");
jSpinner.setEditor(editor);
}
return jSpinner;
}

The date format specified in the DateEditor constructor is the format
used by the SimpleDateFormat class:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDate Format.html

Hope this helps,
- Jeff

Richard wrote:
> I am using eclipse 3.1.1 and the ve plugin. I am using the swing
> JSpinner and the spinnerDateModel beans from J2SE 1.4.2 to create a date
> spinner. Unfortunately, I am having a problem with eliminating the time
> in the date. I want a non-time date only. Someone told me to use a
> string date format property or method. I could not find it in the ve
> bean for JSpinner. Can someone help me please?
>
Re: DateSpinner with date only [message #611526 is a reply to message #112927] Sat, 10 December 2005 21:08 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Jeff,

thanks a billion. It will try it.
Re: DateSpinner with date only [message #611527 is a reply to message #112940] Sat, 10 December 2005 23:38 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
It worked. It really worked! Thanks a trillion. It is a shame that the
bean does not all properties of JSpinner. Otherwise, the ve would be more
rebust.
Re: DateSpinner with date only [message #611658 is a reply to message #112953] Sat, 17 December 2005 17:21 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Why the VE implementors have not made all properties of the swing
components accessible in the VE beans? VE would be very robust and you
could it is RAD or Rapid Application Development if they did that.
Re: DateSpinner with date only [message #611661 is a reply to message #113574] Sat, 17 December 2005 22:10 Go to previous message
Eclipse UserFriend
Originally posted by: MFEMFEM.cboenospam.com

Richard wrote:
> Why the VE implementors have not made all properties of the swing
> components accessible in the VE beans? VE would be very robust and you
> could it is RAD or Rapid Application Development if they did that.

Have you tried the Show Advanced Properties button in the tool bar of
the Properties view?
Re: DateSpinner with date only [message #611662 is a reply to message #113587] Sun, 18 December 2005 01:47 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Yes. I did. for some strange reason it replaced my JSpinner.DateEditor
instance and the setEditor statements and placed them in the getDateEditor
method. I tried reproduced that effect on another date spinner and I could
not do it.
Re: DateSpinner with date only [message #611663 is a reply to message #113574] Sun, 18 December 2005 14:37 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 489
Registered: July 2009
Senior Member
As I explained in an earlier posting, the JSpinner class (or more
specifically the JSpinner Editor classes) does not follow the Java Beans
spec because some of its properties are specified in the constructor.
Because of this, support for these properties must be custom coded into
the Visual Editor. This hasn't been done for the JSpinner class yet -
but you can open a enhancement request to get support added here:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=VE&b ug_severity=enhancement
In the request specify which features/settings you'd like to set from
the Properties view, that aren't showing up now.

Thanks,
- Jeff
Re: DateSpinner with date only [message #611664 is a reply to message #113613] Sun, 18 December 2005 14:44 Go to previous message
Richard is currently offline RichardFriend
Messages: 49
Registered: July 2009
Member
Thanks. I will enter the reguest. In fact, I meke it into the habit of
using eclipse bugzilla database when I when See some thing missing, having
problems or want an enhancement,.., etc. I will do anything to support my
visual or RAD programming. Thanks
Previous Topic:DateSpinner Event Example
Next Topic:How to add a Fragment's new view into Base Plug-in's one of the Perspective
Goto Forum:
  


Current Time: Tue Mar 19 08:31:44 GMT 2024

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

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

Back to the top