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 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,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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -402,6 +413,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 @@ -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 @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down