Skip to content

WindowBuilder barely works anymore (could be Forms related) #1324

@jeffecom

Description

@jeffecom

Hi,

I've used WB a lot in the past, but it seems to be barely functional now. Only the simplest of controls I created in previous version seem to display properly in the WB editor.

I made a simple test case to investigate:

  1. Downloaded a fresh Eclipse 2025-12
  2. Created an empty project (set to JDK21) and made a single class.
  3. These are the Eclipse jars added.
Image
  1. Opened the class in WB designer and added a few controls. It's OK up until this point:
Image
  1. When I try to add a Composite to the body of the Section, the WB editor goes blank and that's it. Deleting the Composite doesn't help. Undoing the code changes in the Java editor and reparsing in WB does fix it. (This happens with both a normal Composite and a Forms Composite)

Code before the Composite is added:

package test;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.ui.forms.widgets.Section;

public class TestComposite extends Composite {
	private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
	private Text txtNewText;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public TestComposite(Composite parent, int style) {
		super(parent, style);
		setLayout(new FormLayout());
		 
		txtNewText = formToolkit.createText(this, "New Text", SWT.NONE);
		FormData fd_txtNewText = new FormData();
		fd_txtNewText.bottom = new FormAttachment(0, 177);
		fd_txtNewText.right = new FormAttachment(0, 265);
		fd_txtNewText.top = new FormAttachment(0, 49);
		fd_txtNewText.left = new FormAttachment(0, 23);
		txtNewText.setLayoutData(fd_txtNewText);
		
		Button btnNewButton = formToolkit.createButton(this, "New Button", SWT.NONE);
		FormData fd_btnNewButton = new FormData();
		fd_btnNewButton.right = new FormAttachment(0, 348);
		fd_btnNewButton.top = new FormAttachment(0, 220);
		fd_btnNewButton.left = new FormAttachment(0, 153);
		btnNewButton.setLayoutData(fd_btnNewButton);
		
		Section section = formToolkit.createSection(this, Section.TWISTIE | Section.TITLE_BAR);
		FormData fd_section = new FormData();
		fd_section.left = new FormAttachment(0, 26);
		fd_section.bottom = new FormAttachment(txtNewText, 378, SWT.BOTTOM);
		fd_section.right = new FormAttachment(0, 568);
		fd_section.top = new FormAttachment(txtNewText, 99);
		section.setLayoutData(fd_section);
		formToolkit.paintBordersFor(section);
		section.setText("New Section");

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}

Adding a Composite to the Section body makes the editor fail.

Image

This error is logged:

Could not retrieve interfaces

org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(347) The type org.eclipse.jface.dialogs.IMessageProvider cannot be resolved. It is indirectly referenced from required type org.eclipse.ui.forms.IMessage
	at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:159)
	at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:226)
	at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:2659)
	at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.isClassPathCorrect(ProblemReporter.java:5012)
	at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:125)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:244)
	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces(BinaryTypeBinding.java:2476)
	at org.eclipse.jdt.core.dom.TypeBinding.getInterfaces(TypeBinding.java:498)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerTypeBinding.<init>(DesignerTypeBinding.java:155)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:71)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:49)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerTypeBinding.<init>(DesignerTypeBinding.java:146)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:71)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:49)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerMethodBinding.<init>(DesignerMethodBinding.java:70)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:88)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerTypeBinding.<init>(DesignerTypeBinding.java:167)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:71)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:49)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerMethodBinding.<init>(DesignerMethodBinding.java:70)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:88)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerTypeBinding.<init>(DesignerTypeBinding.java:167)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:71)
	at org.eclipse.wb.internal.core.utils.ast.binding.DesignerVariableBinding.<init>(DesignerVariableBinding.java:46)
	at org.eclipse.wb.internal.core.utils.ast.binding.BindingContext.get(BindingContext.java:95)
	at org.eclipse.wb.internal.core.utils.ast.AstParser$3.postVisit(AstParser.java:921)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3315)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3360)
	at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:223)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3360)
	at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:136)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
	at org.eclipse.wb.internal.core.utils.ast.AstParser.copyBindings(AstParser.java:911)
	at org.eclipse.wb.internal.core.utils.ast.AstParser.findNode0(AstParser.java:825)
	at org.eclipse.wb.internal.core.utils.ast.AstParser.findNode(AstParser.java:768)
	at org.eclipse.wb.internal.core.utils.ast.AstParser.parseStatement(AstParser.java:160)
	at org.eclipse.wb.internal.core.utils.ast.AstEditor.addStatement(AstEditor.java:1611)
	at org.eclipse.wb.internal.core.utils.ast.AstEditor.addStatement(AstEditor.java:1565)
	at org.eclipse.wb.core.model.JavaInfo.addExpressionStatement(JavaInfo.java:983)
	at org.eclipse.wb.core.model.JavaInfo.addExpressionStatement(JavaInfo.java:971)
	at org.eclipse.wb.internal.rcp.model.forms.FormToolkitJavaInfoParticipator.addToolkitInvocation(FormToolkitJavaInfoParticipator.java:141)
	at org.eclipse.wb.internal.rcp.model.forms.FormToolkitJavaInfoParticipator.support_paintBordersFor(FormToolkitJavaInfoParticipator.java:103)
	at org.eclipse.wb.internal.rcp.model.forms.FormToolkitJavaInfoParticipator$1.addAfter(FormToolkitJavaInfoParticipator.java:75)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.invokeMethod(ReflectionUtils.java:915)
	at org.eclipse.wb.core.model.broadcast.BroadcastSupport.lambda$0(BroadcastSupport.java:213)
	at org.eclipse.wb.core.model.broadcast.JavaEventListener$ByteBuddy$Tr5ZDdud.addAfter(Unknown Source)
	at org.eclipse.wb.internal.core.model.JavaInfoUtils.add(JavaInfoUtils.java:1391)
	at org.eclipse.wb.internal.core.model.JavaInfoUtils.add(JavaInfoUtils.java:1292)
	at org.eclipse.wb.internal.core.model.JavaInfoUtils.add(JavaInfoUtils.java:1222)
	at org.eclipse.wb.internal.rcp.model.widgets.AbstractPositionCompositeInfo.command_CREATE(AbstractPositionCompositeInfo.java:155)
	at org.eclipse.wb.internal.rcp.gef.policy.AbstractPositionCompositeLayoutEditPolicy.command_CREATE(AbstractPositionCompositeLayoutEditPolicy.java:69)
	at org.eclipse.wb.internal.rcp.gef.policy.AbstractPositionCompositeLayoutEditPolicy.command_CREATE(AbstractPositionCompositeLayoutEditPolicy.java:1)
	at org.eclipse.wb.core.gef.policy.layout.position.ObjectPositionLayoutEditPolicy$1.executeEdit(ObjectPositionLayoutEditPolicy.java:53)
	at org.eclipse.wb.core.gef.command.EditCommand.lambda$0(EditCommand.java:52)
	at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.run(ExecutionUtils.java:306)
	at org.eclipse.wb.core.gef.command.EditCommand.execute(EditCommand.java:52)
	at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:231)
	at org.eclipse.wb.internal.gef.core.EditDomain$DesignerCommandStack.execute(EditDomain.java:55)
	at org.eclipse.wb.gef.core.tools.Tool.executeCommand(Tool.java:172)
	at org.eclipse.wb.gef.core.tools.AbstractCreationTool.handleButtonUp(AbstractCreationTool.java:65)
	at org.eclipse.wb.gef.core.tools.Tool.mouseUp(Tool.java:270)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:288)
	at org.eclipse.wb.internal.gef.core.EditDomain.mouseUp(EditDomain.java:233)
	at org.eclipse.wb.internal.gef.graphical.EditEventManager.lambda$2(EditEventManager.java:155)
	at org.eclipse.wb.internal.draw2d.EventManager.delayEvent(EventManager.java:338)
	at org.eclipse.wb.internal.gef.graphical.EditEventManager.dispatchMouseReleased(EditEventManager.java:143)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:598)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4364)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1217)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4162)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3750)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1147)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1038)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:677)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1415)

