Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-10-10 17:59:19 -0400
committerAlexander Kurtakov2019-10-10 17:59:19 -0400
commit4477ea013a31691c3d378a01bcdf5436132de0c3 (patch)
treee32249c06984a5c0d28da5ee9cb0f051f5655af8
parent7cd94f8f91b4c48e06b11f2520ef30454d7aaddc (diff)
downloadorg.eclipse.cdt-4477ea013a31691c3d378a01bcdf5436132de0c3.tar.gz
org.eclipse.cdt-4477ea013a31691c3d378a01bcdf5436132de0c3.tar.xz
org.eclipse.cdt-4477ea013a31691c3d378a01bcdf5436132de0c3.zip
Use generified databindings API.
Change-Id: I247759650ce37cc01f585b3675f848d8b209abbc Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java11
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java14
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java2
4 files changed, 15 insertions, 14 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java
index be205a63b0..54076b8521 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java
@@ -23,13 +23,13 @@ import org.eclipse.cdt.internal.docker.launcher.ContainerPropertyVolumesModel.Mo
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.IChangeListener;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
@@ -173,7 +173,8 @@ public class ContainerDataVolumeDialog extends Dialog {
readOnlyButton.setToolTipText(WizardMessages.getString("ContainerDataVolumeDialog.readOnlyButtonTooltip")); //$NON-NLS-1$
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS - 2, 1).grab(true, false)
.applyTo(readOnlyButton);
- final ISWTObservableValue readOnlyButtonObservable = WidgetProperties.selection().observe(readOnlyButton);
+ final ISWTObservableValue<Boolean> readOnlyButtonObservable = WidgetProperties.buttonSelection()
+ .observe(readOnlyButton);
dbc.bindValue(readOnlyButtonObservable,
BeanProperties.value(DataVolumeModel.class, DataVolumeModel.READ_ONLY_VOLUME).observe(model));
// browse for file
@@ -205,7 +206,7 @@ public class ContainerDataVolumeDialog extends Dialog {
containerSelectionComboViewer.setInput(this.containerNames);
final IObservableValue selectedContainerObservable = BeanProperties
.value(DataVolumeModel.class, DataVolumeModel.CONTAINER_MOUNT).observe(model);
- dbc.bindValue(WidgetProperties.selection().observe(containerSelectionCombo), selectedContainerObservable);
+ dbc.bindValue(WidgetProperties.comboSelection().observe(containerSelectionCombo), selectedContainerObservable);
new ContentProposalAdapter(containerSelectionCombo, new ComboContentAdapter() {
@Override
public void insertControlContents(Control control, String text, int cursorPosition) {
@@ -255,7 +256,7 @@ public class ContainerDataVolumeDialog extends Dialog {
* @return
*/
private Binding bindButton(final Button button, final MountType mountType, final Control... controls) {
- return dbc.bindValue(WidgetProperties.selection().observe(button),
+ return dbc.bindValue(WidgetProperties.buttonSelection().observe(button),
BeanProperties.value(DataVolumeModel.class, DataVolumeModel.MOUNT_TYPE).observe(model),
new UpdateValueStrategy() {
@Override
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java
index 80e19808d6..1f9a49027c 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java
@@ -15,10 +15,10 @@
package org.eclipse.cdt.internal.docker.launcher;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.layout.GridDataFactory;
@@ -79,7 +79,6 @@ public class ContainerPortDialog extends Dialog {
return new Point(400, super.getInitialSize().y);
}
- @SuppressWarnings("unchecked")
@Override
protected Control createDialogArea(Composite parent) {
final int COLUMNS = 2;
@@ -111,14 +110,15 @@ public class ContainerPortDialog extends Dialog {
.applyTo(errorMessageLabel);
// listening to changes
- final ISWTObservableValue containerPortObservable = WidgetProperties.text(SWT.Modify)
+ final ISWTObservableValue<String> containerPortObservable = WidgetProperties.text(SWT.Modify)
.observe(containerPortText);
dbc.bindValue(containerPortObservable, BeanProperties
.value(ContainerPortDialogModel.class, ContainerPortDialogModel.CONTAINER_PORT).observe(model));
- final ISWTObservableValue hostAddressObservable = WidgetProperties.text(SWT.Modify).observe(hostAddressText);
+ final ISWTObservableValue<String> hostAddressObservable = WidgetProperties.text(SWT.Modify)
+ .observe(hostAddressText);
dbc.bindValue(hostAddressObservable, BeanProperties
.value(ContainerPortDialogModel.class, ContainerPortDialogModel.HOST_ADDRESS).observe(model));
- final ISWTObservableValue hostPortObservable = WidgetProperties.text(SWT.Modify).observe(hostPortText);
+ final ISWTObservableValue<String> hostPortObservable = WidgetProperties.text(SWT.Modify).observe(hostPortText);
dbc.bindValue(hostPortObservable, BeanProperties
.value(ContainerPortDialogModel.class, ContainerPortDialogModel.HOST_PORT).observe(model));
@@ -128,7 +128,7 @@ public class ContainerPortDialog extends Dialog {
return container;
}
- private IValueChangeListener<?> onContainerPortSettingsChanged() {
+ private IValueChangeListener<String> onContainerPortSettingsChanged() {
return event -> validateInput();
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
index 02c0744a7e..3e175f2093 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
@@ -41,8 +41,8 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
import org.eclipse.cdt.managedbuilder.ui.properties.AbstractCBuildPropertyTab;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.beans.IBeanValueProperty;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.map.IObservableMap;
import org.eclipse.core.databinding.property.Properties;
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
index 3b312994f0..2842dcc0ea 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
@@ -21,7 +21,7 @@ import java.util.Iterator;
import org.eclipse.cdt.docker.launcher.DockerLaunchUIPlugin;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;

Back to the top