Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EDate property. input format not Locale.ENGLISH
EDate property. input format not Locale.ENGLISH [message #484985] Thu, 10 September 2009 06:47 Go to next message
Urs Frei is currently offline Urs FreiFriend
Messages: 27
Registered: July 2009
Junior Member
Hello

I have an EDate member in my ecore model. In the property view I have to
input a date in the format like this:

new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ"),
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"),
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"),
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm"),
new SafeSimpleDateFormat("yyyy-MM-dd")

But I would like to have a German format. Is there a way to change the
configuration? The definition for the format is in the class
org.eclipse.emf.ecore.impl.EFactoryImpl

And the SaveSimpleDateFormat is configured to
public SafeSimpleDateFormat(String pattern){
super(pattern, Locale.ENGLISH);
}

The only way I found is to replace the element in the member EDATE_FORMATS.
But I think it is not the perfect solution.

Have you any other ideas?

Thank you

Urs
Re: EDate property. input format not Locale.ENGLISH [message #485125 is a reply to message #484985] Thu, 10 September 2009 14:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Urs,

Comments below.

Urs Frei wrote:
> Hello
>
> I have an EDate member in my ecore model. In the property view I have to
> input a date in the format like this:
>
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ"),
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"),
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"),
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm"),
> new SafeSimpleDateFormat("yyyy-MM-dd")
>
> But I would like to have a German format. Is there a way to change the
> configuration? The definition for the format is in the class
> org.eclipse.emf.ecore.impl.EFactoryImpl
>
> And the SaveSimpleDateFormat is configured to
> public SafeSimpleDateFormat(String pattern){
> super(pattern, Locale.ENGLISH);
> }
>
> The only way I found is to replace the element in the member EDATE_FORMATS.
> But I think it is not the perfect solution.
>
That's a terrible solution because it will definitely break other
clients of EMF. Best to create your own EDataType and then you can do
whatever you want with it in terms of converting it between a string and
a value.
> Have you any other ideas?
>
> Thank you
>
> Urs
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF generated editor nested inside MultipageEditorPart
Next Topic:sharing a single read-only resource instance between resource sets
Goto Forum:
  


Current Time: Thu Apr 25 07:29:44 GMT 2024

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

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

Back to the top