Code after the Composite is added to the Section body:

package test;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.ui.forms.widgets.Section;

public class TestComposite extends Composite {
	private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
	private Text txtNewText;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public TestComposite(Composite parent, int style) {
		super(parent, style);
		setLayout(new FormLayout());
		 
		txtNewText = formToolkit.createText(this, "New Text", SWT.NONE);
		FormData fd_txtNewText = new FormData();
		fd_txtNewText.bottom = new FormAttachment(0, 177);
		fd_txtNewText.right = new FormAttachment(0, 265);
		fd_txtNewText.top = new FormAttachment(0, 49);
		fd_txtNewText.left = new FormAttachment(0, 23);
		txtNewText.setLayoutData(fd_txtNewText);
		
		Button btnNewButton = formToolkit.createButton(this, "New Button", SWT.NONE);
		FormData fd_btnNewButton = new FormData();
		fd_btnNewButton.right = new FormAttachment(0, 348);
		fd_btnNewButton.top = new FormAttachment(0, 220);
		fd_btnNewButton.left = new FormAttachment(0, 153);
		btnNewButton.setLayoutData(fd_btnNewButton);
		
		Section section = formToolkit.createSection(this, Section.TWISTIE | Section.TITLE_BAR);
		FormData fd_section = new FormData();
		fd_section.left = new FormAttachment(0, 26);
		fd_section.bottom = new FormAttachment(txtNewText, 378, SWT.BOTTOM);
		fd_section.right = new FormAttachment(0, 568);
		fd_section.top = new FormAttachment(txtNewText, 99);
		section.setLayoutData(fd_section);
		formToolkit.paintBordersFor(section);
		section.setText("New Section");
		section.setExpanded(true);
		
		Composite composite = new Composite(section, SWT.NONE);
		formToolkit.adapt(composite);
		formToolkit.paintBordersFor(composite);
		section.setClient(composite);

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}

Adding a Forms Composite has slightly different code but the same outcome.

package test;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.ui.forms.widgets.Section;

public class TestComposite extends Composite {
	private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
	private Text txtNewText;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public TestComposite(Composite parent, int style) {
		super(parent, style);
		setLayout(new FormLayout());
		 
		txtNewText = formToolkit.createText(this, "New Text", SWT.NONE);
		FormData fd_txtNewText = new FormData();
		fd_txtNewText.bottom = new FormAttachment(0, 177);
		fd_txtNewText.right = new FormAttachment(0, 265);
		fd_txtNewText.top = new FormAttachment(0, 49);
		fd_txtNewText.left = new FormAttachment(0, 23);
		txtNewText.setLayoutData(fd_txtNewText);
		
		Button btnNewButton = formToolkit.createButton(this, "New Button", SWT.NONE);
		FormData fd_btnNewButton = new FormData();
		fd_btnNewButton.right = new FormAttachment(0, 348);
		fd_btnNewButton.top = new FormAttachment(0, 220);
		fd_btnNewButton.left = new FormAttachment(0, 153);
		btnNewButton.setLayoutData(fd_btnNewButton);
		
		Section section = formToolkit.createSection(this, Section.TWISTIE | Section.TITLE_BAR);
		FormData fd_section = new FormData();
		fd_section.left = new FormAttachment(0, 26);
		fd_section.bottom = new FormAttachment(txtNewText, 378, SWT.BOTTOM);
		fd_section.right = new FormAttachment(0, 568);
		fd_section.top = new FormAttachment(txtNewText, 99);
		section.setLayoutData(fd_section);
		formToolkit.paintBordersFor(section);
		section.setText("New Section");
		section.setExpanded(true);
		
		Composite composite = formToolkit.createComposite(section, SWT.NONE);
		formToolkit.paintBordersFor(composite);
		section.setClient(composite);

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}

Closing Eclipse and reopening the designer have no effect.

Image

Since the error mentioned jface, I tried adding more jars to the project but that didn't help.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions