WorkbenchWindowControlContribution moves to incorrect position [message #530389] |
Thu, 29 April 2010 14:41 |
exquisitus 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>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02648 seconds