| [news.eclipse.platform.rcp] Re: How to get form MessageManager? |
Hi Josip,
Hi, Thomas!
Thanks for the help. Works like a charm! :) I found out that something like:
IMessageManager manager = new MessageManager();
also works, but because MessageManager is in a package marked internal, the use of it is discouraged.
That's the point.
So, I'll stick with your code! :)
Btw, if you are willin to share to code for the mentioned bridge between Databinding and message manager I would be grateful!! Because, and that's not hard to guess:), that's exactly what I need to implement also..
- setBinding(): which can be refactored because of duplicate code - connectBindingToMessageManager(): does what you really want :)
In SampleView.createPartControl() you can see the setup.
bye Thomas
Josip.
"Thomas Fahrmeyer" <lauritziu_ii@xxxxxxxx> wrote in message news:frdab6$ifi$1@xxxxxxxxxxxxxxxxxxxxHi,
what I did to make it work was to create a ManagedForm:
IMessageManager manager = new ManagedForm(m_formToolkit, m_form).getMessageManager();
In all my code I'm using m_form instead of the managed form being created. It recognized no side effects. I used the message manager a lot. I implemented a bridge between Databinding and the message manager, to get validation messages to be shown in the message area. Works like a charm :)
-Thomas
JMaslac schrieb:Hi,
I'm using eclipse forms. I have a view and in it I've created a form. The question is - how can I get/create MessageManager that's associated with that form?
My code is as follows:
---- public void createPartControl(final Composite p_parent) {
m_formToolkit = new FormToolkit(p_parent.getDisplay()); m_form = m_formToolkit.createForm(p_parent); m_formBody = m_form.getBody(); .... -----
I've seen how it's done in org.eclipse.ui.forms.example's ErrorMessagesPage.java (managedForm.getMessageManager();) but that doesn't help me much. At least I don't see how because I don't have managed form in my program.
Thanks,
Josip
Attachment:
FormsSample.zip
Description: Zip archive