|
Re: [Databinding] Need cron-like use-case help [message #333059 is a reply to message #333025] |
Mon, 24 November 2008 01:06 |
Boris Bokowski Messages: 272 Registered: July 2009 |
Senior Member |
|
|
You need a helper object that maps booleans to seconds/minutes/hours. For
an example, have a look at
org.eclipse.jface.examples.databinding.model.PriceModelObjec t in
org.eclipse.jface.tests.databinding, it does the same kind of thing for
"price" and "dollars"/"cents".
Boris
"Matthias Treitler" <matthias.treitler@gmail.com> wrote in message
news:8e0b988292988a193d8e13e47af8572c$1@www.eclipse.org...
> Hello Eclipse developers!
> Currently I am introducing Databinding in my project (to be concrete EMF
> Databinding) and I have the following use-case, where it don't know if I
> am on the right way...
>
> Let me explain:
> Use-case:
> I have an editor where I can edit a Cron expression.
> Model:
> My model that stores a Cron expression has for every cron part (seconds,
> minutes, hours, ... ) a String attribute.
>
> UI:
> For instance the month part of the cron expression has 12 SWT
> Push-Buttons, labeled from "1" to "12". So when the user clicks the button
> "2" then the databinder should add the value "2" to the month attribute of
> my model instance. The same applies to every button. When the user
> deselects a button than the value should be removed from the string.
>
> To achieve this use case with databinding I would have to bind each of the
> 12 buttons to my "month" attribute string of my model. Then I would have
> to somehow convert the values from a boolean (if the button has been
> selected or not) to a string... with a IConverter... can you give me any
> hints, if I am on the right way?!
> Thank you very much,
> Matthias
>
|
|
|
Powered by
FUDForum. Page generated in 0.03724 seconds