From d8a380306311d2d18c3824041a182c7cd8e11c07 Mon Sep 17 00:00:00 2001 From: Nicolas Peransin Date: Mon, 18 May 2026 17:10:15 +0200 Subject: [PATCH 1/3] [3] Do not disable scrollable widgets when not editable Not editable widget must not be disabled. Disable widget cannot be scrolled. User should be able to read and copy the content. Actions must still be driven by "is Enabled Expression". https://github.com/eclipse-eef/org.eclipse.eef/issues/3 Change-Id: I46b47a1ade5b3472191e619f07aa1c4db93adaa9 Signed-off-by: Nicolas Peransin --- .../pages/releasenotes.html | 9 +++++- .../pages/releasenotes.textile | 6 +++- .../api/controllers/IEEFListController.java | 10 +++++++ .../controllers/EEFListController.java | 28 +++++++++++++++++++ ...FExtMultipleReferenceLifecycleManager.java | 27 ++++++++++++++++++ .../widgets/EEFListLifecycleManager.java | 6 ++-- .../widgets/EEFTextLifecycleManager.java | 3 +- 7 files changed, 84 insertions(+), 5 deletions(-) diff --git a/doc/org.eclipse.eef.documentation/pages/releasenotes.html b/doc/org.eclipse.eef.documentation/pages/releasenotes.html index 754590daf..a3d303105 100644 --- a/doc/org.eclipse.eef.documentation/pages/releasenotes.html +++ b/doc/org.eclipse.eef.documentation/pages/releasenotes.html @@ -11,6 +11,9 @@

