Community
Participate
Working Groups
After switching to Eclipe Neon I noticed that WorkbenchWindowControlContribution's aren't fully shown. There weren't any problems with them in Eclipse Mars. A simple control consisting of a Label and a Text looks so in Neon: https://i.stack.imgur.com/BDm1M.png The code of the control is below: package experiments; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.menus.WorkbenchWindowControlContribution; public class ControlContributionItem extends WorkbenchWindowControlContribution { public static final String ID = "MyControlContributionItem"; //$NON-NLS-1$ @Override protected Control createControl(Composite parent) { Composite rootComp = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginHeight = 0; gridLayout.verticalSpacing = 0; rootComp.setLayout(gridLayout); Label label = new Label(rootComp, SWT.NONE); label.setText("Label"); //$NON-NLS-1$ Text text = new Text(rootComp, SWT.BORDER | SWT.READ_ONLY); text.setText("Text"); GridData data = new GridData(SWT.FILL, SWT.CENTER, false, true); FontData fontData = text.getFont().getFontData()[0]; Font boldFont = new Font(parent.getDisplay(), fontData.getName(), fontData.getHeight(), fontData.getStyle() | SWT.BOLD); text.setFont(boldFont); data.widthHint = 120; text.setLayoutData(data); rootComp.pack(); return rootComp; } } The related part in plugin.xml <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar"> <toolbar id="MyControlContributionItem"> <control class="experiments.ControlContributionItem" id="MyControlContributionItem"> </control> </toolbar> </menuContribution> </extension> Please, suggest a workaround ASAP. We have a lot of WorkbenchWindowControlContribution's which are cut off and we have a release this month.
(In reply to Denis Aristov from comment #0) > After switching to Eclipe Neon I noticed that > WorkbenchWindowControlContribution's aren't fully shown. There weren't any > problems with them in Eclipse Mars. > > A simple control consisting of a Label and a Text looks so in Neon: > > https://i.stack.imgur.com/BDm1M.png > > > The code of the control is below: It would be great if you could create a simple plugin containing your snippet, so that it could be used for debugging the problem and verifying the fix. If you do, please attach to the bug 471313. > Please, suggest a workaround ASAP. We have a lot of > WorkbenchWindowControlContribution's which are cut off You can check bug 471313 comment 12, if this helps you in your environment. > and we have a release this month. Switching the platform *a month* before release? Good luck then :-) *** This bug has been marked as a duplicate of bug 471313 ***
Thank you. The workaround works! (In reply to Andrey Loskutov from comment #1) > (In reply to Denis Aristov from comment #0) > > After switching to Eclipe Neon I noticed that > > WorkbenchWindowControlContribution's aren't fully shown. There weren't any > > problems with them in Eclipse Mars. > > > > A simple control consisting of a Label and a Text looks so in Neon: > > > > https://i.stack.imgur.com/BDm1M.png > > > > > > The code of the control is below: > > It would be great if you could create a simple plugin containing your > snippet, so that it could be used for debugging the problem and verifying > the fix. If you do, please attach to the bug 471313. > > > Please, suggest a workaround ASAP. We have a lot of > > WorkbenchWindowControlContribution's which are cut off > > You can check bug 471313 comment 12, if this helps you in your environment. > > > and we have a release this month. > > Switching the platform *a month* before release? Good luck then :-) > > *** This bug has been marked as a duplicate of bug 471313 ***