Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
});
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -316,18 +315,13 @@ public void setRows(List<FormRowInfo> 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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -52,12 +51,9 @@ public ColumnsDialog(Shell parentShell, FormLayoutInfo layout) {
*/
private static List<FormColumnInfo> createColumnsCopy(final FormLayoutInfo layout) {
final List<FormColumnInfo> 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -52,12 +51,9 @@ public RowsDialog(Shell parentShell, FormLayoutInfo layout) {
*/
private static List<FormRowInfo> createRowsCopy(final FormLayoutInfo layout) {
final List<FormRowInfo> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -205,27 +204,21 @@ 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();
});
}

/**
* 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();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
});
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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);
}
}
});
}));
}

/**
Expand Down Expand Up @@ -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;
}
Expand Down
Loading
Loading