Skip to content
Open
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
11 changes: 8 additions & 3 deletions doc/org.eclipse.eef.documentation/pages/releasenotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>releasenotes</title>
<link type="text/css" rel="stylesheet" href="assets/css/stylesheet.css"/>
</head>
<body>
<h2 id="ReleaseNotesforEclipseEEF">Release Notes for Eclipse EEF</h2>
<ol class="toc" style="list-style: disc;">
<li>
<a href="#ReleaseNotesforEclipseEEF">Release Notes for Eclipse EEF</a>
<ol style="list-style: disc;">
<li>
<a href="#eef2.1.7">Changes in EEF 2.1.7</a>
</li>
<li>
<a href="#eef2.1.1">Changes in EEF 2.1.1</a>
</li>
Expand Down Expand Up @@ -60,6 +61,10 @@ <h2 id="ReleaseNotesforEclipseEEF">Release Notes for Eclipse EEF</h2>
</li>
</ol>
<p>This document contains the release notes for recent major releases of EEF.</p>
<h3 id="eef2.1.7">Changes in EEF 2.1.7</h3>
<ul>
<li><span class="label label-info">Modified</span> When disabled, content of lists, text areas and field are still readable. Widgets are scrollable and selectable even if they cannot be edited and actions are disabled.</li>
</ul>
<h3 id="eef2.1.1">Changes in EEF 2.1.1</h3>
<ul>
<li><span class="label label-info">Modified</span> Add the workbench part and the selection to the tab descriptor filter extension point.</li>
Expand Down Expand Up @@ -157,7 +162,7 @@ <h4 id="DeveloperVisibleChanges5">Developer-Visible Changes</h4>
<h3 id="eef1.7.2">Changes in EEF 1.7.2</h3>
<h4 id="SpecifierVisibleChanges3">Specifier-Visible Changes</h4>
<ul>
<li><span class="label label-info">Modified</span> The dynamic mappings will take into account all the &#171;if&#187; blocks with a valid predicate expression and not only the first one.</li>
<li><span class="label label-info">Modified</span> The dynamic mappings will take into account all the «if» blocks with a valid predicate expression and not only the first one.</li>
<li><span class="label label-info">Modified</span> Fixed an issue with the enablement of the widget actions of the reference widget.</li>
</ul>
<h3 id="eef1.7.1">Changes in EEF 1.7.1</h3>
Expand Down
6 changes: 5 additions & 1 deletion doc/org.eclipse.eef.documentation/pages/releasenotes.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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

* <span class="label label-info">Modified</span> When disabled, content of lists, text areas and field are still readable. Widgets are scrollable and selectable even if they cannot be edited and actions are disabled.

h3(#eef2.1.1). Changes in EEF 2.1.1

* <span class="label label-info">Modified</span> Add the workbench part and the selection to the tab descriptor filter extension point.
Expand Down Expand Up @@ -89,7 +93,7 @@ h3(#eef1.7.2). Changes in EEF 1.7.2

h4. Specifier-Visible Changes

* <span class="label label-info">Modified</span> The dynamic mappings will take into account all the "if" blocks with a valid predicate expression and not only the first one.
* <span class="label label-info">Modified</span> The dynamic mappings will take into account all the «if» blocks with a valid predicate expression and not only the first one.
* <span class="label label-info">Modified</span> Fixed an issue with the enablement of the widget actions of the reference widget.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
* @author mbats
*/
public interface IEEFListController extends IEEFOnClickController {

/**
* Sets the enablement of action on selection.
*
* @param isEnabled
* <code>true</code> when the widget should have its default behavior, <code>false</code> 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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public class EEFListController extends AbstractEEFOnClickController implements I
*/
private Consumer<Object> newValueConsumer;

/**
* Enable flag to drive on-click.
*/
private boolean enabled = true;

/**
* The constructor.
*
Expand Down Expand Up @@ -130,6 +135,29 @@ public IStatus action(final EEFWidgetAction action, final List<Object> 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}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -60,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; // same as AbstractEEFWidgetLifecycleManager

/**
* The table viewer.
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -124,9 +130,14 @@ 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);
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);
Expand All @@ -141,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);
Expand Down Expand Up @@ -193,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
Expand All @@ -203,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);
Expand Down Expand Up @@ -394,6 +407,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);
}
Expand All @@ -402,6 +419,22 @@ protected void setEnabled(boolean isEnabled) {
}
}

/**
* Get the background color according to the current valid style.
*
* @param isEnabled
* <code>true</code> if the widget is enabled, <code>false</code> 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}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public class EEFListLifecycleManager extends AbstractEEFWidgetLifecycleManager {
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; // same as EEFExtMultipleReferenceLifecycleManager

/**
* The description.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -127,6 +127,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);
Expand All @@ -152,6 +155,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
Expand All @@ -178,6 +182,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);
Expand All @@ -196,7 +201,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()) {
Expand Down Expand Up @@ -278,7 +287,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));
Expand Down
Loading