Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » WorkbenchWindowControlContribution moves to incorrect position
WorkbenchWindowControlContribution moves to incorrect position [message #530389] Thu, 29 April 2010 14:41 Go to next message
exquisitus  is currently offline exquisitus Friend
Messages: 2
Registered: April 2010
Junior Member
Hi,

I have a WorkbenchWindowControlContribution (2 side by side in fact) that, after a period of inactivity move to the beginning of my toolbar. They are originally positioned correctly mid toolbar after some command buttons. However, I notice that when I launch my app, the problem WorkbenchWindowControlContribution's blink at the beginning of the toolbar before, correctly positioning themselves mid toolbar.

Also, if I resize my app the WorkbenchWindowControlContribution's return to their correct position.

I tried adding a PaintListener to the parent of both in the hope that the problem is that it was not repainting correctly but no luck.

Any help would be greatly appreciated, thanks!

1st WorkbenchWindowControlContribution createControl(Composite) method

protected Control createControl(Composite parent)
{
parent.setLayout(new GridLayout());

Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());

final Label connectionsLabel = new Label(comp, SWT.NONE);

connectionsLabel.setText(Messages.ConnectionsLabel_TITLE_CON NECTION_SETTINGS);

// parent.addPaintListener(new PaintListener()
// {
// @Override
// public void paintControl(PaintEvent e)
// {
// connectionsLabel.redraw();
// }
// });

return comp;
}

2nd WorkbenchWindowControlContribution createControl(Composite) method

public Control createControl(Composite parent)
{
final GridLayout gridLayout = new GridLayout();
final GridData gdDataTypeCbo = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);

gridLayout.marginHeight = 0;
gdDataTypeCbo.widthHint = 150;

_connectionSetsCbo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);

_connectionSetsCbo.setLayoutData(gdDataTypeCbo);
_connectionSetsCbo.addSelectionListener(new SelectionListener()
{
@Override
public void widgetDefaultSelected(SelectionEvent e)
{
}

@Override
public void widgetSelected(SelectionEvent e)
{
setupDefaultConnection();
updatePreferenceFile(ConnectionTypeProvider.getInstance().se tFileConnectionType(
_connectionSetsCbo.getItem(_connectionSetsCbo.getSelectionIn dex())));
}
});

// parent.addPaintListener(new PaintListener()
// {
// @Override
// public void paintControl(PaintEvent e)
// {
// _connectionSetsCbo.redraw();
// _connectionSetsCbo.layout();
// }
// });

populateFromFile();

return _connectionSetsCbo;
}

And here is where they are added in plugin.xml

<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="com.pilz.ie.dis1.ui.toolbar">
...
<separator
name="ui.menu.toolbar.connectionsSeparator"
visible="true">
</separator>
<control
class="ui.menus.online.controls.ConnectionsLabel"
id="toolbar.connectionsLabel">
</control>
<control
class="ui.menus.online.controls.ConnectionsCombo"
id="toolbar.connectionsCombo">
</control>
<separator
name="ui.menu.toolbar.helpSeparator"
visible="true">
</separator>
Re: WorkbenchWindowControlContribution moves to incorrect position [message #530726 is a reply to message #530389] Fri, 30 April 2010 16:04 Go to previous message
exquisitus  is currently offline exquisitus Friend
Messages: 2
Registered: April 2010
Junior Member
Hi All,

Anyone got any ideas on this? I'm out of ideas outside of reimplementing completely which would be a headache in terms of dependencies and existing logic in my Combo.

My 1st WorkbenchWindowControlContribution the Label connectionsLabel, just repaints itself over the first few items of my toolbar.

There must be something small missing. Or a handy refresh that can be called.

Thanks!
Previous Topic:Adding menu-items to a rcp application
Next Topic:How to change the appearance of an editor-tab
Goto Forum:
  


Current Time: Fri Apr 19 23:05:39 GMT 2024

Powered by FUDForum. Page generated in 0.02926 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top