diff --git a/org.eclipse.wb.core.java/META-INF/MANIFEST.MF b/org.eclipse.wb.core.java/META-INF/MANIFEST.MF index b451e4298..767949437 100755 --- a/org.eclipse.wb.core.java/META-INF/MANIFEST.MF +++ b/org.eclipse.wb.core.java/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.wb.core.java;singleton:=true -Bundle-Version: 1.13.100.qualifier +Bundle-Version: 1.13.200.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/clipboard/JavaInfoMemento.java b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/clipboard/JavaInfoMemento.java index 427106f73..bf01bfb23 100644 --- a/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/clipboard/JavaInfoMemento.java +++ b/org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/clipboard/JavaInfoMemento.java @@ -18,6 +18,7 @@ import org.eclipse.wb.internal.core.model.creation.CreationSupport; import org.eclipse.wb.internal.core.model.creation.IImplicitCreationSupport; import org.eclipse.wb.internal.core.model.variable.NamesManager; +import org.eclipse.wb.internal.core.model.variable.VariableSupport; import org.eclipse.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.check.Assert; import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils; @@ -239,7 +240,10 @@ private void executeCommands() throws Exception { */ private String getVariableName(JavaInfo javaInfo) { if (javaInfo != null) { - return javaInfo.getVariableSupport().getName(); + VariableSupport variableSupport = javaInfo.getVariableSupport(); + if (variableSupport.hasName()) { + return variableSupport.getName(); + } } return null; } diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/WrapperInfoTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/WrapperInfoTest.java index 90a48070c..d9d71f302 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/WrapperInfoTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/WrapperInfoTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -37,7 +37,6 @@ import org.eclipse.jdt.core.dom.MethodInvocation; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; /** @@ -374,7 +373,6 @@ public void test_MOVE_withControl() throws Exception { "}"); } - @Ignore @Test public void test_clipboard() throws Exception { configureWrapperContents(); @@ -419,8 +417,8 @@ public void test_clipboard() throws Exception { " JPanel panel_2 = new JPanel();", " add(panel_2);", " {", - " TestWrapper testWrapper = new TestWrapper(panel_2);", - " JButton button = testWrapper.getControl();", + " TestWrapper wrapper = new TestWrapper(panel_2);", + " JButton button = wrapper.getControl();", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ConstructorCreationSupportTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ConstructorCreationSupportTest.java index 69231d085..f408a42da 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ConstructorCreationSupportTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ConstructorCreationSupportTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -46,7 +46,6 @@ import org.eclipse.jface.preference.FieldEditor; import org.apache.commons.lang3.ArrayUtils; -import org.junit.Ignore; import org.junit.Test; import javax.swing.JButton; @@ -625,7 +624,6 @@ public void test_clipboard_styleProperty() throws Exception { /** * {@link ConstructorCreationSupport} should include type arguments into clipboard source. */ - @Ignore @Test public void test_clipboard_typeArguments() throws Exception { // prepare generic MyButton @@ -681,8 +679,8 @@ public void run(ComponentInfo copy) throws Exception { " add(button);", " }", " {", - " MyButton myButton = new MyButton();", - " add(myButton);", + " MyButton button = new MyButton();", + " add(button);", " }", " }", "}"); @@ -693,7 +691,6 @@ public void run(ComponentInfo copy) throws Exception { * {@link ConstructorCreationSupport} should support {@link AnonymousClassDeclaration} in * clipboard source. */ - @Ignore @Test public void test_clipboard_anonymousClassDeclaration() throws Exception { // prepare generic MyButton @@ -750,14 +747,14 @@ public void run(ComponentInfo copy) throws Exception { " add(button);", " }", " {", - " MyButton myButton = new MyButton() {", + " MyButton button = new MyButton() {", " protected String myStringMethod(int a, double b, String c) {", " return (String) null;", " }", " protected void myVoidMethod() {", " }", " };", - " add(myButton);", + " add(button);", " }", " }", "}"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ExposedFieldCreationSupportTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ExposedFieldCreationSupportTest.java index 3e8781028..a9485cf1c 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ExposedFieldCreationSupportTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/creation/ExposedFieldCreationSupportTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -26,7 +26,6 @@ import org.eclipse.jdt.core.dom.QualifiedName; import org.eclipse.jdt.core.dom.SimpleName; -import org.junit.Ignore; import org.junit.Test; import javax.swing.JFrame; @@ -624,7 +623,6 @@ public void test_isDirect_false() throws Exception { /** * Test for {@link IClipboardImplicitCreationSupport} implementation. */ - @Ignore @Test public void test_clipboard() throws Exception { setFileContentSrc( @@ -675,9 +673,9 @@ public void test_clipboard() throws Exception { " myPanel_0.m_button.setEnabled(false);", " }", " {", - " MyPanel myPanel = new MyPanel();", - " myPanel.m_button.setEnabled(false);", - " add(myPanel);", + " MyPanel myPanel_0 = new MyPanel();", + " myPanel_0.m_button.setEnabled(false);", + " add(myPanel_0);", " }", " }", "}"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerAbstractGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerAbstractGefTest.java index da2743dec..56bb4b6ba 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerAbstractGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/FlowContainerAbstractGefTest.java @@ -20,7 +20,6 @@ import org.eclipse.draw2d.PositionConstants; import org.eclipse.jface.action.IAction; -import org.junit.Ignore; import org.junit.Test; /** @@ -183,7 +182,6 @@ public Test() { }"""); } - @Ignore @Test public void test_canvas_PASTE() throws Exception { prepareFlowPanel(); @@ -239,8 +237,8 @@ public Test() { FlowPanel panel = new FlowPanel(); add(panel); { - JButton button = new JButton("A"); - panel.add(button); + JButton rootButton = new JButton("A"); + panel.add(rootButton); } { JButton existingButton = new JButton(); @@ -420,7 +418,6 @@ public Test() { }"""); } - @Ignore @Test public void test_tree_PASTE() throws Exception { prepareFlowPanel(); @@ -476,8 +473,8 @@ public Test() { FlowPanel panel = new FlowPanel(); add(panel); { - JButton button = new JButton("A"); - panel.add(button); + JButton rootButton = new JButton("A"); + panel.add(rootButton); } { JButton existingButton = new JButton(); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerAbstractGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerAbstractGefTest.java index ddb1d24ac..d8e3e7a10 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerAbstractGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerAbstractGefTest.java @@ -20,7 +20,6 @@ import org.eclipse.jface.action.IAction; -import org.junit.Ignore; import org.junit.Test; /** @@ -109,7 +108,6 @@ public Test() { canvas.assertPrimarySelected(newButton); } - @Ignore @Test public void test_canvas_PASTE() throws Exception { prepareSimplePanel(); @@ -159,8 +157,8 @@ public Test() { SimplePanel panel = new SimplePanel(); add(panel); { - JButton button = new JButton("A"); - panel.setContent(button); + JButton rootButton = new JButton("A"); + panel.setContent(rootButton); } } { @@ -348,7 +346,6 @@ public Test() { tree.assertPrimarySelected(newButton); } - @Ignore @Test public void test_tree_PASTE() throws Exception { prepareSimplePanel(); @@ -398,8 +395,8 @@ public Test() { SimplePanel panel = new SimplePanel(); add(panel); { - JButton button = new JButton("A"); - panel.setContent(button); + JButton rootButton = new JButton("A"); + panel.setContent(rootButton); } } { diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerModelTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerModelTest.java index e412a30cf..57cd4b9bc 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerModelTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/generic/SimpleContainerModelTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -40,7 +40,6 @@ import static org.mockito.Mockito.when; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; import org.mockito.InOrder; @@ -626,7 +625,6 @@ public void test_MOVE() throws Exception { /** * {@link SimpleContainer} should automatically copy its child into clipboard. */ - @Ignore @Test public void test_clipboard() throws Exception { prepareSimplePanel(); @@ -667,11 +665,11 @@ public void test_clipboard() throws Exception { " }", " }", " {", - " SimplePanel simplePanel = new SimplePanel();", - " add(simplePanel);", + " SimplePanel panel = new SimplePanel();", + " add(panel);", " {", " JButton button = new JButton();", - " simplePanel.setContent(button);", + " panel.setContent(button);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/actions/CopyActionTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/actions/CopyActionTest.java index b696354bc..b5213e32f 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/actions/CopyActionTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/editor/actions/CopyActionTest.java @@ -21,7 +21,6 @@ import org.eclipse.gef.EditPart; import org.eclipse.jface.action.IAction; -import org.junit.Ignore; import org.junit.Test; /** @@ -83,7 +82,6 @@ public Test() { /** * Test for copy/paste single component. */ - @Ignore @Test public void test_copySingle() throws Exception { ContainerInfo panel = openContainer(""" @@ -121,8 +119,8 @@ public Test() { public class Test extends JPanel { public Test() { { - JButton button = new JButton(); - add(button); + JButton btn = new JButton(); + add(btn); } { JButton btn = new JButton(); @@ -137,7 +135,6 @@ public Test() { * If container and its child are selected, then only container should be copied, it will copy * child automatically. */ - @Ignore @Test public void test_copyParentAndItsChild() throws Exception { ContainerInfo panel = openContainer(""" @@ -180,11 +177,11 @@ public Test() { public class Test extends JPanel { public Test() { { - JPanel panel = new JPanel(); - add(panel); + JPanel inner = new JPanel(); + add(inner); { JButton button = new JButton(); - panel.add(button); + inner.add(button); } } { diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutClipboardTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutClipboardTest.java index d99bee2fd..f25d11c1b 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutClipboardTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutClipboardTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -18,7 +18,6 @@ import org.eclipse.wb.internal.swt.model.widgets.CompositeInfo; import org.eclipse.wb.tests.designer.rcp.model.forms.AbstractFormsTest; -import org.junit.Ignore; import org.junit.Test; /** @@ -41,7 +40,6 @@ public void _test_exit() throws Exception { // Tests // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_simpleSingleControl() throws Exception { CompositeInfo shell = @@ -92,9 +90,9 @@ public void test_simpleSingleControl() throws Exception { " {", " Composite composite = new Composite(this, SWT.NONE);", " {", - " TableWrapLayout tableWrapLayout = new TableWrapLayout();", - " tableWrapLayout.topMargin = 20;", - " composite.setLayout(tableWrapLayout);", + " TableWrapLayout layout = new TableWrapLayout();", + " layout.topMargin = 20;", + " composite.setLayout(layout);", " }", " {", " Button button = new Button(composite, SWT.NONE);", @@ -104,7 +102,6 @@ public void test_simpleSingleControl() throws Exception { "}"); } - @Ignore @Test public void test_grid2x2() throws Exception { CompositeInfo shell = @@ -170,9 +167,9 @@ public void test_grid2x2() throws Exception { " {", " Composite composite = new Composite(this, SWT.NONE);", " {", - " TableWrapLayout tableWrapLayout = new TableWrapLayout();", - " tableWrapLayout.numColumns = 2;", - " composite.setLayout(tableWrapLayout);", + " TableWrapLayout layout = new TableWrapLayout();", + " layout.numColumns = 2;", + " composite.setLayout(layout);", " }", " {", " Button button = new Button(composite, SWT.NONE);", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutGefTest.java index 3dfc700c7..b7099a330 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/forms/table/TableWrapLayoutGefTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -24,7 +24,6 @@ import org.eclipse.jface.action.IAction; import org.eclipse.ui.forms.widgets.TableWrapLayout; -import org.junit.Ignore; import org.junit.Test; /** @@ -583,7 +582,6 @@ public void test_CREATE_insertRow() throws Exception { // PASTE // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_PASTE_virtual_1x0() throws Exception { openComposite( @@ -612,8 +610,8 @@ public void test_PASTE_virtual_1x0() throws Exception { " existingButton.setText('My Button');", " }", " {", - " Button button = new Button(this, SWT.NONE);", - " button.setText('My Button');", + " Button existingButton = new Button(this, SWT.NONE);", + " existingButton.setText('My Button');", " }", " }", "}"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/jface/TableViewerColumnTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/jface/TableViewerColumnTest.java index 745591a38..9e817c52c 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/jface/TableViewerColumnTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/jface/TableViewerColumnTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -46,7 +46,6 @@ import static org.mockito.Mockito.verify; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -425,7 +424,6 @@ public void test_normalWithColumn_reparent() throws Exception { // Clipboard // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_copyPaste() throws Exception { CompositeInfo shell = diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/AbsoluteLayoutGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/AbsoluteLayoutGefTest.java index 5d01b26b4..52908269e 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/AbsoluteLayoutGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/AbsoluteLayoutGefTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -20,7 +20,6 @@ import org.eclipse.draw2d.PositionConstants; import org.eclipse.jface.action.IAction; -import org.junit.Ignore; import org.junit.Test; /** @@ -71,7 +70,6 @@ public void test_canvas_CREATE() throws Exception { "}"); } - @Ignore @Test public void test_canvas_PASTE() throws Exception { prepareComponent(); @@ -117,9 +115,9 @@ public void test_canvas_PASTE() throws Exception { " buttonA.setBounds(10, 10, 100, 50);", " }", " {", - " Button button = new Button(this, SWT.NONE);", - " button.setEnabled(false);", - " button.setBounds(50, 100, 100, 50);", + " Button buttonA = new Button(this, SWT.NONE);", + " buttonA.setEnabled(false);", + " buttonA.setBounds(50, 100, 100, 50);", " }", " }", "}"); @@ -260,7 +258,6 @@ public void test_tree_CREATE() throws Exception { tree.assertPrimarySelected(newButton); } - @Ignore @Test public void test_tree_PASTE() throws Exception { prepareComponent(); @@ -306,9 +303,9 @@ public void test_tree_PASTE() throws Exception { " buttonA.setBounds(10, 10, 100, 50);", " }", " {", - " Button button = new Button(this, SWT.NONE);", - " button.setEnabled(false);", - " button.setBounds(0, 0, 100, 50);", + " Button buttonA = new Button(this, SWT.NONE);", + " buttonA.setEnabled(false);", + " buttonA.setBounds(0, 0, 100, 50);", " }", " }", "}"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/StackLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/StackLayoutTest.java index cc735383a..920b41127 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/StackLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/StackLayoutTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -26,7 +26,6 @@ import org.eclipse.swt.custom.StackLayout; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; import java.util.List; @@ -305,7 +304,6 @@ public void test_flowContainer_ADD() throws Exception { // Clipboard // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_clipboard() throws Exception { CompositeInfo shell = @@ -353,13 +351,13 @@ public void test_clipboard() throws Exception { " }", " }", " {", - " Composite composite = new Composite(this, SWT.NONE);", - " composite.setLayout(new StackLayout());", + " Composite c = new Composite(this, SWT.NONE);", + " c.setLayout(new StackLayout());", " {", - " Button button = new Button(composite, SWT.NONE);", + " Button button_1 = new Button(c, SWT.NONE);", " }", " {", - " Button button = new Button(composite, SWT.NONE);", + " Button button_2 = new Button(c, SWT.NONE);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/form/FormLayoutModelsTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/form/FormLayoutModelsTest.java index 0d8c80f1c..97b3d35c8 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/form/FormLayoutModelsTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/layout/form/FormLayoutModelsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -32,7 +32,6 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridLayout; -import org.junit.Ignore; import org.junit.Test; /** @@ -650,7 +649,6 @@ public void test_setExplicitSize() throws Exception { // Test for copy/paste. // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_clipboard() throws Exception { CompositeInfo composite = @@ -707,10 +705,10 @@ public void test_clipboard() throws Exception { " button2.setLayoutData(data);", " }", " {", - " Composite composite = new Composite(this, SWT.NONE);", - " composite.setLayout(new FormLayout());", + " Composite inner_1 = new Composite(this, SWT.NONE);", + " inner_1.setLayout(new FormLayout());", " {", - " Button button = new Button(composite, SWT.NONE);", + " Button button = new Button(inner_1, SWT.NONE);", " {", " FormData formData = new FormData();", " formData.top = new FormAttachment(20);", @@ -719,11 +717,11 @@ public void test_clipboard() throws Exception { " }", " }", " {", - " Button button = new Button(composite, SWT.NONE);", + " Button button2 = new Button(inner_1, SWT.NONE);", " {", " FormData formData = new FormData();", " formData.right = new FormAttachment(100, -10);", - " button.setLayoutData(formData);", + " button2.setLayoutData(formData);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/TreeTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/TreeTest.java index 39d00cf8f..32a07dbd0 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/TreeTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/TreeTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -110,7 +110,6 @@ public void test_TreeColumn() throws Exception { /** * Test for copy/paste {@link TreeColumn}. */ - @Ignore @Test public void test_TreeColumn_copyPaste() throws Exception { CompositeInfo shell = @@ -166,12 +165,12 @@ public void test_TreeColumn_copyPaste() throws Exception { " Tree tree = new Tree(this, SWT.BORDER);", " tree.setHeaderVisible(true);", " {", - " TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);", - " treeColumn.setWidth(50);", + " TreeColumn treeColumn_1 = new TreeColumn(tree, SWT.NONE);", + " treeColumn_1.setWidth(50);", " }", " {", - " TreeColumn treeColumn = new TreeColumn(tree, SWT.RIGHT);", - " treeColumn.setWidth(100);", + " TreeColumn treeColumn_2 = new TreeColumn(tree, SWT.RIGHT);", + " treeColumn_2.setWidth(100);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/ViewFormGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/ViewFormGefTest.java index 7942319ec..3200cc19a 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/ViewFormGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/widgets/ViewFormGefTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,7 +17,6 @@ import org.eclipse.wb.internal.swt.model.widgets.ControlInfo; import org.eclipse.wb.tests.designer.rcp.RcpGefTest; -import org.junit.Ignore; import org.junit.Test; /** @@ -157,7 +156,6 @@ private ViewFormInfo prepare_canvas_CREATE0() throws Exception { // Canvas // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_canvas_PASTE() throws Exception { ViewFormInfo composite = @@ -188,9 +186,9 @@ public void test_canvas_PASTE() throws Exception { " setTopLeft(buttonA);", " }", " {", - " Button button = new Button(this, SWT.NONE);", - " button.setEnabled(false);", - " setTopRight(button);", + " Button buttonA = new Button(this, SWT.NONE);", + " buttonA.setEnabled(false);", + " setTopRight(buttonA);", " }", " }", "}"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ContainerTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ContainerTest.java index 27ed634dd..5c079c897 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ContainerTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ContainerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -40,7 +40,6 @@ import com.jgoodies.forms.layout.FormLayout; import org.apache.commons.lang3.StringUtils; -import org.junit.Ignore; import org.junit.Test; import java.awt.Component; @@ -424,7 +423,6 @@ public void test_setDefaultLayout() throws Exception { /** * Test for copy/paste. */ - @Ignore @Test public void test_clipboard() throws Exception { String[] lines1 = @@ -465,9 +463,9 @@ public void run() throws Exception { " add(inner);", " }", " {", - " JPanel panel = new JPanel();", - " add(panel);", - " panel.setLayout(new GridLayout(1, 0));", + " JPanel inner = new JPanel();", + " add(inner);", + " inner.setLayout(new GridLayout(1, 0));", " }", " }", "}"}; diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSplitPaneTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSplitPaneTest.java index ef32746e5..c00f3f943 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSplitPaneTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSplitPaneTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -22,7 +22,6 @@ import org.eclipse.draw2d.geometry.Insets; import org.eclipse.draw2d.geometry.Rectangle; -import org.junit.Ignore; import org.junit.Test; import javax.swing.JSplitPane; @@ -383,7 +382,6 @@ public void test_ADD() throws Exception { // Clipboard // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_clipboard() throws Exception { final ContainerInfo panel = @@ -431,15 +429,15 @@ public void run(ComponentInfo copy) throws Exception { " }", " }", " {", - " JSplitPane splitPane = new JSplitPane();", - " add(splitPane);", + " JSplitPane split = new JSplitPane();", + " add(split);", " {", " JButton button = new JButton('A');", - " splitPane.setLeftComponent(button);", + " split.setLeftComponent(button);", " }", " {", " JButton button = new JButton('B');", - " splitPane.setRightComponent(button);", + " split.setRightComponent(button);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuBarTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuBarTest.java index c5bd5fee5..804d8a990 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuBarTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuBarTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -31,7 +31,6 @@ import org.eclipse.swt.graphics.ImageData; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; import java.util.List; @@ -393,7 +392,6 @@ public void test_IMenuInfo_MOVE() throws Exception { /** * We can paste {@link JMenuInfo}'s. */ - @Ignore @Test public void test_IMenuInfo_PASTE() throws Exception { ContainerInfo frameInfo = @@ -449,16 +447,16 @@ public void test_IMenuInfo_PASTE() throws Exception { " }", " }", " {", - " JMenu menu = new JMenu('Some menu');", - " menuBar.add(menu);", + " JMenu existingMenu = new JMenu('Some menu');", + " menuBar.add(existingMenu);", " {", - " JMenuItem menuItem = new JMenuItem('Item 1');", - " menuItem.setEnabled(false);", - " menu.add(menuItem);", + " JMenuItem item_1 = new JMenuItem('Item 1');", + " item_1.setEnabled(false);", + " existingMenu.add(item_1);", " }", " {", - " JMenuItem menuItem = new JMenuItem('Item 2');", - " menu.add(menuItem);", + " JMenuItem item_2 = new JMenuItem('Item 2');", + " existingMenu.add(item_2);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuTest.java index de974e7e8..f34c6f78a 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JMenuTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -44,7 +44,6 @@ import org.eclipse.swt.graphics.Image; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; import java.awt.Component; @@ -528,7 +527,6 @@ public void test_IMenuInfo_MOVE() throws Exception { /** * We can paste {@link JMenuItemInfo}'s. */ - @Ignore @Test public void test_IMenuInfo_PASTE() throws Exception { ContainerInfo frameInfo = @@ -574,8 +572,8 @@ public void test_IMenuInfo_PASTE() throws Exception { " menu.add(existingItem);", " }", " {", - " JMenuItem menuItem = new JMenuItem('Some item');", - " menu.add(menuItem);", + " JMenuItem existingItem = new JMenuItem('Some item');", + " menu.add(existingItem);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JPopupMenuTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JPopupMenuTest.java index 3b5d2136d..2f7f16d1d 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JPopupMenuTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/menu/JPopupMenuTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -37,7 +37,6 @@ import org.eclipse.draw2d.geometry.Rectangle; import org.assertj.core.api.Assertions; -import org.junit.Ignore; import org.junit.Test; import java.awt.event.MouseListener; @@ -369,7 +368,6 @@ public void test_MOVE_toTheContainer() throws Exception { /** * Test that we can paste {@link JPopupMenu}. */ - @Ignore @Test public void test_PASTE() throws Exception { ContainerInfo panelInfo = @@ -421,11 +419,11 @@ public void test_PASTE() throws Exception { " JButton button_2 = new JButton();", " add(button_2);", " {", - " JPopupMenu popupMenu = new JPopupMenu();", - " addPopup(button_2, popupMenu);", + " JPopupMenu popup = new JPopupMenu();", + " addPopup(button_2, popup);", " {", " JMenuItem menuItem = new JMenuItem('Some item');", - " popupMenu.add(menuItem);", + " popup.add(menuItem);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutGefTest.java index 829f9f666..2caa318c9 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutGefTest.java @@ -19,7 +19,6 @@ import org.eclipse.jface.action.IAction; -import org.junit.Ignore; import org.junit.Test; /** @@ -42,7 +41,6 @@ public void _test_exit() throws Exception { // Canvas // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_canvas_CREATE() throws Exception { prepareBox(); @@ -71,7 +69,6 @@ public Test() { }"""); } - @Ignore @Test public void test_canvas_PASTE() throws Exception { prepareBox(); @@ -116,9 +113,9 @@ public Test() { add(boxA); } { - Box box = new Box(); - box.setBounds(50, 100, 100, 50); - add(box); + Box boxA = new Box(); + boxA.setBounds(50, 100, 100, 50); + add(boxA); } } }"""); @@ -156,7 +153,6 @@ public Test() { }"""); } - @Ignore @Test public void test_canvas_ADD() throws Exception { prepareBox(); @@ -236,7 +232,6 @@ public Test() { tree.assertPrimarySelected(newBox); } - @Ignore @Test public void test_tree_PASTE() throws Exception { prepareBox(); @@ -281,9 +276,9 @@ public Test() { add(boxA); } { - Box box = new Box(); - box.setBounds(0, 0, 100, 50); - add(box); + Box boxA = new Box(); + boxA.setBounds(0, 0, 100, 50); + add(boxA); } } }"""); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutTest.java index b14bc01b2..3b13ef338 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/AbsoluteLayoutTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -52,7 +52,6 @@ import org.assertj.core.api.Assertions; import org.junit.After; -import org.junit.Ignore; import org.junit.Test; import java.awt.BorderLayout; @@ -1491,7 +1490,6 @@ public void test_BOUNDS_CreationFlow() throws Exception { /** * Test for copy/paste. */ - @Ignore @Test public void test_clipboard() throws Exception { String[] lines1 = @@ -1542,26 +1540,26 @@ public void run() throws Exception { " }", " }", " {", - " JPanel panel = new JPanel();", - " panel.setLayout(null);", - " add(panel);", + " JPanel inner = new JPanel();", + " inner.setLayout(null);", + " add(inner);", " {", " JButton button = new JButton();", " button.setBounds(1, 2, 3, 4);", - " panel.add(button);", + " inner.add(button);", " }", " }", " }", "}"}; assertEditor(lines); assertHierarchy( - "{this: javax.swing.JPanel} {this} {/add(inner)/ /add(panel)/}", + "{this: javax.swing.JPanel} {this} {/add(inner)/ /add(inner)/}", " {implicit-layout: java.awt.FlowLayout} {implicit-layout} {}", " {new: javax.swing.JPanel} {local-unique: inner} {/new JPanel()/ /inner.setLayout(null)/ /add(inner)/ /inner.add(button)/}", " {new: javax.swing.JButton} {local-unique: button} {/new JButton()/ /inner.add(button)/ /button.setBounds(1, 2, 3, 4)/}", " {inner.setLayout(null)} {absolute} {}", - " {new: javax.swing.JPanel} {local-unique: panel} {/new JPanel()/ /add(panel)/ /panel.setLayout(null)/ /panel.add(button)/}", - " {panel.setLayout(null)} {absolute} {}", - " {new: javax.swing.JButton} {local-unique: button} {/new JButton()/ /panel.add(button)/ /button.setBounds(1, 2, 3, 4)/}"); + " {new: javax.swing.JPanel} {local-unique: inner} {/new JPanel()/ /add(inner)/ /inner.setLayout(null)/ /inner.add(button)/}", + " {inner.setLayout(null)} {absolute} {}", + " {new: javax.swing.JButton} {local-unique: button} {/new JButton()/ /inner.add(button)/ /button.setBounds(1, 2, 3, 4)/}"); } } diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutGefTest.java index 02330d1ce..6ba654562 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutGefTest.java @@ -28,7 +28,6 @@ import org.assertj.core.api.Assertions; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import java.awt.GridBagLayout; @@ -872,7 +871,6 @@ public Test() { // PASTE // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_PASTE_virtual_4x2() throws Exception { openPanel(""" @@ -919,8 +917,8 @@ public Test() { add(existing, "2, 2"); } { - JButton button = new JButton("My JButton"); - add(button, "4, 2"); + JButton existing = new JButton("My JButton"); + add(existing, "4, 2"); } } }"""); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutGefTest.java index 7e8450908..81b15f2fc 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutGefTest.java @@ -28,7 +28,6 @@ import org.assertj.core.api.Assertions; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import java.awt.GridBagLayout; @@ -619,7 +618,6 @@ public Test() { // PASTE // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_PASTE_virtual_1x0() throws Exception { openPanel(""" @@ -650,8 +648,8 @@ public Test() { add(existing, "cell 0 0"); } { - JButton button = new JButton("My JButton"); - add(button, "cell 1 0"); + JButton existing = new JButton("My JButton"); + add(existing, "cell 1 0"); } } }"""); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java index 50c7eeced..11b3decb3 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java @@ -672,7 +672,6 @@ public void test_grid_emptyRow() throws Exception { *

* Row "0" has component, but it is spanned two rows, so "0" has zero size. */ - @Ignore @Test public void test_grid_emptyRow_spanned() throws Exception { ContainerInfo panel = @@ -2408,7 +2407,6 @@ public void run() throws Exception { /** * Test for copy/paste {@link JPanel} with {@link GridBagLayout} and children. */ - @Ignore @Test public void test_clipboard() throws Exception { ContainerInfo panel = @@ -2466,20 +2464,20 @@ public void test_clipboard() throws Exception { " }", " }", " {", - " JPanel panel = new JPanel();", - " add(panel);", - " GridBagLayout gridBagLayout = new GridBagLayout();", - " gridBagLayout.columnWidths = new int[]{10, 20, 0};", - " gridBagLayout.rowHeights = new int[]{10, 20, 30, 0};", - " gridBagLayout.columnWeights = new double[]{1.0, 2.0, Double.MIN_VALUE};", - " gridBagLayout.rowWeights = new double[]{1.0, 2.0, 3.0, Double.MIN_VALUE};", - " panel.setLayout(gridBagLayout);", + " JPanel inner = new JPanel();", + " add(inner);", + " GridBagLayout layout = new GridBagLayout();", + " layout.columnWidths = new int[]{10, 20, 0};", + " layout.rowHeights = new int[]{10, 20, 30, 0};", + " layout.columnWeights = new double[]{1.0, 2.0, Double.MIN_VALUE};", + " layout.rowWeights = new double[]{1.0, 2.0, 3.0, Double.MIN_VALUE};", + " inner.setLayout(layout);", " {", " JButton button = new JButton();", " GridBagConstraints gbc = new GridBagConstraints();", " gbc.gridx = 1;", " gbc.gridy = 2;", - " panel.add(button, gbc);", + " inner.add(button, gbc);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/model/FlowLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/model/FlowLayoutTest.java index 9498ce3a4..f42033c6a 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/model/FlowLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/model/FlowLayoutTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -18,7 +18,6 @@ import org.eclipse.wb.internal.swing.model.layout.FlowLayoutInfo; import org.eclipse.wb.tests.designer.swing.model.layout.AbstractLayoutTest; -import org.junit.Ignore; import org.junit.Test; import java.awt.FlowLayout; @@ -432,7 +431,6 @@ private void check_reparenting(String[] lines, String[] expectedLines) throws Ex /** * Test for copy/paste. */ - @Ignore @Test public void test_clipboard() throws Exception { String[] lines1 = @@ -482,15 +480,15 @@ public void test_clipboard() throws Exception { " }", " }", " {", - " JPanel panel = new JPanel();", - " add(panel);", + " JPanel inner = new JPanel();", + " add(inner);", " {", " JButton button = new JButton('A');", - " panel.add(button);", + " inner.add(button);", " }", " {", " JButton button = new JButton('B');", - " panel.add(button);", + " inner.add(button);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java index 591ef7e25..9eb088729 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -702,7 +702,6 @@ private void assertFont(String fontSource, String expectedText, String expectedC // Copy/paste // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_copyPaste_null() throws Exception { String originalSource = "null"; @@ -718,11 +717,10 @@ public void test_copyPaste_explicit() throws Exception { check_copyPaste(originalSource, expectedSource); } - @Ignore @Test public void test_copyPaste_derived() throws Exception { String originalSource = "myLabel.getFont().deriveFont(20f)"; - String expectedSource = "label.getFont().deriveFont(20f)"; + String expectedSource = originalSource; check_copyPaste(originalSource, expectedSource); } @@ -758,9 +756,9 @@ private void check_copyPaste(String originalSource, String expectedSource) throw " add(myLabel);", " }", " {", - " JLabel label = new JLabel();", - " label.setFont(" + expectedSource + ");", - " add(label);", + " JLabel myLabel = new JLabel();", + " myLabel.setFont(" + expectedSource + ");", + " add(myLabel);", " }", " }", "}"}; diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/ClipboardTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/ClipboardTest.java index c6401ba58..aa1161f3a 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/ClipboardTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/ClipboardTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -29,7 +29,6 @@ import org.eclipse.draw2d.geometry.Rectangle; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; /** @@ -381,7 +380,6 @@ public void test_factoryStatic() throws Exception { layouts_doCopy(sourceLines, targetLines); } - @Ignore @Test public void test_viewer_1() throws Exception { String[] sourceLines = @@ -407,9 +405,9 @@ public void test_viewer_1() throws Exception { " viewer.getTable().setHeaderVisible(true);", " }", " {", - " TableViewer tableViewer = new TableViewer(this, SWT.BORDER);", - " tableViewer.setUseHashlookup(true);", - " Table table = tableViewer.getTable();", + " TableViewer viewer = new TableViewer(this, SWT.BORDER);", + " viewer.setUseHashlookup(true);", + " Table table = viewer.getTable();", " table.setHeaderVisible(true);", " }", " }", @@ -464,7 +462,6 @@ public void test_exposedSubComponent() throws Exception { layouts_doCopy(sourceLines, targetLines); } - @Ignore @Test public void test_viewer_2() throws Exception { String[] sourceLines = @@ -494,8 +491,8 @@ public void test_viewer_2() throws Exception { " {", " Table table = new Table(this, SWT.BORDER);", " table.setHeaderVisible(true);", - " TableViewer tableViewer = new TableViewer(table);", - " tableViewer.setUseHashlookup(true);", + " TableViewer viewer = new TableViewer(table);", + " viewer.setUseHashlookup(true);", " }", " }", "}"}; diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/layouts/grid/GridLayoutGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/layouts/grid/GridLayoutGefTest.java index 9800f92b1..1e04595e8 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/layouts/grid/GridLayoutGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/layouts/grid/GridLayoutGefTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -34,7 +34,6 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Control; -import org.junit.Ignore; import org.junit.Test; import java.util.List; @@ -1006,7 +1005,6 @@ public void test_CREATE_inherited_rowOperations() throws Exception { // PASTE // //////////////////////////////////////////////////////////////////////////// - @Ignore @Test public void test_PASTE_virtual_1x0() throws Exception { openPanel( @@ -1035,8 +1033,8 @@ public void test_PASTE_virtual_1x0() throws Exception { " existingButton.setText('My Button');", " }", " {", - " Button button = new Button(this, SWT.NONE);", - " button.setText('My Button');", + " Button existingButton = new Button(this, SWT.NONE);", + " existingButton.setText('My Button');", " }", " }", "}"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuBarPopupTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuBarPopupTest.java index 6288cb5a6..fa3fb654b 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuBarPopupTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuBarPopupTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -20,7 +20,6 @@ import org.eclipse.wb.internal.swt.model.widgets.menu.MenuInfo; import org.eclipse.wb.tests.designer.rcp.RcpGefTest; -import org.junit.Ignore; import org.junit.Test; import java.util.List; @@ -199,7 +198,6 @@ public void test_popupMove_sameControl() throws Exception { /** * Test for copy/paste "popup". */ - @Ignore @Test public void test_popupPaste() throws Exception { CompositeInfo shellInfo = @@ -264,8 +262,8 @@ public void test_popupPaste() throws Exception { " Menu menu = new Menu(button_2);", " button_2.setMenu(menu);", " {", - " MenuItem menuItem = new MenuItem(menu, SWT.NONE);", - " menuItem.setText('My item');", + " MenuItem item = new MenuItem(menu, SWT.NONE);", + " item.setText('My item');", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuComplexTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuComplexTest.java index a0c276bd8..d2ceeabf6 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuComplexTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuComplexTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -27,7 +27,6 @@ import org.eclipse.draw2d.PositionConstants; import org.junit.After; -import org.junit.Ignore; import org.junit.Test; import java.util.List; @@ -775,7 +774,6 @@ public void test_CREATE_bar_notItem() throws Exception { /** * Paste copy of "item" on "bar". */ - @Ignore @Test public void test_PASTE_item() throws Exception { CompositeInfo shellInfo = @@ -813,8 +811,8 @@ public void test_PASTE_item() throws Exception { " Menu bar = new Menu(this, SWT.BAR);", " setMenuBar(bar);", " {", - " MenuItem menuItem = new MenuItem(bar, SWT.NONE);", - " menuItem.setText('item');", + " MenuItem item = new MenuItem(bar, SWT.NONE);", + " item.setText('item');", " }", " {", " MenuItem item = new MenuItem(bar, SWT.NONE);", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuTest.java index bce5bd9e8..ffc75caae 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/menu/MenuTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -42,7 +42,6 @@ import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Shell; -import org.junit.Ignore; import org.junit.Test; import java.util.Collections; @@ -425,7 +424,6 @@ public void test_IMenuInfo_create_3() throws Exception { * Tests for {@link IMenuInfo#validatePaste(Object)} and * {@link IMenuInfo#commandPaste(Object, IMenuItemInfo)}. */ - @Ignore @Test public void test_IMenuInfo_paste_1() throws Exception { CompositeInfo shell = @@ -460,8 +458,8 @@ public void test_IMenuInfo_paste_1() throws Exception { " item.setText('Item');", " }", " {", - " MenuItem menuItem = new MenuItem(menu, SWT.NONE);", - " menuItem.setText('Item');", + " MenuItem item = new MenuItem(menu, SWT.NONE);", + " item.setText('Item');", " }", " }", "}"); @@ -699,7 +697,6 @@ public void run() throws Exception { /** * Test for copy/paste {@link MenuInfo} with {@link MenuItemInfo} and sub-menu. */ - @Ignore @Test public void test_commandPaste() throws Exception { CompositeInfo shell = @@ -768,11 +765,11 @@ public void test_commandPaste() throws Exception { " Menu menu = new Menu(button_2);", " button_2.setMenu(menu);", " {", - " MenuItem menuItem = new MenuItem(menu, SWT.CASCADE);", - " menuItem.setText('My item');", + " MenuItem item = new MenuItem(menu, SWT.CASCADE);", + " item.setText('My item');", " {", - " Menu menu_1 = new Menu(menuItem);", - " menuItem.setMenu(menu_1);", + " Menu subMenu = new Menu(item);", + " item.setMenu(subMenu);", " }", " }", " }", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/widgets/TableTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/widgets/TableTest.java index 6ceb49b4e..69033fb1e 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/widgets/TableTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swt/model/widgets/TableTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -415,7 +415,6 @@ public void test_reparent_TableColumn() throws Exception { "}"); } - @Ignore @Test public void test_clipboard() throws Exception { CompositeInfo shell = @@ -463,12 +462,12 @@ public void test_clipboard() throws Exception { " {", " Table table = new Table(this, SWT.BORDER);", " {", - " TableColumn tableColumn = new TableColumn(table, SWT.NONE);", - " tableColumn.setText('Column 1');", + " TableColumn tableColumn_1 = new TableColumn(table, SWT.NONE);", + " tableColumn_1.setText('Column 1');", " }", " {", - " TableColumn tableColumn = new TableColumn(table, SWT.NONE);", - " tableColumn.setText('Column 2');", + " TableColumn tableColumn_2 = new TableColumn(table, SWT.NONE);", + " tableColumn_2.setText('Column 2');", " }", " }", " }",