Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] SWTDesigner and Riena Views

Christian Campo schrieb:
no no no :-)
;-)

I only did some look at
CustomerDetailsSubModuleView
as you know my real UI work has to start now
as my server is up and running

great you made the contact to Instantiations. I will contact them as soon as I have the webinar out of the way.
I'll watch it ;-)
great to hear that they can now deal with
the alternativ method.

However the c) part is where I fully disagree.

no problem - I'm just learning the riena-way-to-ui
The View does not know anything about Ridgets, it does not create them, does not reference them or has any knowledge about ridgets at all. So I dont think the SWTDesigner has to be extended in that way.
that was what I was meaning:
not the View should know it, but the SWTDesigner should know it ???

That also means that the View does not create Ridgets to inject the UIControls into them.

That is all done by the DefaultBindingManager. The idea is that there is one view instance but you can bind multiple controllers against it (of course only one controller at a time). I am not sure how this is done if you dont use the Riena navigation model.

I'll have more then one view instances
maybe some of them can have multiple controllers depending from scenario
but in many cases there will be one controller for one view
Still if you subclass the SubModuleView class in your view, all you need to do is

Text firstName= new Text(); // create SWT widget;
addUIControl(firstName,"firstName"); // add widget to the set of widget under a name.
ok

I did a look at
CustomerDetailsSubModuleController
found
...
getController().setNumberFacade(textFacade);
...

...should look more in detail to your concept and not only at one example ;-)

Then the DefaultBindingManager or InjectBindingManager can take this collection of widgets, create ridgets for them (at binding time) and call "configureRidgets" on your Controller so that you can bind the ridgets against your model.

ok

The view does not or should not know about the model but only deal with widgets, fonts, color, layout and such stuff.

I know
There is a good example how to embedd a Riena View into an RCP application in org.eclipse.riena.sample.app.client.rcpmail. Just the standard RCP app and from the Example App, the marker View and Control as one tab folder. There you see the same pattern, where the View calls addUIControl, and the controller picks up the ridget in the method configureRidgets.

just short look at MessageView
the View knows the Controller
...private IController controller = new MessageController();
and the widget:
Text text = new Text(top, SWT.MULTI | SWT.WRAP);
       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
       delegate.addUIControl(text, "message");
....
and in the Controller:
...
       ITextRidget txtMessage = (ITextRidget) getRidget("message");
txtMessage.bindToModel(PojoObservables.observeValue(message, "message"));
       txtMessage.setOutputOnly(true);
       txtMessage.updateFromModel();
...
there are Strings that have to match ("message")

and I still think it should be possible for the SWTDesigner
- to found the Controller
- and if I want to generate there Code

there's good support from SWTDesigner for DataBinding in standard views,
so: why not for Riena
Hope that helps.

of course - thx :-)

hope you understand what I meant

think if I start real work next week on the UI front I have better examples and questions ;-)
It would certainly help if SWTDesigner creates this addUIControl method call. I will talk to him about this.

yes - of course this would be the next step

ekke
christian
_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev




Back to the top