summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Geiger2018-01-30 08:35:30 -0500
committerStefan Geiger2018-01-30 08:35:30 -0500
commit9486a384766f0c350a0100f58f32ec57cd7e4dc1 (patch)
tree0764191523621ce451108025dea177c64f25f37c
parent4e648fbe9f0d330880a61ae8cb258f9d4c1722fd (diff)
downloadorg.eclipse.riena-9486a384766f0c350a0100f58f32ec57cd7e4dc1.zip
org.eclipse.riena-9486a384766f0c350a0100f58f32ec57cd7e4dc1.tar.gz
org.eclipse.riena-9486a384766f0c350a0100f58f32ec57cd7e4dc1.tar.xz
Revert "AbstractLabelRidget reset text or image before set image or text"
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidget.java7
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractLabelRidget.java47
2 files changed, 7 insertions, 47 deletions
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidget.java
index d9fb8b6..86573b7 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidget.java
@@ -44,19 +44,12 @@ public class LabelRidget extends AbstractLabelRidget {
}
@Override
- protected Image getUIControlImage() {
- return getUIControl().getImage();
- }
-
- @Override
protected void setUIControlText(final String text) {
- getUIControl().setImage(null);
getUIControl().setText(text);
}
@Override
protected void setUIControlImage(final Image image) {
- getUIControl().setText("");
getUIControl().setImage(image);
}
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractLabelRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractLabelRidget.java
index f86d385..2c27858 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractLabelRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractLabelRidget.java
@@ -42,13 +42,10 @@ public abstract class AbstractLabelRidget extends AbstractValueRidget implements
private IconSize iconSize;
private URL iconLocation;
private boolean textAlreadyInitialized;
- private boolean iconAlreadyInitalized;
- private Image imageFromUiControl;
private boolean useRidgetIcon;
public AbstractLabelRidget() {
textAlreadyInitialized = false;
- iconAlreadyInitalized = false;
useRidgetIcon = false;
}
@@ -65,7 +62,6 @@ public abstract class AbstractLabelRidget extends AbstractValueRidget implements
@Override
protected void bindUIControl() {
initText();
- initIcon();
updateUIText();
updateUIIcon();
}
@@ -86,23 +82,6 @@ public abstract class AbstractLabelRidget extends AbstractValueRidget implements
}
}
- private void initIcon() {
- if (iconIDIsEmpty() && !iconAlreadyInitalized) {
- final Control control = getUIControl();
- if (control != null && !control.isDisposed()) {
- final Image uiControlImage = getUIControlImage();
- if (uiControlImage != null) {
- imageFromUiControl = uiControlImage;
- iconAlreadyInitalized = true;
- }
- }
- }
- }
-
- private boolean iconIDIsEmpty() {
- return iconID == null || iconID == EMPTY_STRING;
- }
-
/**
* {@inheritDoc}
* <p>
@@ -179,7 +158,6 @@ public abstract class AbstractLabelRidget extends AbstractValueRidget implements
public void setText(final String text) {
final String oldValue = this.text;
this.text = text;
- useRidgetIcon = false;
updateUIText();
firePropertyChange(PROPERTY_TEXT_INTERNAL, oldValue, this.text);
firePropertyChange(ILabelRidget.PROPERTY_TEXT, oldValue, this.text);
@@ -202,11 +180,6 @@ public abstract class AbstractLabelRidget extends AbstractValueRidget implements
*/
protected abstract String getUIControlText();
- /**
- * @since 6.2
- */
- protected abstract Image getUIControlImage();
-
private void updateUIText() {
if (getUIControl() != null) {
setUIControlText(text);
@@ -220,25 +193,19 @@ public abstract class AbstractLabelRidget extends AbstractValueRidget implements
private void updateUIIcon() {
if (getUIControl() != null) {
- final Image image = getManagedImage();
+ Image image = null;
+ if (getIcon() != null) {
+ image = getManagedImage(getIcon(), iconSize);
+ } else if (iconLocation != null) {
+ final String key = iconLocation.toExternalForm();
+ image = getManagedImage(key);
+ }
if ((image != null) || useRidgetIcon) {
setUIControlImage(image);
- } else if (iconAlreadyInitalized) {
- setUIControlImage(imageFromUiControl);
}
}
}
- private Image getManagedImage() {
- if (getIcon() != null) {
- return getManagedImage(getIcon(), iconSize);
- } else if (iconLocation != null) {
- final String key = iconLocation.toExternalForm();
- return getManagedImage(key);
- }
- return null;
- }
-
/**
* Sets the controls image.
*/