From 271d64769a02197c9c838f80a597fff2abfd3f5c Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Thu, 14 May 2026 10:25:20 +0200 Subject: [PATCH] Convert anonymous RunnableEx to lambda expression in Swing component --- .../gef/FormSelectionEditPolicy.java | 18 ++--- .../FormLayout/model/FormLayoutInfo.java | 51 ++++--------- .../FormLayout/model/ui/ColumnsDialog.java | 12 +-- .../swing/FormLayout/model/ui/RowsDialog.java | 12 +-- .../MigLayout/gef/MigSelectionEditPolicy.java | 23 ++---- .../selection/ColumnSelectionEditPolicy.java | 10 +-- .../selection/RowSelectionEditPolicy.java | 10 +-- .../model/CellConstraintsSupport.java | 12 +-- .../swing/MigLayout/model/MigLayoutInfo.java | 35 +++------ .../MigLayout/model/ui/CellEditDialog.java | 17 +---- .../model/ui/DimensionEditDialog.java | 29 +++----- .../MigLayout/model/ui/DimensionsDialog.java | 54 +++++--------- .../databinding/DatabindingsProvider.java | 73 +++++++------------ .../model/bindings/BindingInfo.java | 50 +++++-------- .../swing/customize/CustomizerAction.java | 69 +++++++----------- .../component/box/StrutDirectEditPolicy.java | 10 +-- .../gbl/GridBagSelectionEditPolicy.java | 52 +++++-------- .../wb/internal/swing/laf/LafSupport.java | 12 +-- .../swing/laf/model/PluginLafInfo.java | 12 +-- .../swing/model/bean/AbstractActionInfo.java | 10 +-- .../model/bean/ActionExpressionAccessor.java | 16 +--- .../bean/ActionJavaInfoParticipator.java | 37 ++++------ .../bean/ButtonGroupJavaInfoParticipator.java | 66 +++++++---------- .../swing/model/component/ComponentInfo.java | 9 +-- .../swing/model/component/ContainerInfo.java | 15 +--- .../model/component/JLayeredPaneInfo.java | 10 +-- .../model/component/SwtAwtFrameInfo.java | 10 +-- .../component/top/SwingTopBoundsSupport.java | 23 ++---- .../swing/model/layout/BorderLayoutInfo.java | 16 ++-- .../layout/gbl/AbstractGridBagLayoutInfo.java | 10 +-- .../swing/model/layout/gbl/DimensionInfo.java | 17 ++--- .../layout/gbl/DimensionOperationsColumn.java | 21 ++---- .../layout/gbl/DimensionOperationsRow.java | 21 ++---- .../layout/gbl/ui/DimensionEditDialog.java | 35 ++++----- .../DisplayedMnemonicKeyPropertyEditor.java | 10 +-- .../property/editor/border/BorderDialog.java | 8 +- .../editor/border/BorderPropertyEditor.java | 10 +-- .../border/pages/CompoundBorderComposite.java | 18 ++--- .../editor/font/FontPreviewCanvas.java | 68 ++++++++--------- .../table/TableModelPropertyEditor.java | 10 +-- 40 files changed, 336 insertions(+), 665 deletions(-) diff --git a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/gef/FormSelectionEditPolicy.java b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/gef/FormSelectionEditPolicy.java index b86f718ed8..e45de61087 100644 --- a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/gef/FormSelectionEditPolicy.java +++ b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/gef/FormSelectionEditPolicy.java @@ -20,7 +20,6 @@ import org.eclipse.wb.gef.core.requests.KeyRequest; import org.eclipse.wb.gef.graphical.policies.SelectionEditPolicy; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.FormLayout.model.CellConstraintsSupport; import org.eclipse.wb.internal.swing.FormLayout.model.FormLayoutInfo; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; @@ -202,17 +201,14 @@ public void performRequest(Request request) { * Sets the horizontal/vertical alignment. */ private void setAlignment(final boolean horizontal, final Alignment alignment) { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - CellConstraintsSupport support = FormLayoutInfo.getConstraints(m_component); - if (horizontal) { - support.setAlignH(alignment); - } else { - support.setAlignV(alignment); - } - support.write(); + ExecutionUtils.run(m_layout, () -> { + CellConstraintsSupport support = FormLayoutInfo.getConstraints(m_component); + if (horizontal) { + support.setAlignH(alignment); + } else { + support.setAlignV(alignment); } + support.write(); }); } } diff --git a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/FormLayoutInfo.java b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/FormLayoutInfo.java index 4b3b7143ce..dca6f3b444 100644 --- a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/FormLayoutInfo.java +++ b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/FormLayoutInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.check.Assert; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.jdt.core.CodeUtils; import org.eclipse.wb.internal.swing.FormLayout.Activator; import org.eclipse.wb.internal.swing.FormLayout.model.ui.ColumnsDialog; @@ -316,18 +315,13 @@ public void setRows(List rows) throws Exception { */ public Dimension getMinimumSize() { final Dimension size = new Dimension(0, 0); - ExecutionUtils.runLog(new RunnableEx() { + ExecutionUtils.runLog(() -> visitComponents(new FormComponentVisitor() { @Override - public void run() throws Exception { - visitComponents(new FormComponentVisitor() { - @Override - public void visit(ComponentInfo component, CellConstraintsSupport cell) throws Exception { - size.width = Math.max(size.width, cell.x + cell.width - 1); - size.height = Math.max(size.height, cell.y + cell.height - 1); - } - }); + public void visit(ComponentInfo component, CellConstraintsSupport cell) throws Exception { + size.width = Math.max(size.width, cell.x + cell.width - 1); + size.height = Math.max(size.height, cell.y + cell.height - 1); } - }); + })); return size; } @@ -336,17 +330,12 @@ public void visit(ComponentInfo component, CellConstraintsSupport cell) throws E */ public int[] getColumnComponentsCounts() throws Exception { final int[] counts = new int[m_columns.size()]; - ExecutionUtils.runRethrow(new RunnableEx() { + ExecutionUtils.runRethrow(() -> visitComponents(new FormComponentVisitor() { @Override - public void run() throws Exception { - visitComponents(new FormComponentVisitor() { - @Override - public void visit(ComponentInfo component, CellConstraintsSupport cell) throws Exception { - counts[cell.x - 1]++; - } - }); + public void visit(ComponentInfo component, CellConstraintsSupport cell) throws Exception { + counts[cell.x - 1]++; } - }); + })); return counts; } @@ -355,17 +344,12 @@ public void visit(ComponentInfo component, CellConstraintsSupport cell) throws E */ public int[] getRowComponentsCounts() throws Exception { final int[] counts = new int[m_rows.size()]; - ExecutionUtils.runRethrow(new RunnableEx() { + ExecutionUtils.runRethrow(() -> visitComponents(new FormComponentVisitor() { @Override - public void run() throws Exception { - visitComponents(new FormComponentVisitor() { - @Override - public void visit(ComponentInfo component, CellConstraintsSupport cell) throws Exception { - counts[cell.y - 1]++; - } - }); + public void visit(ComponentInfo component, CellConstraintsSupport cell) throws Exception { + counts[cell.y - 1]++; } - }); + })); return counts; } @@ -1502,12 +1486,7 @@ protected void refresh_afterCreate2() throws Exception { */ public IGridInfo getGridInfo() { if (m_gridInfo == null) { - ExecutionUtils.runRethrow(new RunnableEx() { - @Override - public void run() throws Exception { - createGridInfo(); - } - }); + ExecutionUtils.runRethrow(this::createGridInfo); } return m_gridInfo; } diff --git a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/ColumnsDialog.java b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/ColumnsDialog.java index fbd38d14ed..c967b81f2b 100644 --- a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/ColumnsDialog.java +++ b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/ColumnsDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.FormLayout.model.ui; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.FormLayout.model.FormColumnInfo; import org.eclipse.wb.internal.swing.FormLayout.model.FormLayoutInfo; import org.eclipse.wb.internal.swing.FormLayout.model.ModelMessages; @@ -52,12 +51,9 @@ public ColumnsDialog(Shell parentShell, FormLayoutInfo layout) { */ private static List createColumnsCopy(final FormLayoutInfo layout) { final List columns = new ArrayList<>(); - ExecutionUtils.runRethrow(new RunnableEx() { - @Override - public void run() throws Exception { - for (FormColumnInfo column : layout.getColumns()) { - columns.add(column.copy()); - } + ExecutionUtils.runRethrow(() -> { + for (FormColumnInfo column : layout.getColumns()) { + columns.add(column.copy()); } }); return columns; diff --git a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/RowsDialog.java b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/RowsDialog.java index 7dfdc4c2b0..586970ed61 100644 --- a/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/RowsDialog.java +++ b/org.eclipse.wb.swing.FormLayout/src/org/eclipse/wb/internal/swing/FormLayout/model/ui/RowsDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.FormLayout.model.ui; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.FormLayout.model.FormLayoutInfo; import org.eclipse.wb.internal.swing.FormLayout.model.FormRowInfo; import org.eclipse.wb.internal.swing.FormLayout.model.ModelMessages; @@ -52,12 +51,9 @@ public RowsDialog(Shell parentShell, FormLayoutInfo layout) { */ private static List createRowsCopy(final FormLayoutInfo layout) { final List rows = new ArrayList<>(); - ExecutionUtils.runRethrow(new RunnableEx() { - @Override - public void run() throws Exception { - for (FormRowInfo row : layout.getRows()) { - rows.add(row.copy()); - } + ExecutionUtils.runRethrow(() -> { + for (FormRowInfo row : layout.getRows()) { + rows.add(row.copy()); } }); return rows; diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/MigSelectionEditPolicy.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/MigSelectionEditPolicy.java index 40d4185b87..7d60bafd33 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/MigSelectionEditPolicy.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/MigSelectionEditPolicy.java @@ -20,7 +20,6 @@ import org.eclipse.wb.gef.core.requests.KeyRequest; import org.eclipse.wb.gef.graphical.policies.SelectionEditPolicy; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.MigLayout.model.CellConstraintsSupport; import org.eclipse.wb.internal.swing.MigLayout.model.MigColumnInfo; import org.eclipse.wb.internal.swing.MigLayout.model.MigLayoutInfo; @@ -205,13 +204,10 @@ public void performRequest(Request request) { * Sets the horizontal alignment. */ private void setAlignment(final MigColumnInfo.Alignment alignment) { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - CellConstraintsSupport constraints = MigLayoutInfo.getConstraints(m_component); - constraints.setHorizontalAlignment(alignment); - constraints.write(); - } + ExecutionUtils.run(m_layout, () -> { + CellConstraintsSupport constraints = MigLayoutInfo.getConstraints(m_component); + constraints.setHorizontalAlignment(alignment); + constraints.write(); }); } @@ -219,13 +215,10 @@ public void run() throws Exception { * Sets the vertical alignment. */ private void setAlignment(final MigRowInfo.Alignment alignment) { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - CellConstraintsSupport constraints = MigLayoutInfo.getConstraints(m_component); - constraints.setVerticalAlignment(alignment); - constraints.write(); - } + ExecutionUtils.run(m_layout, () -> { + CellConstraintsSupport constraints = MigLayoutInfo.getConstraints(m_component); + constraints.setVerticalAlignment(alignment); + constraints.write(); }); } } diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/ColumnSelectionEditPolicy.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/ColumnSelectionEditPolicy.java index 916a0e539f..2f830c4ebf 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/ColumnSelectionEditPolicy.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/ColumnSelectionEditPolicy.java @@ -18,7 +18,6 @@ import org.eclipse.wb.gef.graphical.policies.SelectionEditPolicy; import org.eclipse.wb.gef.graphical.tools.ResizeTracker; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.MigLayout.gef.header.edit.ColumnHeaderEditPart; import org.eclipse.wb.internal.swing.MigLayout.model.MigColumnInfo; import org.eclipse.wb.internal.swing.MigLayout.model.MigLayoutInfo; @@ -103,12 +102,9 @@ public void performRequest(Request request) { */ private void setAlignment(final MigColumnInfo.Alignment alignment) { final MigLayoutInfo layout = getLayout(); - ExecutionUtils.run(layout, new RunnableEx() { - @Override - public void run() throws Exception { - getDimension().setAlignment(alignment); - layout.writeDimensions(); - } + ExecutionUtils.run(layout, () -> { + getDimension().setAlignment(alignment); + layout.writeDimensions(); }); } } diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/RowSelectionEditPolicy.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/RowSelectionEditPolicy.java index b9d6b62e01..62a0f0a4c0 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/RowSelectionEditPolicy.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/gef/header/selection/RowSelectionEditPolicy.java @@ -18,7 +18,6 @@ import org.eclipse.wb.gef.graphical.policies.SelectionEditPolicy; import org.eclipse.wb.gef.graphical.tools.ResizeTracker; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.MigLayout.gef.header.edit.RowHeaderEditPart; import org.eclipse.wb.internal.swing.MigLayout.model.MigLayoutInfo; import org.eclipse.wb.internal.swing.MigLayout.model.MigRowInfo; @@ -101,12 +100,9 @@ public void performRequest(Request request) { */ private void setAlignment(final MigRowInfo.Alignment alignment) { final MigLayoutInfo layout = getLayout(); - ExecutionUtils.run(layout, new RunnableEx() { - @Override - public void run() throws Exception { - getDimension().setAlignment(alignment); - layout.writeDimensions(); - } + ExecutionUtils.run(layout, () -> { + getDimension().setAlignment(alignment); + layout.writeDimensions(); }); } } diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/CellConstraintsSupport.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/CellConstraintsSupport.java index d9cacd269b..0c42dea64e 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/CellConstraintsSupport.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/CellConstraintsSupport.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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.wb.internal.core.model.util.ObjectInfoAction; import org.eclipse.wb.internal.core.utils.ast.AstNodeUtils; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils; import org.eclipse.wb.internal.core.utils.ui.UiUtils; import org.eclipse.wb.internal.swing.MigLayout.model.ui.CellEditDialog; @@ -707,12 +706,9 @@ public final void setValue(Object value) throws Exception { } private void doSetValue(final Object value) { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - ReflectionUtils.invokeMethod(m_this, m_setterSignature, value); - write(); - } + ExecutionUtils.run(m_layout, () -> { + ReflectionUtils.invokeMethod(m_this, m_setterSignature, value); + write(); }); } diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/MigLayoutInfo.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/MigLayoutInfo.java index 19906b3a9f..cc554e5d8f 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/MigLayoutInfo.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/MigLayoutInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -35,7 +35,6 @@ 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.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.MigLayout.Activator; import org.eclipse.wb.internal.swing.MigLayout.model.ui.CellConstraintsAssistantPage; import org.eclipse.wb.internal.swing.MigLayout.model.ui.ColumnsDialog; @@ -98,12 +97,7 @@ public MigLayoutInfo(AstEditor editor, CreationSupport creationSupport) throws Exception { super(editor, description, creationSupport); // force UnitValue initialization in "design time", to be able to get strings for alignments - ExecutionUtils.runDesignTime(new RunnableEx() { - @Override - public void run() throws Exception { - IDEUtil.LEFT.toString(); - } - }); + ExecutionUtils.runDesignTime(IDEUtil.LEFT::toString); } //////////////////////////////////////////////////////////////////////////// @@ -1137,20 +1131,14 @@ private interface MigComponentVisitor { * Visits grid {@link ComponentInfo}'s of this {@link ContainerInfo}. */ private void visitGridComponents(final MigComponentVisitor visitor) { - ExecutionUtils.runRethrow(new RunnableEx() { + ExecutionUtils.runRethrow(() -> visitAllComponents(new MigComponentVisitor() { @Override - public void run() throws Exception { - visitAllComponents(new MigComponentVisitor() { - @Override - public void visit(ComponentInfo component, CellConstraintsSupport constraints) - throws Exception { - if (constraints.getDockSide() == null) { - visitor.visit(component, constraints); - } - } - }); + public void visit(ComponentInfo component, CellConstraintsSupport constraints) throws Exception { + if (constraints.getDockSide() == null) { + visitor.visit(component, constraints); + } } - }); + })); } /** @@ -1306,12 +1294,7 @@ protected void refresh_fetch() throws Exception { */ public IGridInfo getGridInfo() { if (m_gridInfo == null) { - ExecutionUtils.runRethrow(new RunnableEx() { - @Override - public void run() throws Exception { - createGridInfo(); - } - }); + ExecutionUtils.runRethrow(this::createGridInfo); } return m_gridInfo; } diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/CellEditDialog.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/CellEditDialog.java index 6220b0c826..d4368cd7fe 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/CellEditDialog.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/CellEditDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.MigLayout.model.ui; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.ui.GridDataFactory; import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory; import org.eclipse.wb.internal.core.utils.ui.dialogs.ResizableDialog; @@ -115,24 +114,14 @@ private void updateButtons(boolean valid) { * Saves {@link CellConstraintsSupport} changes into source and refreshes GUI. */ private void commitChanges() { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - m_cell.write(); - } - }); + ExecutionUtils.run(m_layout, m_cell::write); } /** * Rolls back changes in {@link CellConstraintsSupport}. */ private void rollbackChanges() { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - m_cell.setString(m_cellString); - } - }); + ExecutionUtils.runLog(() -> m_cell.setString(m_cellString)); } //////////////////////////////////////////////////////////////////////////// diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionEditDialog.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionEditDialog.java index f55e177402..37f43b9460 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionEditDialog.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionEditDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -14,7 +14,6 @@ import org.eclipse.wb.core.controls.Separator; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.ui.GridDataFactory; import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory; import org.eclipse.wb.internal.core.utils.ui.dialogs.ResizableDialog; @@ -178,30 +177,22 @@ private void updateButtons(boolean valid) { * Saves current {@link DimensionInfo} changes into source and refreshes GUI. */ private void applyChanges() throws Exception { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - m_layout.writeDimensions(); - } - }); + ExecutionUtils.run(m_layout, m_layout::writeDimensions); } /** * Sets the {@link DimensionInfo} to edit. */ private void setEditDimension(final T dimension) { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - // apply changes - if (m_dimension != null) { - applyChanges(); - } - // remember new dimension - m_dimension = dimension; - m_dimensionString = m_dimension.getString(false); - m_currentIndex = m_dimensions.indexOf(m_dimension); + ExecutionUtils.runLog(() -> { + // apply changes + if (m_dimension != null) { + applyChanges(); } + // remember new dimension + m_dimension = dimension; + m_dimensionString = m_dimension.getString(false); + m_currentIndex = m_dimensions.indexOf(m_dimension); }); } diff --git a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionsDialog.java b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionsDialog.java index 8b8de10cf7..bdc8a72d4a 100644 --- a/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionsDialog.java +++ b/org.eclipse.wb.swing.MigLayout/src/org/eclipse/wb/internal/swing/MigLayout/model/ui/DimensionsDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -211,14 +211,11 @@ public void handleEvent(Event event) { @Override public void handleEvent(Event event) { final AtomicInteger lastIndex = new AtomicInteger(); - applyChanges(new RunnableEx() { - @Override - public void run() throws Exception { - Iterable selectedDimensions = GenericsUtils.iterable(m_viewer.getSelection()); - for (T dimension : selectedDimensions) { - lastIndex.set(dimension.getIndex()); - dimension.delete(); - } + applyChanges(() -> { + Iterable selectedDimensions = GenericsUtils.iterable(m_viewer.getSelection()); + for (T dimension : selectedDimensions) { + lastIndex.set(dimension.getIndex()); + dimension.delete(); } }); // set selection @@ -235,12 +232,9 @@ public void run() throws Exception { createButton(composite, ModelMessages.DimensionsDialog_moveUpButton, new Listener() { @Override public void handleEvent(Event event) { - applyChanges(new RunnableEx() { - @Override - public void run() throws Exception { - Iterable selectedDimensions = GenericsUtils.iterable(m_viewer.getSelection()); - moveDimensionsUp(selectedDimensions); - } + applyChanges(() -> { + Iterable selectedDimensions = GenericsUtils.iterable(m_viewer.getSelection()); + moveDimensionsUp(selectedDimensions); }); updateButtons(); } @@ -249,12 +243,9 @@ public void run() throws Exception { createButton(composite, ModelMessages.DimensionsDialog_moveDownButton, new Listener() { @Override public void handleEvent(Event event) { - applyChanges(new RunnableEx() { - @Override - public void run() throws Exception { - Iterable selectedDimensions = GenericsUtils.iterable(m_viewer.getSelection()); - moveDimensionsDown(selectedDimensions); - } + applyChanges(() -> { + Iterable selectedDimensions = GenericsUtils.iterable(m_viewer.getSelection()); + moveDimensionsDown(selectedDimensions); }); updateButtons(); } @@ -307,12 +298,7 @@ private void updateButtons() { private void addNewDimension(int indexOffset) { // add new dimension final int index = addNewDimension_getIndex(indexOffset); - applyChanges(new RunnableEx() { - @Override - public void run() throws Exception { - createNewDimension(index); - } - }); + applyChanges(() -> createNewDimension(index)); m_viewer.getTable().setSelection(index); // edit it editSelectedDimension(); @@ -333,10 +319,7 @@ private int addNewDimension_getIndex(int indexOffset) { private void editSelectedDimension() { T dimension = GenericsUtils.first(m_viewer.getSelection()); editSelectedDimension(dimension); - applyChanges(new RunnableEx() { - @Override - public void run() throws Exception { - } + applyChanges(() -> { }); } @@ -344,12 +327,9 @@ public void run() throws Exception { * Applies changes in {@link MigDimensionInfo}-s. */ private void applyChanges(final RunnableEx runnable) { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - runnable.run(); - m_layout.writeDimensions(); - } + ExecutionUtils.run(m_layout, () -> { + runnable.run(); + m_layout.writeDimensions(); }); m_viewer.refresh(); } diff --git a/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/DatabindingsProvider.java b/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/DatabindingsProvider.java index 1ae970c73e..62f0e770d5 100644 --- a/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/DatabindingsProvider.java +++ b/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/DatabindingsProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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.wb.internal.core.model.JavaInfoUtils; import org.eclipse.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.external.ExternalFactoriesHelper; import org.eclipse.wb.internal.swing.databinding.model.DataBindingsRootInfo; import org.eclipse.wb.internal.swing.databinding.model.JavaInfoDecorator; @@ -538,12 +537,9 @@ public void addBinding(final IBindingInfo ibinding) { // add getBindings().add(ibinding); // post process - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - BindingInfo binding = (BindingInfo) ibinding; - binding.create(m_rootInfo.getBindings()); - } + ExecutionUtils.runLog(() -> { + BindingInfo binding = (BindingInfo) ibinding; + binding.create(m_rootInfo.getBindings()); }); // save saveEdit(); @@ -552,12 +548,9 @@ public void run() throws Exception { @Override public void editBinding(final IBindingInfo ibinding) { // edit - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - BindingInfo binding = (BindingInfo) ibinding; - binding.edit(m_rootInfo.getBindings()); - } + ExecutionUtils.runLog(() -> { + BindingInfo binding = (BindingInfo) ibinding; + binding.edit(m_rootInfo.getBindings()); }); // save saveEdit(); @@ -566,14 +559,11 @@ public void run() throws Exception { @Override public void deleteBinding(final IBindingInfo ibinding) { // delete - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - BindingInfo binding = (BindingInfo) ibinding; - if (binding.delete(m_rootInfo.getBindings())) { - binding.postDelete(); - getBindings().remove(binding); - } + ExecutionUtils.runLog(() -> { + BindingInfo binding = (BindingInfo) ibinding; + if (binding.delete(m_rootInfo.getBindings())) { + binding.postDelete(); + getBindings().remove(binding); } }); // save @@ -583,12 +573,9 @@ public void run() throws Exception { @Override public void deleteAllBindings() { // delete all - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - for (BindingInfo binding : m_rootInfo.getBindings()) { - binding.postDelete(); - } + ExecutionUtils.runLog(() -> { + for (BindingInfo binding : m_rootInfo.getBindings()) { + binding.postDelete(); } }); getBindings().clear(); @@ -698,29 +685,21 @@ public void refreshDesigner() { @Override public void saveEdit() { final boolean[] reparse = new boolean[1]; - ExecutionUtils.run(m_javaInfoRoot, new RunnableEx() { - @Override - public void run() throws Exception { - try { - m_rootInfo.preCommit(); - reparse[0] = m_rootInfo.commit(); - } finally { - m_rootInfo.postCommit(); - } - // check reparse - if (reparse[0]) { - BindingDesignPage.handleReparse(m_bindingPage, m_javaInfoRoot); - } + ExecutionUtils.run(m_javaInfoRoot, () -> { + try { + m_rootInfo.preCommit(); + reparse[0] = m_rootInfo.commit(); + } finally { + m_rootInfo.postCommit(); + } + // check reparse + if (reparse[0]) { + BindingDesignPage.handleReparse(m_bindingPage, m_javaInfoRoot); } }); // check synchronize if (!reparse[0]) { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - synchronizeObserves(); - } - }); + ExecutionUtils.runLog(this::synchronizeObserves); } } } \ No newline at end of file diff --git a/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/model/bindings/BindingInfo.java b/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/model/bindings/BindingInfo.java index bf1101d032..9ee19c1d62 100644 --- a/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/model/bindings/BindingInfo.java +++ b/org.eclipse.wb.swing.databinding/src/org/eclipse/wb/internal/swing/databinding/model/bindings/BindingInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -35,7 +35,6 @@ import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.check.Assert; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.databinding.DatabindingsProvider; import org.eclipse.wb.internal.swing.databinding.Messages; import org.eclipse.wb.internal.swing.databinding.model.ObserveInfo; @@ -285,42 +284,33 @@ protected final void setVariableIdentifier(final JavaInfo javaInfoRoot, final TypeDeclaration rootNode = JavaInfoUtils.getTypeDeclaration(javaInfoRoot); // if (!oldFieldState && newFieldState) { - ExecutionUtils.run(javaInfoRoot, new RunnableEx() { - @Override - public void run() throws Exception { - BodyDeclarationTarget fieldTarget = new BodyDeclarationTarget(rootNode, null, true); - javaInfoRoot.getEditor().addFieldDeclaration( - "private " + type + " " + newVariable + ";", - fieldTarget); - } + ExecutionUtils.run(javaInfoRoot, () -> { + BodyDeclarationTarget fieldTarget = new BodyDeclarationTarget(rootNode, null, true); + javaInfoRoot.getEditor().addFieldDeclaration( + "private " + type + " " + newVariable + ";", + fieldTarget); }); } else if (oldFieldState && !newFieldState) { - ExecutionUtils.run(javaInfoRoot, new RunnableEx() { - @Override - public void run() throws Exception { - for (FieldDeclaration field : rootNode.getFields()) { - VariableDeclarationFragment fragment = DomGenerics.fragments(field).get(0); - if (fragment.getName().getIdentifier().equals(oldVariable)) { - javaInfoRoot.getEditor().removeBodyDeclaration(field); - return; - } + ExecutionUtils.run(javaInfoRoot, () -> { + for (FieldDeclaration field : rootNode.getFields()) { + VariableDeclarationFragment fragment = DomGenerics.fragments(field).get(0); + if (fragment.getName().getIdentifier().equals(oldVariable)) { + javaInfoRoot.getEditor().removeBodyDeclaration(field); + return; } - Assert.fail(MessageFormat.format(Messages.BindingInfo_undefinedField, oldVariable)); } + Assert.fail(MessageFormat.format(Messages.BindingInfo_undefinedField, oldVariable)); }); } else if (oldFieldState && newFieldState) { - ExecutionUtils.run(javaInfoRoot, new RunnableEx() { - @Override - public void run() throws Exception { - for (FieldDeclaration field : rootNode.getFields()) { - VariableDeclarationFragment fragment = DomGenerics.fragments(field).get(0); - if (fragment.getName().getIdentifier().equals(oldVariable)) { - javaInfoRoot.getEditor().setIdentifier(fragment.getName(), newVariable); - return; - } + ExecutionUtils.run(javaInfoRoot, () -> { + for (FieldDeclaration field : rootNode.getFields()) { + VariableDeclarationFragment fragment = DomGenerics.fragments(field).get(0); + if (fragment.getName().getIdentifier().equals(oldVariable)) { + javaInfoRoot.getEditor().setIdentifier(fragment.getName(), newVariable); + return; } - Assert.fail(MessageFormat.format(Messages.BindingInfo_undefinedField, oldVariable)); } + Assert.fail(MessageFormat.format(Messages.BindingInfo_undefinedField, oldVariable)); }); } } catch (Throwable e) { diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java index e1e1b25b67..2b01aeefc0 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/customize/CustomizerAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -70,17 +70,7 @@ public void run() { // //////////////////////////////////////////////////////////////////////////// private void performCustomize() { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - ExecutionUtils.runDesignTime(new RunnableEx() { - @Override - public void run() throws Exception { - performCustomize0(); - } - }); - } - }); + ExecutionUtils.runLog(() -> ExecutionUtils.runDesignTime(this::performCustomize0)); } private void performCustomize0() throws Exception { @@ -116,34 +106,28 @@ public void propertyChange(PropertyChangeEvent event) { RunnableEx runnable = null; if (explicit) { // update changed properties - runnable = new RunnableEx() { - @Override - public void run() throws Exception { - int size = javaInfoState.properties.size(); - for (int i = 0; i < size; i++) { - Property property = javaInfoState.properties.get(i); - if (javaInfoState.changedProperties.contains(property.getTitle())) { - Object newValue = javaInfoState.changedPropertyValues.get(property.getTitle()); - Object oldValue = javaInfoState.oldValues.get(i); - if (!Objects.equals(newValue, oldValue)) { - property.setValue(newValue); - } + runnable = () -> { + int size = javaInfoState.properties.size(); + for (int i = 0; i < size; i++) { + Property property = javaInfoState.properties.get(i); + if (javaInfoState.changedProperties.contains(property.getTitle())) { + Object newValue = javaInfoState.changedPropertyValues.get(property.getTitle()); + Object oldValue = javaInfoState.oldValues.get(i); + if (!Objects.equals(newValue, oldValue)) { + property.setValue(newValue); } } } }; } else { // update all properties - runnable = new RunnableEx() { - @Override - public void run() throws Exception { - int size = javaInfoState.properties.size(); - for (int i = 0; i < size; i++) { - Object newValue = javaInfoState.getters.get(i).invoke(javaInfoState.object); - Object oldValue = javaInfoState.oldValues.get(i); - if (!Objects.equals(newValue, oldValue)) { - javaInfoState.properties.get(i).setValue(newValue); - } + runnable = () -> { + int size = javaInfoState.properties.size(); + for (int i = 0; i < size; i++) { + Object newValue = javaInfoState.getters.get(i).invoke(javaInfoState.object); + Object oldValue = javaInfoState.oldValues.get(i); + if (!Objects.equals(newValue, oldValue)) { + javaInfoState.properties.get(i).setValue(newValue); } } }; @@ -153,16 +137,13 @@ public void run() throws Exception { } // rollback property changes if (dialogResult == Window.CANCEL) { - ExecutionUtils.run(m_javaInfo, new RunnableEx() { - @Override - public void run() throws Exception { - int size = javaInfoState.properties.size(); - for (int i = 0; i < size; i++) { - Object newValue = javaInfoState.getters.get(i).invoke(javaInfoState.object); - Object oldValue = javaInfoState.oldValues.get(i); - if (!Objects.equals(newValue, oldValue)) { - javaInfoState.setters.get(i).invoke(javaInfoState.object, oldValue); - } + ExecutionUtils.run(m_javaInfo, () -> { + int size = javaInfoState.properties.size(); + for (int i = 0; i < size; i++) { + Object newValue = javaInfoState.getters.get(i).invoke(javaInfoState.object); + Object oldValue = javaInfoState.oldValues.get(i); + if (!Objects.equals(newValue, oldValue)) { + javaInfoState.setters.get(i).invoke(javaInfoState.object, oldValue); } } }); diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/component/box/StrutDirectEditPolicy.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/component/box/StrutDirectEditPolicy.java index e1246e8e42..0cfdac8e65 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/component/box/StrutDirectEditPolicy.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/component/box/StrutDirectEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -15,7 +15,6 @@ import org.eclipse.wb.gef.core.requests.KeyRequest; import org.eclipse.wb.gef.graphical.policies.DirectTextEditPolicy; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.gef.part.box.BoxStrutHorizontalEditPart; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import org.eclipse.wb.internal.swing.model.layout.BoxSupport; @@ -64,12 +63,7 @@ protected final void setText(String text) { return; } // set source - ExecutionUtils.run(m_strut, new RunnableEx() { - @Override - public void run() throws Exception { - BoxSupport.setStrutSize(m_strut, source); - } - }); + ExecutionUtils.run(m_strut, () -> BoxSupport.setStrutSize(m_strut, source)); } @Override diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/gbl/GridBagSelectionEditPolicy.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/gbl/GridBagSelectionEditPolicy.java index 8508405fc9..95c25383e1 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/gbl/GridBagSelectionEditPolicy.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/gbl/GridBagSelectionEditPolicy.java @@ -244,14 +244,11 @@ public void performRequest(Request request) { * Sets grab/fill for both dimensions. */ private void setFillBoth() { - execute(new RunnableEx() { - @Override - public void run() throws Exception { - AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); - constraints.getColumn().setWeight(1.0); - constraints.getRow().setWeight(1.0); - constraints.setAlignment(ColumnInfo.Alignment.FILL, RowInfo.Alignment.FILL); - } + execute(() -> { + AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); + constraints.getColumn().setWeight(1.0); + constraints.getRow().setWeight(1.0); + constraints.setAlignment(ColumnInfo.Alignment.FILL, RowInfo.Alignment.FILL); }); } @@ -259,19 +256,16 @@ public void run() throws Exception { * Flips horizontal/vertical grab. */ private void flipGrab(final boolean horizontal) { - execute(new RunnableEx() { - @Override - public void run() throws Exception { - AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); - DimensionInfo dimension; - if (horizontal) { - dimension = constraints.getColumn(); - } else { - dimension = constraints.getRow(); - } - double weight = dimension.getWeight(); - dimension.setWeight(weight != 0.0 ? 0.0 : 1.0); + execute(() -> { + AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); + DimensionInfo dimension; + if (horizontal) { + dimension = constraints.getColumn(); + } else { + dimension = constraints.getRow(); } + double weight = dimension.getWeight(); + dimension.setWeight(weight != 0.0 ? 0.0 : 1.0); }); } @@ -279,12 +273,9 @@ public void run() throws Exception { * Sets the horizontal alignment. */ private void setAlignment(final ColumnInfo.Alignment alignment) { - execute(new RunnableEx() { - @Override - public void run() throws Exception { - AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); - constraints.setHorizontalAlignment(alignment); - } + execute(() -> { + AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); + constraints.setHorizontalAlignment(alignment); }); } @@ -292,12 +283,9 @@ public void run() throws Exception { * Sets the vertical alignment. */ private void setAlignment(final RowInfo.Alignment alignment) { - execute(new RunnableEx() { - @Override - public void run() throws Exception { - AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); - constraints.setVerticalAlignment(alignment); - } + execute(() -> { + AbstractGridBagConstraintsInfo constraints = m_layout.getConstraints(m_component); + constraints.setVerticalAlignment(alignment); }); } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/LafSupport.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/LafSupport.java index bb1e2c6ac1..8f3c052dc7 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/LafSupport.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/LafSupport.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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.wb.internal.core.utils.ast.AstNodeUtils; import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.check.Assert; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.external.ExternalFactoriesHelper; import org.eclipse.wb.internal.core.utils.jdt.core.CodeUtils; import org.eclipse.wb.internal.core.utils.jdt.core.ProjectUtils; @@ -329,12 +328,9 @@ public static void selectLAF(JavaInfo javaInfo, LafInfo lafInfo) throws Exceptio */ public static void applySelectedLAF(final LafInfo lafInfo) { try { - SwingUtils.runLaterAndWait(new RunnableEx() { - @Override - public void run() throws Exception { - javax.swing.LookAndFeel lookAndFeelInstance = lafInfo.getLookAndFeelInstance().getValue(); - UIManager.setLookAndFeel(lookAndFeelInstance); - } + SwingUtils.runLaterAndWait(() -> { + javax.swing.LookAndFeel lookAndFeelInstance = lafInfo.getLookAndFeelInstance().getValue(); + UIManager.setLookAndFeel(lookAndFeelInstance); }); } catch (Throwable e) { DesignerPlugin.log(e); diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/model/PluginLafInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/model/PluginLafInfo.java index 7bfb4893a5..67c76440ff 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/model/PluginLafInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/laf/model/PluginLafInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.laf.model; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.external.ExternalFactoriesHelper; import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils; import org.eclipse.wb.internal.swing.laf.external.ILookAndFeelInitializer; @@ -51,13 +50,8 @@ public PluginLafInfo(final IConfigurationElement element) { m_extensionBundle = ExternalFactoriesHelper.getExtensionBundle(element); String initializerValue = element.getAttribute("initializer"); if (initializerValue != null) { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - m_initializer = - (ILookAndFeelInitializer) element.createExecutableExtension("initializer"); - } - }); + ExecutionUtils.runLog(() -> m_initializer = + (ILookAndFeelInitializer) element.createExecutableExtension("initializer")); } } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/AbstractActionInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/AbstractActionInfo.java index 02c33b1b72..40a0fe1b18 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/AbstractActionInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/AbstractActionInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -30,7 +30,6 @@ import org.eclipse.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils; import org.eclipse.wb.internal.swing.model.property.editor.DisplayedMnemonicKeyPropertyEditor; import org.eclipse.wb.internal.swing.model.property.editor.accelerator.KeyStrokePropertyEditor; @@ -211,12 +210,7 @@ public boolean setExpression(JavaInfo javaInfo, String source) throws Exception final AstEditor editor = javaInfo.getEditor(); final Expression oldExpression = getExpression(javaInfo); if (!editor.getSource(oldExpression).equals(source)) { - ExecutionUtils.run(javaInfo, new RunnableEx() { - @Override - public void run() throws Exception { - editor.replaceExpression(oldExpression, newSource); - } - }); + ExecutionUtils.run(javaInfo, () -> editor.replaceExpression(oldExpression, newSource)); return true; } // no changes diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionExpressionAccessor.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionExpressionAccessor.java index 59b21abdab..1fb1f91f2b 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionExpressionAccessor.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionExpressionAccessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -130,20 +130,10 @@ public boolean setExpression(final JavaInfo javaInfo, final String source) throw final AstEditor editor = javaInfo.getEditor(); if (source == null) { if (expression.getLocationInParent() == MethodInvocation.ARGUMENTS_PROPERTY) { - ExecutionUtils.run(javaInfo, new RunnableEx() { - @Override - public void run() throws Exception { - editor.removeEnclosingStatement(expression); - } - }); + ExecutionUtils.run(javaInfo, () -> editor.removeEnclosingStatement(expression)); } } else if (!editor.getSource(expression).equals(source)) { - ExecutionUtils.run(javaInfo, new RunnableEx() { - @Override - public void run() throws Exception { - editor.replaceExpression(expression, source); - } - }); + ExecutionUtils.run(javaInfo, () -> editor.replaceExpression(expression, source)); } } else if (source != null) { ExecutionUtils.run(javaInfo, new RunnableEx() { diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionJavaInfoParticipator.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionJavaInfoParticipator.java index dc2bfbc711..05d130e24a 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionJavaInfoParticipator.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ActionJavaInfoParticipator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -106,13 +106,10 @@ private void contextMenu_noAction(MenuManagerEx groupsManager, JavaInfo root, final List objects, boolean isFirst) { - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - for (ObjectInfo object : objects) { - ComponentInfo button = (ComponentInfo) object; - button.removeMethodInvocations("setAction(javax.swing.Action)"); - } + RunnableEx runnable = () -> { + for (ObjectInfo object : objects) { + ComponentInfo button = (ComponentInfo) object; + button.removeMethodInvocations("setAction(javax.swing.Action)"); } }; IAction action = @@ -133,14 +130,11 @@ private void contextMenu_newAction(MenuManagerEx groupsManager, final JavaInfo root, final List objects, boolean isFirst) { - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - ActionInfo action = ActionInfo.createInner(root.getEditor()); - for (ObjectInfo object : objects) { - ComponentInfo button = (ComponentInfo) object; - ActionInfo.setAction(button, action); - } + RunnableEx runnable = () -> { + ActionInfo action = ActionInfo.createInner(root.getEditor()); + for (ObjectInfo object : objects) { + ComponentInfo button = (ComponentInfo) object; + ActionInfo.setAction(button, action); } }; IAction action = @@ -165,13 +159,10 @@ private void contextMenu_existingAction(MenuManagerEx groupsManager, String text = actionInfo.getPresentation().getText(); ImageDescriptor image = actionInfo.getPresentation().getIcon(); // add action - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - for (ObjectInfo object : objects) { - ComponentInfo button = (ComponentInfo) object; - ActionInfo.setAction(button, actionInfo); - } + RunnableEx runnable = () -> { + for (ObjectInfo object : objects) { + ComponentInfo button = (ComponentInfo) object; + ActionInfo.setAction(button, actionInfo); } }; IAction action = diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ButtonGroupJavaInfoParticipator.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ButtonGroupJavaInfoParticipator.java index db1ec6ab45..e9c6dcc46d 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ButtonGroupJavaInfoParticipator.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/bean/ButtonGroupJavaInfoParticipator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -112,12 +112,9 @@ private void contextMenu_noButtonGroup(MenuManagerEx groupsManager, JavaInfo root, final List objects, boolean isFirst) { - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - for (ObjectInfo button : objects) { - ButtonGroupInfo.clearButton((ComponentInfo) button); - } + RunnableEx runnable = () -> { + for (ObjectInfo button : objects) { + ButtonGroupInfo.clearButton((ComponentInfo) button); } }; IAction action = @@ -138,13 +135,10 @@ private void contextMenu_newButtonGroup(MenuManagerEx groupsManager, final JavaInfo root, final List objects, boolean isFirst) { - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - ButtonGroupInfo buttonGroup = ButtonGroupContainerInfo.add(root, "javax.swing.ButtonGroup"); - for (ObjectInfo button : objects) { - buttonGroup.addButton((ComponentInfo) button); - } + RunnableEx runnable = () -> { + ButtonGroupInfo buttonGroup = ButtonGroupContainerInfo.add(root, "javax.swing.ButtonGroup"); + for (ObjectInfo button : objects) { + buttonGroup.addButton((ComponentInfo) button); } }; IAction action = @@ -165,29 +159,26 @@ private void contextMenu_newCustomButtonGroup(MenuManagerEx groupsManager, final JavaInfo root, final List objects, boolean isFirst) { - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - String className; + RunnableEx runnable = () -> { + String className; + { + IJavaProject javaProject = root.getEditor().getJavaProject(); + IType type = JdtUiUtils.selectClassType(DesignerPlugin.getShell(), javaProject); + if (type == null) { + return; + } { - IJavaProject javaProject = root.getEditor().getJavaProject(); - IType type = JdtUiUtils.selectClassType(DesignerPlugin.getShell(), javaProject); - if (type == null) { + ITypeHierarchy supertypeHierarchy = type.newSupertypeHierarchy(null); + if (!supertypeHierarchy.contains(javaProject.findType("javax.swing.ButtonGroup"))) { return; } - { - ITypeHierarchy supertypeHierarchy = type.newSupertypeHierarchy(null); - if (!supertypeHierarchy.contains(javaProject.findType("javax.swing.ButtonGroup"))) { - return; - } - } - className = type.getFullyQualifiedName(); - } - // - ButtonGroupInfo buttonGroup = ButtonGroupContainerInfo.add(root, className); - for (ObjectInfo button : objects) { - buttonGroup.addButton((ComponentInfo) button); } + className = type.getFullyQualifiedName(); + } + // + ButtonGroupInfo buttonGroup = ButtonGroupContainerInfo.add(root, className); + for (ObjectInfo button : objects) { + buttonGroup.addButton((ComponentInfo) button); } }; IAction action = @@ -213,12 +204,9 @@ private void contextMenu_existingButtonGroups(MenuManagerEx groupsManager, String text = buttonGroup.getVariableSupport().getName(); ImageDescriptor icon = buttonGroup.getDescription().getIcon(); // add action - RunnableEx runnable = new RunnableEx() { - @Override - public void run() throws Exception { - for (ObjectInfo button : objects) { - buttonGroup.addButton((ComponentInfo) button); - } + RunnableEx runnable = () -> { + for (ObjectInfo button1 : objects) { + buttonGroup.addButton((ComponentInfo) button1); } }; IAction action = diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ComponentInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ComponentInfo.java index 9c36e562ae..8e90597fe9 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ComponentInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ComponentInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -139,12 +139,7 @@ protected final void refresh_fetch_super() throws Exception { @Override protected void refresh_fetch() throws Exception { Component component = getComponent(); - refresh_fetch(this, component, new RunnableEx() { - @Override - public void run() throws Exception { - ComponentInfo.super.refresh_fetch(); - } - }); + refresh_fetch(this, component, ComponentInfo.super::refresh_fetch); } public static void refresh_fetch(AbstractComponentInfo model, diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ContainerInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ContainerInfo.java index 5b6feb0350..04936e9d83 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ContainerInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/ContainerInfo.java @@ -49,7 +49,6 @@ import org.eclipse.wb.internal.core.utils.check.Assert; import org.eclipse.wb.internal.core.utils.exception.DesignerException; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.state.EditorState; import org.eclipse.wb.internal.swing.IExceptionConstants; import org.eclipse.wb.internal.swing.model.CoordinateUtils; @@ -484,12 +483,7 @@ && getParent() instanceof ContainerInfo) { } } // we are in process of refresh(), set inherited layout later - ExecutionUtils.runLater(this, new RunnableEx() { - @Override - public void run() throws Exception { - setLayout(thisLayout); - } - }); + ExecutionUtils.runLater(this, () -> setLayout(thisLayout)); } // OK, stop here return; @@ -505,12 +499,7 @@ public void run() throws Exception { layoutDescription.getLayoutClassName(), new ConstructorCreationSupport()); // we are in process of refresh(), set inherited layout later - ExecutionUtils.runLater(this, new RunnableEx() { - @Override - public void run() throws Exception { - setLayout(thisLayout); - } - }); + ExecutionUtils.runLater(this, () -> setLayout(thisLayout)); } } } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/JLayeredPaneInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/JLayeredPaneInfo.java index bdb814a325..11ff1c2475 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/JLayeredPaneInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/JLayeredPaneInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -30,7 +30,6 @@ import org.eclipse.wb.internal.core.utils.ast.AstNodeUtils; import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.jdt.core.dom.Expression; import org.eclipse.jdt.core.dom.MethodInvocation; @@ -173,12 +172,7 @@ public Object getValue() throws Exception { @Override public void setValue(final Object value) throws Exception { - ExecutionUtils.run(m_component, new RunnableEx() { - @Override - public void run() throws Exception { - setValueEx(value); - } - }); + ExecutionUtils.run(m_component, () -> setValueEx(value)); } //////////////////////////////////////////////////////////////////////////// diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/SwtAwtFrameInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/SwtAwtFrameInfo.java index cf32a0ba89..d90bd97715 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/SwtAwtFrameInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/SwtAwtFrameInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -15,7 +15,6 @@ import org.eclipse.wb.internal.core.model.creation.CreationSupport; import org.eclipse.wb.internal.core.model.description.ComponentDescription; import org.eclipse.wb.internal.core.utils.ast.AstEditor; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.utils.SwingUtils; /** @@ -53,12 +52,7 @@ protected boolean isSwingRoot() { //////////////////////////////////////////////////////////////////////////// @Override protected void refresh_fetch() throws Exception { - SwingUtils.runLaterAndWait(new RunnableEx() { - @Override - public void run() throws Exception { - runRefreshFetch(); - } - }); + SwingUtils.runLaterAndWait(this::runRefreshFetch); } private void runRefreshFetch() throws Exception { diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/top/SwingTopBoundsSupport.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/top/SwingTopBoundsSupport.java index 4e749d1070..1c51b69e33 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/top/SwingTopBoundsSupport.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/component/top/SwingTopBoundsSupport.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -15,7 +15,6 @@ import org.eclipse.wb.internal.core.DesignerPlugin; import org.eclipse.wb.internal.core.model.TopBoundsSupport; import org.eclipse.wb.internal.core.utils.ast.AstEditor; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.model.ModelMessages; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import org.eclipse.wb.internal.swing.utils.SwingUtils; @@ -141,22 +140,16 @@ public static void show(Component component) throws Exception { window.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { - mainShell.getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - mainShell.setEnabled(true); - mainShell.forceActive(); - } + mainShell.getDisplay().asyncExec(() -> { + mainShell.setEnabled(true); + mainShell.forceActive(); }); } }); - SwingUtils.runLaterAndWait(new RunnableEx() { - @Override - public void run() throws Exception { - window.setFocusableWindowState(true); - window.setVisible(true); - window.toFront(); - } + SwingUtils.runLaterAndWait(() -> { + window.setFocusableWindowState(true); + window.setVisible(true); + window.toFront(); }); // wait for close mainShell.setEnabled(false); diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/BorderLayoutInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/BorderLayoutInfo.java index e90d4cc98b..9860591f78 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/BorderLayoutInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/BorderLayoutInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import org.eclipse.wb.internal.swing.model.component.ContainerInfo; @@ -242,14 +241,11 @@ public boolean isModified() throws Exception { @Override public void setValue(final Object value) throws Exception { - ExecutionUtils.run(m_component, new RunnableEx() { - @Override - public void run() throws Exception { - for (int i = 0; i < CONSTRAINTS_TITLES.length; i++) { - String constraintsTitle = CONSTRAINTS_TITLES[i]; - if (constraintsTitle.equals(value)) { - command_REGION(m_component, CONSTRAINTS_FIELDS[i]); - } + ExecutionUtils.run(m_component, () -> { + for (int i = 0; i < CONSTRAINTS_TITLES.length; i++) { + String constraintsTitle = CONSTRAINTS_TITLES[i]; + if (constraintsTitle.equals(value)) { + command_REGION(m_component, CONSTRAINTS_FIELDS[i]); } } }); diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/AbstractGridBagLayoutInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/AbstractGridBagLayoutInfo.java index 13cff16985..f474db8ca0 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/AbstractGridBagLayoutInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/AbstractGridBagLayoutInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -30,7 +30,6 @@ 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.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.Activator; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import org.eclipse.wb.internal.swing.model.component.ContainerInfo; @@ -843,12 +842,7 @@ public static ImageDescriptor getImageDescriptor(String name) { */ public IGridInfo getGridInfo() { if (m_gridInfo == null) { - ExecutionUtils.runRethrow(new RunnableEx() { - @Override - public void run() throws Exception { - createGridInfo(); - } - }); + ExecutionUtils.runRethrow(this::createGridInfo); } return m_gridInfo; } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionInfo.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionInfo.java index 7750bb34b6..9f4b093649 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionInfo.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.model.layout.gbl; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import java.awt.GridBagLayout; @@ -145,18 +144,12 @@ void initialize() throws Exception { * Visits {@link ComponentInfo} that belongs to this {@link DimensionInfo}. */ protected final void visit(final IComponentVisitor visitor) { - ExecutionUtils.runRethrow(new RunnableEx() { + ExecutionUtils.runRethrow(() -> m_layout.visitComponents(visitor, new IComponentPredicate() { @Override - public void run() throws Exception { - m_layout.visitComponents(visitor, new IComponentPredicate() { - @Override - public boolean apply(ComponentInfo component, AbstractGridBagConstraintsInfo constraints) - throws Exception { - return isDimensionComponent(constraints); - } - }); + public boolean apply(ComponentInfo component, AbstractGridBagConstraintsInfo constraints) throws Exception { + return isDimensionComponent(constraints); } - }); + })); } /** diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsColumn.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsColumn.java index 80167ba5cb..309e75111a 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsColumn.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsColumn.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.model.layout.gbl; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import java.util.LinkedList; @@ -42,20 +41,14 @@ public DimensionOperationsColumn(AbstractGridBagLayoutInfo layout) { @Override public boolean isEmpty(final int index) { final boolean[] filled = new boolean[1]; - ExecutionUtils.runLog(new RunnableEx() { + ExecutionUtils.runLog(() -> m_layout.visitComponents(new IComponentVisitor() { @Override - public void run() throws Exception { - m_layout.visitComponents(new IComponentVisitor() { - @Override - public void visit(ComponentInfo component, AbstractGridBagConstraintsInfo constraints) - throws Exception { - int x = constraints.getX(); - int width = constraints.getWidth(); - filled[0] |= x <= index && index < x + width; - } - }); + public void visit(ComponentInfo component, AbstractGridBagConstraintsInfo constraints) throws Exception { + int x = constraints.getX(); + int width = constraints.getWidth(); + filled[0] |= x <= index && index < x + width; } - }); + })); return !filled[0]; } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsRow.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsRow.java index 2169cc91e7..22124af03c 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsRow.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/DimensionOperationsRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.model.layout.gbl; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import java.util.LinkedList; @@ -42,20 +41,14 @@ public DimensionOperationsRow(AbstractGridBagLayoutInfo layout) { @Override public boolean isEmpty(final int index) { final boolean[] filled = new boolean[1]; - ExecutionUtils.runLog(new RunnableEx() { + ExecutionUtils.runLog(() -> m_layout.visitComponents(new IComponentVisitor() { @Override - public void run() throws Exception { - m_layout.visitComponents(new IComponentVisitor() { - @Override - public void visit(ComponentInfo component, AbstractGridBagConstraintsInfo constraints) - throws Exception { - int y = constraints.getY(); - int height = constraints.getHeight(); - filled[0] |= y <= index && index < y + height; - } - }); + public void visit(ComponentInfo component, AbstractGridBagConstraintsInfo constraints) throws Exception { + int y = constraints.getY(); + int height = constraints.getHeight(); + filled[0] |= y <= index && index < y + height; } - }); + })); return !filled[0]; } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/ui/DimensionEditDialog.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/ui/DimensionEditDialog.java index dba2383c54..8281740937 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/ui/DimensionEditDialog.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/layout/gbl/ui/DimensionEditDialog.java @@ -15,7 +15,6 @@ import org.eclipse.wb.core.controls.Separator; import org.eclipse.wb.internal.core.DesignerPlugin; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.ui.GridDataFactory; import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory; import org.eclipse.wb.internal.core.utils.ui.dialogs.ResizableDialog; @@ -162,13 +161,10 @@ protected void buttonPressed(int buttonId) { * Saves current {@link DimensionInfo} changes into source and refreshes GUI. */ private void applyChanges() throws Exception { - ExecutionUtils.run(m_layout, new RunnableEx() { - @Override - public void run() throws Exception { - setAlignment(m_dimension, m_currentAlignment); - m_dimension.setSize(m_currentSize); - m_dimension.setWeight(m_currentWeight); - } + ExecutionUtils.run(m_layout, () -> { + setAlignment(m_dimension, m_currentAlignment); + m_dimension.setSize(m_currentSize); + m_dimension.setWeight(m_currentWeight); }); } @@ -176,20 +172,17 @@ public void run() throws Exception { * Sets the {@link DimensionInfo} to edit. */ private void setEditDimension(final T dimension) { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - // apply changes - if (m_dimension != null) { - applyChanges(); - } - // remember new dimension - m_dimension = dimension; - m_currentIndex = m_dimensions.indexOf(m_dimension); - m_currentAlignment = getAlignment(m_dimension); - m_currentSize = m_dimension.getSize(); - m_currentWeight = m_dimension.getWeight(); + ExecutionUtils.runLog(() -> { + // apply changes + if (m_dimension != null) { + applyChanges(); } + // remember new dimension + m_dimension = dimension; + m_currentIndex = m_dimensions.indexOf(m_dimension); + m_currentAlignment = getAlignment(m_dimension); + m_currentSize = m_dimension.getSize(); + m_currentWeight = m_dimension.getWeight(); }); } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/DisplayedMnemonicKeyPropertyEditor.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/DisplayedMnemonicKeyPropertyEditor.java index dc72bca0c7..5904dab752 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/DisplayedMnemonicKeyPropertyEditor.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/DisplayedMnemonicKeyPropertyEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -15,7 +15,6 @@ import org.eclipse.wb.internal.core.model.property.editor.PropertyEditor; import org.eclipse.wb.internal.core.model.property.editor.StaticFieldPropertyEditor; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.state.EditorState; import java.awt.event.KeyEvent; @@ -49,12 +48,7 @@ public DisplayedMnemonicKeyPropertyEditor() { } } // do configure - ExecutionUtils.runRethrow(new RunnableEx() { - @Override - public void run() throws Exception { - configure(KeyEvent.class, fieldNames.toArray(new String[fieldNames.size()])); - } - }); + ExecutionUtils.runRethrow(() -> configure(KeyEvent.class, fieldNames.toArray(new String[fieldNames.size()]))); } //////////////////////////////////////////////////////////////////////////// diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderDialog.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderDialog.java index 106ad223c8..45983dcdf8 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderDialog.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderDialog.java @@ -18,7 +18,6 @@ import org.eclipse.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.state.EditorState; import org.eclipse.wb.internal.core.utils.ui.GridDataFactory; import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory; @@ -293,12 +292,7 @@ private String getCurrentBorderSource() { * so we need to update {@link BorderPreviewCanvas}. */ public void borderUpdated() { - ExecutionUtils.runIgnore(new RunnableEx() { - @Override - public void run() throws Exception { - borderUpdatedEx(); - } - }); + ExecutionUtils.runIgnore(this::borderUpdatedEx); } /** diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderPropertyEditor.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderPropertyEditor.java index 67eeb2e6d2..2c30aee274 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderPropertyEditor.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/BorderPropertyEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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.wb.internal.core.utils.ast.AstNodeUtils; import org.eclipse.wb.internal.core.utils.ast.DomGenerics; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.jdt.core.CodeUtils; import org.eclipse.jdt.core.dom.ClassInstanceCreation; @@ -171,12 +170,7 @@ public boolean isModified() throws Exception { @Override public void setExpression(final String source, Object value) throws Exception { - ExecutionUtils.run(javaInfo, new RunnableEx() { - @Override - public void run() throws Exception { - javaInfo.getEditor().replaceExpression(argument, source); - } - }); + ExecutionUtils.run(javaInfo, () -> javaInfo.getEditor().replaceExpression(argument, source)); } @Override diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/pages/CompoundBorderComposite.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/pages/CompoundBorderComposite.java index 186e23a81a..86b8b7211f 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/pages/CompoundBorderComposite.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/border/pages/CompoundBorderComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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 @@ -14,7 +14,6 @@ import org.eclipse.wb.internal.core.utils.ast.AstEditor; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.ui.GridDataFactory; import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory; import org.eclipse.wb.internal.swing.model.ModelMessages; @@ -67,15 +66,12 @@ public CompoundBorderComposite(Composite parent) { swapButton.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event e) { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - BorderValue insideBorder = m_insideField.getBorderValue(); - BorderValue outsideBorder = m_outsideField.getBorderValue(); - m_outsideField.setBorderValue(insideBorder); - m_insideField.setBorderValue(outsideBorder); - m_borderDialog.borderUpdated(); - } + ExecutionUtils.runLog(() -> { + BorderValue insideBorder = m_insideField.getBorderValue(); + BorderValue outsideBorder = m_outsideField.getBorderValue(); + m_outsideField.setBorderValue(insideBorder); + m_insideField.setBorderValue(outsideBorder); + m_borderDialog.borderUpdated(); }); } }); diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/font/FontPreviewCanvas.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/font/FontPreviewCanvas.java index 89f43e552f..45f3db25a7 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/font/FontPreviewCanvas.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/font/FontPreviewCanvas.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2026 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 @@ -13,7 +13,6 @@ package org.eclipse.wb.internal.swing.model.property.editor.font; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.core.utils.ui.DrawUtils; import org.eclipse.wb.internal.swing.utils.SwingImageUtils; @@ -73,43 +72,40 @@ public Point computeSize(int wHint, int hHint, boolean changed) { */ private void onPaint(final GC gc) { if (m_fontInfo != null) { - ExecutionUtils.runLog(new RunnableEx() { - @Override - public void run() throws Exception { - // prepare label - JLabel label; + ExecutionUtils.runLog(() -> { + // prepare label + JLabel label; + { + label = new JLabel(); + label.setFont(m_fontInfo.getFont()); + label.setText(m_fontInfo.getText()); { - label = new JLabel(); - label.setFont(m_fontInfo.getFont()); - label.setText(m_fontInfo.getText()); - { - org.eclipse.swt.graphics.Color swtColor = gc.getBackground(); - label.setBackground(new Color(swtColor.getRed(), - swtColor.getGreen(), - swtColor.getBlue())); - label.setOpaque(true); - } - } - // prepare image - Image image; - { - label.setSize(label.getPreferredSize()); - image = SwingImageUtils.createComponentShot(label).createImage(); - } - // draw image - try { - Rectangle clientArea = getClientArea(); - DrawUtils.drawImageCHCV( - gc, - image, - clientArea.x, - clientArea.y, - clientArea.width, - clientArea.height); - } finally { - image.dispose(); + org.eclipse.swt.graphics.Color swtColor = gc.getBackground(); + label.setBackground(new Color(swtColor.getRed(), + swtColor.getGreen(), + swtColor.getBlue())); + label.setOpaque(true); } } + // prepare image + Image image; + { + label.setSize(label.getPreferredSize()); + image = SwingImageUtils.createComponentShot(label).createImage(); + } + // draw image + try { + Rectangle clientArea = getClientArea(); + DrawUtils.drawImageCHCV( + gc, + image, + clientArea.x, + clientArea.y, + clientArea.width, + clientArea.height); + } finally { + image.dispose(); + } }); } } diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/models/table/TableModelPropertyEditor.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/models/table/TableModelPropertyEditor.java index b5d46b93d2..8fba789064 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/models/table/TableModelPropertyEditor.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/model/property/editor/models/table/TableModelPropertyEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 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.wb.internal.core.utils.ast.AstNodeUtils; import org.eclipse.wb.internal.core.utils.ast.StatementTarget; import org.eclipse.wb.internal.core.utils.execution.ExecutionUtils; -import org.eclipse.wb.internal.core.utils.execution.RunnableEx; import org.eclipse.wb.internal.swing.model.component.ComponentInfo; import org.eclipse.wb.internal.swing.utils.SwingUtils; @@ -91,12 +90,7 @@ protected void openDialog(Property property) throws Exception { private static void setModel(final GenericProperty genericProperty, final TableModelDescription model) throws Exception { final ComponentInfo table = (ComponentInfo) genericProperty.getJavaInfo(); - ExecutionUtils.run(table, new RunnableEx() { - @Override - public void run() throws Exception { - setModelEx(table, genericProperty, model); - } - }); + ExecutionUtils.run(table, () -> setModelEx(table, genericProperty, model)); } private static void setModelEx(ComponentInfo table,