Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Sourcecodeplugins from riena 1.0.0

Hi Florian,

yes, your event-based approach sound a bit weird to me (without
knowing the details). Normally setRedraw should not cause problems,
because after doing control.setRedraw(true) the whole control is
redrawn.

Anyway, a bit of info on setRedraw:

The setRedraw(true/false) is used to avoid flicker / restlessness when
changing several things and as a performance optimization.

For example, ChoiceComposite.setBackground(...) propagates the bgColor
to each child of the composite. So to avoid that the user sees every
control change color one-by-one, I disable redraw, perform the
changes, then enable redraw.

Another example with viewers: when changing the input, I do several
things: change the input, expand elements, set selection. Also by
using setRedraw(false) before and setRedraw(true) afterwards, I avoid
redrawing the tree while this happens. Plus, setInput is much faster
this way.

			viewer.getControl().setRedraw(false);
			try {
				viewer.setInput(...);
				viewer.setExpandedElements(expandedElements);
				viewer.setSelection(new StructuredSelection(selection));
			} finally {
				viewer.getControl().setRedraw(true);
			}

BTW, it's a good idea to put the setRedraw(true) in a finally clause,
just in case something throws a runtime exception.

Note that setRedraw(...) is a hint and not supported (=nop) on all platforms.

Kind regards,
Elias.


2009/3/17 Florian Pirchner <florian.pirchner@xxxxxxxxx>:
> Hi Elias,
>
> i have removed the setRedraw() calls and the editor works right now.
>
> I am not so familiar with drawing events of swt right now. I think, it was
> not the best to use repaintEvents to change the color of child controls. I
> will refactor redview after the eclipseCon and handle the parentColorSupport
> without a paintevent. Meanwhile i am using the patched riena plugin for
> presentation.
>
> Why are you using the setRedraw(...) method in ChoiceComposite. I guess you
> do not want that the composite becomes redrawn during the change of a
> property. But what is the deeper cause of it? PaintEvents are a very
> interesting issue.
>
>
> Thanks in advance,
> Flo
>
>
> 2009/3/17 Florian Pirchner <florian.pirchner@xxxxxxxxx>
>>
>> Hi Elias,
>>
>> thanks!
>>
>> Flo
>>
>> 2009/3/17 Elias Volanakis <elias@xxxxxxxxxxxxxxxxx>
>>>
>>> Hi Florian,
>>>
>>> > Has anybody an idea, how to get the sourcePlugins?
>>>
>>> that's easy - I'm assuming you 've the 1.0.0. target.
>>>
>>> 1. Open the Plug-ins View
>>> 2. Select org.eclipse.riena.ui.swt (1.x.x)
>>> 3. Right-click, Import As > Source Project
>>>
>>> This should work for all riena plug-ins, since the source is part of the
>>> target.
>>>
>>> Hope this helps,
>>> Elias.
>>>
>>> 2009/3/17 Florian Pirchner <florian.pirchner@xxxxxxxxx>:
>>> > Hi,
>>> >
>>> > i have a problem with redrawEvents in OSX. To test some cases i would
>>> > require the sourcePlugins for riena 1.0.0. In CVS only the riena folder
>>> > in
>>> > head is filled.
>>> >
>>> > My problem is, that the ChoiceComposite calls setRedraw(false) at the
>>> > begining and setRedraw(true) at the end of some methods. We have
>>> > implemented
>>> > a parentColorSupport in redview. This means, that a changed color of a
>>> > parent can affect all children colors. This becomes controlled by a
>>> > property. We implemented this function by redrawEvents. If the parent
>>> > becomes redrawn, we change the color of the child.
>>> >
>>> > Last week if found a error in redview which had its root at a wrong
>>> > redraw()
>>> > call in a redview class. All ridgets are all right now. Only the
>>> > SingleChoiceRidget causes the EclipseEditor to do strange things.
>>> >
>>> > I would like to remove the setRedraw(xxx) in the ChoiceComposite for a
>>> > test.
>>> > I can not use the SwtControlRidgetMapper because we are using Riena
>>> > 1.0.0
>>> >
>>> > Has anybody an idea, how to get the sourcePlugins?
>>> >
>>> >
>>> > Thanks, Flo
>>> >
>>> > _______________________________________________
>>> > riena-dev mailing list
>>> > riena-dev@xxxxxxxxxxx
>>> > https://dev.eclipse.org/mailman/listinfo/riena-dev
>>> >
>>> >
>>> _______________________________________________
>>> riena-dev mailing list
>>> riena-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/riena-dev
>>
>
>
> _______________________________________________
> riena-dev mailing list
> riena-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/riena-dev
>
>


Back to the top