Release Notes for Eclipse EEF

  • Release Notes for Eclipse EEF
      +
    1. + Changes in EEF 2.1.7 +
    2. Changes in EEF 2.1.1
    3. @@ -60,6 +63,10 @@

      Release Notes for Eclipse EEF

    This document contains the release notes for recent major releases of EEF.

    +

    Changes in EEF 2.1.7

    +
      +
    • Modified When disabled, the content of lists, text areas, and text fields remains readable. Widgets can still be scrolled and text can be selected, even though editing is disabled and actions are unavailable.
    • +

    Changes in EEF 2.1.1

    • Modified Add the workbench part and the selection to the tab descriptor filter extension point.
    • @@ -157,7 +164,7 @@

      Developer-Visible Changes

      Changes in EEF 1.7.2

      Specifier-Visible Changes

        -
      • Modified The dynamic mappings will take into account all the «if» blocks with a valid predicate expression and not only the first one.
      • +
      • Modified The dynamic mappings will take into account all the «if» blocks with a valid predicate expression and not only the first one.
      • Modified Fixed an issue with the enablement of the widget actions of the reference widget.

      Changes in EEF 1.7.1

      diff --git a/doc/org.eclipse.eef.documentation/pages/releasenotes.textile b/doc/org.eclipse.eef.documentation/pages/releasenotes.textile index 1f1120bb0..c8e13bc09 100644 --- a/doc/org.eclipse.eef.documentation/pages/releasenotes.textile +++ b/doc/org.eclipse.eef.documentation/pages/releasenotes.textile @@ -4,6 +4,10 @@ h2. Release Notes for Eclipse EEF This document contains the release notes for recent major releases of EEF. +h3(#eef2.1.7). Changes in EEF 2.1.7 + +* Modified When disabled, the content of lists, text areas, and text fields remains readable. Widgets can still be scrolled and text can be selected, even though editing is disabled and actions are unavailable. + h3(#eef2.1.1). Changes in EEF 2.1.1 * Modified Add the workbench part and the selection to the tab descriptor filter extension point. @@ -89,7 +93,7 @@ h3(#eef1.7.2). Changes in EEF 1.7.2 h4. Specifier-Visible Changes -* Modified The dynamic mappings will take into account all the "if" blocks with a valid predicate expression and not only the first one. +* Modified The dynamic mappings will take into account all the «if» blocks with a valid predicate expression and not only the first one. * Modified Fixed an issue with the enablement of the widget actions of the reference widget. diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java index b5575ab51..754df7bd7 100644 --- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java +++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/IEEFListController.java @@ -23,6 +23,16 @@ * @author mbats */ public interface IEEFListController extends IEEFOnClickController { + + /** + * Sets the enablement of action on selection. + * + * @param isEnabled + * true when the widget should have its default behavior, false when the widget + * should be in a read only mode. + */ + void setEnabled(boolean isEnabled); + /** * Register a consumer which will be called with the new value of the text when it will change. * diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java index f90a482c2..0673a3802 100644 --- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java +++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFListController.java @@ -47,6 +47,11 @@ public class EEFListController extends AbstractEEFOnClickController implements I */ private Consumer newValueConsumer; + /** + * Enable flag to drive on-click. + */ + private boolean enabled = true; + /** * The constructor. * @@ -130,6 +135,29 @@ public IStatus action(final EEFWidgetAction action, final List elements) }); } + /** + * {@inheritDoc} + * + * @see org.eclipse.eef.core.api.controllers.IEEFListController#setEnabled(boolean) + */ + @Override + public void setEnabled(boolean isEnabled) { + this.enabled = isEnabled; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.eef.core.api.controllers.AbstractEEFOnClickController#onClick(java.lang.Object, + * java.lang.String) + */ + @Override + public void onClick(Object element, String onClickEventKind) { + if (enabled) { + super.onClick(element, onClickEventKind); + } + } + /** * {@inheritDoc} * diff --git a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java index 2498e1b91..9ff7ba737 100644 --- a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java @@ -43,6 +43,7 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; @@ -94,6 +95,11 @@ public class EEFExtMultipleReferenceLifecycleManager extends AbstractEEFExtRefer */ protected ButtonSelectionListener downButtonListener; + /** + * The default background color of the text field. + */ + private Color defaultBackgroundColor; + /** * The constructor. * @@ -124,6 +130,7 @@ public EEFExtMultipleReferenceLifecycleManager(EEFExtReferenceDescription descri @Override protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { this.widgetFactory = formContainer.getWidgetFactory(); + defaultBackgroundColor = parent.getBackground(); Composite referenceComposite = this.widgetFactory.createFlatFormComposite(parent); GridLayout referenceGridLayout = new GridLayout(2, false); @@ -394,6 +401,10 @@ public void refresh() { protected void setEnabled(boolean isEnabled) { super.setEnabled(isEnabled); + if (this.tableViewer != null && this.tableViewer.getTable() != null && !this.tableViewer.getTable().isDisposed()) { + // Background color is handled like List widget + this.tableViewer.getTable().setBackground(this.getBackgroundColor(isEnabled)); + } if (this.upButton != null && !this.upButton.isDisposed()) { this.upButton.setEnabled(isEnabled); } @@ -402,6 +413,22 @@ protected void setEnabled(boolean isEnabled) { } } + /** + * Get the background color according to the current valid style. + * + * @param isEnabled + * true if the widget is enabled, false otherwise + * + * @return The background color to use in the text field. + */ + private Color getBackgroundColor(boolean isEnabled) { + Color color = defaultBackgroundColor; + if (!isEnabled) { + color = widgetFactory.getColors().getInactiveBackground(); + } + return color; + } + /** * {@inheritDoc} * diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java index 154a332de..458b8e14c 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java @@ -93,7 +93,7 @@ public class EEFListLifecycleManager extends AbstractEEFWidgetLifecycleManager { /** * The listener used to run the onClick expression when the user will click on the table. */ - private SelectionListener tableSelectionListener; + private EEFTableSelectionListener tableSelectionListener; /** * The constructor. @@ -178,6 +178,7 @@ private void createListWidget(Composite parent) { final int clientWidth = scrolledComposite.getClientArea().width; this.tableViewer.getTable().setSize(clientWidth, Math.max(TABLE_MINIMAL_HEIGHT, widgetHeight)); + tableViewer.getTable().setBackground(defaultBackgroundColor); scrolledComposite.setExpandHorizontal(true); scrolledComposite.setAlwaysShowScrollBars(true); @@ -278,7 +279,8 @@ private void setListValue(Object value) { protected void setEnabled(boolean isEnabled) { if (this.tableViewer != null && this.tableViewer.getTable() != null && !this.tableViewer.getTable().isDisposed()) { this.tableViewer.getTable().setBackground(this.getBackgroundColor(isEnabled)); - this.tableViewer.getTable().setEnabled(isEnabled); + // tableViewer is not disabled so user can scroll. + controller.setEnabled(isEnabled); } this.actionButtons.stream().filter(actionButton -> !actionButton.getButton().isDisposed()) .forEach(actionButton -> actionButton.setEnabled(isEnabled)); diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java index c7e8bb1f4..90b40bb2f 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java @@ -570,7 +570,8 @@ private String computeTextFromModel() { protected void setEnabled(boolean isEnabled) { if (!this.text.isDisposed()) { this.text.setEditable(isEnabled); - this.text.setEnabled(isEnabled); + // text must not be disabled. + // User need to scroll for text area or copy content. this.text.setBackground(this.getBackgroundColor(isEnabled)); this.text.setForeground(this.getForegroundColor(isEnabled)); } From 2d889114d4d7776551691beec1783a919b3284c1 Mon Sep 17 00:00:00 2001 From: Nicolas Peransin Date: Fri, 22 May 2026 16:20:22 +0200 Subject: [PATCH 2/3] [6] Fix background of tooltip anchor https://github.com/eclipse-eef/org.eclipse.eef/issues/6 Change-Id: I1b5a60b1307a09c91264a84bd78b5bd107526639 --- .../ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java index 736ca2d6e..16675fd8d 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java @@ -148,6 +148,7 @@ public void createControl(Composite parent, IEEFFormContainer formContainer) { this.help.setLayoutData(new GridData(this.getLabelVerticalAlignment())); this.help.setToolTipText(""); //$NON-NLS-1$ } + this.help.setBackground((Color) null); // The main control (delegated to the concrete Lifecycle Manager) this.createMainControl(parent, formContainer); From 0e577a49cf2095f26d2fb249b7aa27c3e87b997a Mon Sep 17 00:00:00 2001 From: Nicolas Peransin Date: Fri, 22 May 2026 16:19:55 +0200 Subject: [PATCH 3/3] [4] Improve widgets alignment and size Remove extra borders. Align contents and action buttons. Same height for lists and multi references. Change-Id: Icecbef22336aeaf1817e82cff6fd8bafb8888b9a --- ...EEFExtMultipleReferenceLifecycleManager.java | 14 ++++++++++---- .../EEFExtSingleReferenceLifecycleManager.java | 12 ++++++++++-- .../widgets/EEFContainerLifecycleManager.java | 14 ++++++++++++-- .../widgets/EEFHyperlinkLifecycleManager.java | 6 ++++-- .../widgets/EEFLabelLifecycleManager.java | 5 +++-- .../widgets/EEFListLifecycleManager.java | 17 +++++++++++++---- .../widgets/EEFTextLifecycleManager.java | 10 ++++++++-- 7 files changed, 60 insertions(+), 18 deletions(-) diff --git a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java index 9ff7ba737..27556eb0c 100644 --- a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtMultipleReferenceLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2022 Obeo. + * Copyright (c) 2016, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -61,9 +61,9 @@ public class EEFExtMultipleReferenceLifecycleManager extends AbstractEEFExtReferenceLifecycleManager { /** - * Minimal height of the table widget. + * Minimal height of the table widget. 5 Action buttons and almost 7 lines. */ - private static final int TABLE_MINIMAL_HEIGHT = 150; + private static final int TABLE_MINIMAL_HEIGHT = 140; // Consistent with EEFListLifecycleManager /** * The table viewer. @@ -134,6 +134,10 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain Composite referenceComposite = this.widgetFactory.createFlatFormComposite(parent); GridLayout referenceGridLayout = new GridLayout(2, false); + referenceGridLayout.marginHeight = 0; + referenceGridLayout.marginWidth = 0; + // Table border need an extra pixel. + referenceGridLayout.marginBottom = 1; referenceComposite.setLayout(referenceGridLayout); GridData referenceCompositeGridData = new GridData(SWT.FILL, SWT.CENTER, true, false); @@ -148,6 +152,8 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain GridLayout buttonCompositeGridLayout = new GridLayout(1, false); buttonCompositeGridLayout.marginHeight = 0; + buttonCompositeGridLayout.marginWidth = 0; + buttonsComposite.setLayout(buttonCompositeGridLayout); this.createButtons(buttonsComposite); @@ -200,6 +206,7 @@ protected void createTable(Composite parent) { gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; gridData.verticalAlignment = SWT.BEGINNING; + gridData.horizontalIndent = VALIDATION_MARKER_OFFSET; scrolledComposite.setLayoutData(gridData); // CHECKSTYLE:OFF @@ -210,7 +217,6 @@ protected void createTable(Composite parent) { this.tableViewer = new TableViewer(table); GridData tableGridData = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1); - tableGridData.horizontalIndent = VALIDATION_MARKER_OFFSET; this.tableViewer.getTable().setLayoutData(tableGridData); this.composedAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); diff --git a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtSingleReferenceLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtSingleReferenceLifecycleManager.java index e6702c587..64b7850bb 100644 --- a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtSingleReferenceLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtSingleReferenceLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2022 Obeo. + * Copyright (c) 2016, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -101,6 +101,10 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain GridLayout gridLayout = new GridLayout(3, false); gridLayout.verticalSpacing = 0; gridLayout.marginHeight = 0; + // Keep left margin to align icon to other widgets (Lists, text fields and areas mainly). + gridLayout.marginLeft = gridLayout.marginWidth; + gridLayout.marginWidth = 0; + referenceComposite.setLayout(gridLayout); GridData referenceCompositeGridData = new GridData(SWT.FILL, SWT.CENTER, true, false); @@ -130,7 +134,11 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain */ @Override protected void createButtons(Composite parent) { - parent.setLayout(new GridLayout(getButtonsNumber(), true)); + GridLayout layout = new GridLayout(getButtonsNumber(), true); + layout.marginHeight = 0; + layout.marginWidth = 0; + + parent.setLayout(layout); if (!this.eReference.isContainment()) { Image browseImage = ExtendedImageRegistry.INSTANCE .getImage(EEFExtReferenceUIPlugin.getPlugin().getImage(EEFExtReferenceUIPlugin.Implementation.BROWSE_ICON_PATH)); diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java index 7966cac02..42ac97592 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015, 2018 Obeo. + * Copyright (c) 2015, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -126,7 +126,11 @@ public void createControl(Composite parent, IEEFFormContainer formContainer) { } GridLayout compositeLayout = new GridLayout(numColumns, makeColumnsEqualWidth); - compositeLayout.marginWidth = 1; + compositeLayout.marginWidth = 0; + compositeLayout.marginHeight = 0; + compositeLayout.horizontalSpacing = 5 // Default margin + * 2 // section border + widget border + * 2; // left + right composite.setLayout(compositeLayout); @@ -140,6 +144,12 @@ public void createControl(Composite parent, IEEFFormContainer formContainer) { // Three columns: label, help, widget GridLayout columnLayout = new GridLayout(3, false); + columnLayout.marginWidth = 0; + columnLayout.marginHeight = 0; + // Text fields and areas need a special pixel. + // Their border is drawn out of bounds. + columnLayout.marginRight = 1; + column.setLayout(columnLayout); // Pick the right controls for the given column index in the controls flat list diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFHyperlinkLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFHyperlinkLifecycleManager.java index 4b96ad323..4ad800479 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFHyperlinkLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFHyperlinkLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Obeo. + * Copyright (c) 2016, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -103,7 +103,7 @@ public EEFHyperlinkLifecycleManager(EEFHyperlinkDescription description, IVariab * {@inheritDoc} * * @see org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager#createMainControl(org.eclipse.swt.widgets.Composite, - * org.eclipse.eef.common.ui.api.IEEFFormContainer) + * org.eclipse.eef.common.ui.api.IEEFFormContainer) */ @Override protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { @@ -161,6 +161,8 @@ private void createWidgetActionButtons(Composite parent) { GridLayout layout = new GridLayout(this.description.getActions().size(), true); // hyperlinkComposite already provide vertical and horizontal spacing. layout.marginHeight = 0; + layout.marginWidth = 0; + buttons.setLayout(layout); // Buttons are visible only if an action is defined diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java index 7ba3e394d..059f6c245 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015, 2018 Obeo. + * Copyright (c) 2015, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -103,7 +103,7 @@ public EEFLabelLifecycleManager(EEFLabelDescription description, IVariableManage * {@inheritDoc} * * @see org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager#createMainControl(org.eclipse.swt.widgets.Composite, - * org.eclipse.eef.common.ui.api.IEEFFormContainer) + * org.eclipse.eef.common.ui.api.IEEFFormContainer) */ @Override protected void createMainControl(Composite parent, IEEFFormContainer formContainer) { @@ -164,6 +164,7 @@ private void createWidgetActionButtons(Composite parent) { GridLayout layout = new GridLayout(this.description.getActions().size(), true); // labelComposite already provide vertical spacing. layout.marginHeight = 0; + layout.marginWidth = 0; buttons.setLayout(layout); diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java index 458b8e14c..9b7c09a1b 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFListLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Obeo. + * Copyright (c) 2016, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -50,15 +50,16 @@ * @author sbegaudeau */ public class EEFListLifecycleManager extends AbstractEEFWidgetLifecycleManager { + /** * Default height. */ private static final int DEFAULT_HEIGHT = 34; /** - * Minimal height of the table widget. + * Minimal height of the table widget. 5 Action buttons and almost 7 lines. */ - private static final int TABLE_MINIMAL_HEIGHT = 100; + private static final int TABLE_MINIMAL_HEIGHT = 140; // Consistent with EEFExtMultipleReferenceLifecycleManager /** * The description. @@ -127,6 +128,9 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain // this is the parent composite Composite list = widgetFactory.createFlatFormComposite(parent); GridLayout layout = new GridLayout(2, false); + layout.marginWidth = 0; + layout.marginHeight = 0; + list.setLayout(layout); GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false); @@ -152,6 +156,7 @@ private void createListWidget(Composite parent) { GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; + gridData.horizontalIndent = VALIDATION_MARKER_OFFSET; scrolledComposite.setLayoutData(gridData); // CHECKSTYLE:OFF @@ -197,7 +202,11 @@ private void createWidgetActionButtons(Composite parent) { gridData.verticalAlignment = SWT.BEGINNING; buttons.setLayoutData(gridData); - buttons.setLayout(new GridLayout(1, false)); + GridLayout layout = new GridLayout(1, false); + layout.marginWidth = 0; + layout.marginHeight = 0; + + buttons.setLayout(layout); // Buttons are visible only if an action is defined for (EEFWidgetAction action : this.description.getActions()) { diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java index 90b40bb2f..e47533a30 100644 --- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java +++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015, 2022 Obeo. + * Copyright (c) 2015, 2026 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -200,6 +200,12 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain gridData.heightHint = lineCount * text.getLineHeight(); gridData.widthHint = TEXT_AREA_WIDTH_HINT; gridData.horizontalIndent = VALIDATION_MARKER_OFFSET; + + // Styled Text use 2 pixels outside of its bounds to drawn borders and scrollbar. + // The space with previous widget disappear. + // verticalIndent only mitigates this issue. + // Using space with another composite introduces other alignment issues. + gridData.verticalIndent = 4; this.text.setLayoutData(gridData); } else { this.text = widgetFactory.createStyledText(parent, SWT.SINGLE); @@ -207,7 +213,7 @@ protected void createMainControl(Composite parent, IEEFFormContainer formContain gridData.horizontalIndent = VALIDATION_MARKER_OFFSET; this.text.setLayoutData(gridData); } - + this.text.setMargins(5, 0, 5, 0); // These margins match the margins of lists. this.text.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); widgetFactory.paintBordersFor(parent);