Ghosting effect using nested forms [message #316852] |
Wed, 20 June 2007 04:21  |
Eclipse User |
|
|
|
Originally posted by: xuiterlinden.be-value.nl
Hi,
We've just ported our application from SWT to RCP on eclipse 3.2.
In our application we're using nested FormToolkit forms. Where this
worked fine in eclipse 3.1, we're experiencing problems in eclipse
3.2.
When scrolling through my view, the widgets on the form are repainted
slowly ?? which causes a ghosting effect.
Below is an example View which demonstrates the effect.
I also tried the same code in 3.3RC4, but it gives the same ghosting
effect.
Anyone have an idea to fix this ?
-- Xander
------8<------------8<------------8<-------------8<-----------
public class View extends ViewPart {
public static final String ID = "ScrapbookPliugin.view";
/**
* This is a callback that will allow us to create the viewer
and
initialize
* it.
*/
public void createPartControl(Composite parent) {
Composite c = new Composite(parent, SWT.NONE);
c.setLayout(new FillLayout());
FormToolkit toolkit = new
FormToolkit(getViewSite().getShell().getDisplay());
ScrolledForm form = toolkit.createScrolledForm(c);
Composite body = form.getBody();
body.setBackground(Display.getCurrent().getSystemColor(SWT.C OLOR_YELLOW));
body.setLayout(new GridLayout());
for (int i = 0; i < 3; i++) {
createSection(toolkit, body, "Section " + i,
0);
}
}
public void createSection(FormToolkit toolkit, Composite
parent, String
label, int depth) {
Section section = null;
Composite sectionComposite = null;
GridLayout layout = null;
GridData data = null;
Text text = null;
Composite widgetsComposite = null;
Composite subsectionComposite = null;
section = toolkit.createSection(parent,
ExpandableComposite.TWISTIE |
ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED);
section.setText(label);
section.setBackground(Display.getCurrent().getSystemColor(SW T.COLOR_GREEN));
data = new GridData();
data.minimumWidth = 500;
data.widthHint = 500;
data.grabExcessHorizontalSpace = true;
data.horizontalAlignment = SWT.FILL;
if (depth > 0) {
data.horizontalIndent = 20;
}
section.setLayoutData(data);
sectionComposite = toolkit.createComposite(section);
layout = new GridLayout();
layout.numColumns = 1;
sectionComposite.setLayout(layout);
// create a widgets and a subsections composite
widgetsComposite =
toolkit.createComposite(sectionComposite);
subsectionComposite =
toolkit.createComposite(sectionComposite);
subsectionComposite.setLayout(new GridLayout());
section.setBackground(Display.getCurrent().getSystemColor(SW T.COLOR_GRAY));
layout = new GridLayout();
layout.numColumns = 2;
widgetsComposite.setLayout(layout);
section.setClient(sectionComposite);
for (int j = 0; j < 3; j++) {
toolkit.createLabel(widgetsComposite,
"Checkbox control");
toolkit.createButton(widgetsComposite,
"Check", SWT.CHECK);
}
for (int j = 0; j < 10; j++) {
toolkit.createLabel(widgetsComposite, "Label
for text");
text = toolkit.createText(widgetsComposite,
"Text control");
data = new GridData();
data.minimumWidth = 300;
data.widthHint = 300;
text.setLayoutData(data);
}
depth ++;
if (depth < 3) {
for (int i = 0; i < 2; i++) {
createSection(toolkit,
subsectionComposite, label + depth, depth);
}
}
}
/**
* Passing the focus request to the viewer's control.
*/
public void setFocus() {
}
}
|
|
|
|
Re: Ghosting effect using nested forms [message #316897 is a reply to message #316892] |
Thu, 21 June 2007 06:59  |
Eclipse User |
|
|
|
Originally posted by: xuiterlinden.be-value.nl
On Thu, 21 Jun 2007 10:59:14 +0200, Monika Krug
<monikakrug@expires-2007-06-30.arcornews.de> wrote:
>Xander Uiterlinden schrieb:
>> Hi,
>>
>> We've just ported our application from SWT to RCP on eclipse 3.2.
>> In our application we're using nested FormToolkit forms. Where this
>> worked fine in eclipse 3.1, we're experiencing problems in eclipse
>> 3.2.
>> When scrolling through my view, the widgets on the form are repainted
>> slowly ?? which causes a ghosting effect.
>> Below is an example View which demonstrates the effect.
>>
>> I also tried the same code in 3.3RC4, but it gives the same ghosting
>> effect.
>>
>> Anyone have an idea to fix this ?
>
>Is this all the relevant code? Is there code outside what you showed
>that is running a long-running operation on the UI thread (= the thread
>where the Display was created)? That could cause other operations, like
>repainting, to be delayed.
>
>Monika.
Yes, this actually is all the relevant code. It's not the actual code
in our product, but an reproduction which gives the same behaviour. If
you create a new plugin project en past this view into it, you'll see
the problem.
--Xander
|
|
|
Powered by
FUDForum. Page generated in 0.05654 seconds