summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-04-09 08:34:29 (EDT)
committerCarsten Drossel2009-04-09 08:34:29 (EDT)
commitfefa33d3f7a72326ac62b8d2a96a27285cdc4796 (patch)
tree370861767eecae4f70822de8b46ceb849f04d63f
parent031b41e030d5c2317670b1f9bac11a455e5616ee (diff)
downloadorg.eclipse.riena-fefa33d3f7a72326ac62b8d2a96a27285cdc4796.zip
org.eclipse.riena-fefa33d3f7a72326ac62b8d2a96a27285cdc4796.tar.gz
org.eclipse.riena-fefa33d3f7a72326ac62b8d2a96a27285cdc4796.tar.bz2
bug 270210 - ignoring now markers that are irrelevant for a Ridget
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java22
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java65
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidgetTest.java24
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java24
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidgetTest.java15
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/BasicMarkerSupport.java90
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidget.java14
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidget.java12
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkerSupport.java68
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidget.java9
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractActionRidget.java7
11 files changed, 220 insertions, 130 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
index 42c259c..313dccd 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
@@ -21,6 +21,7 @@ import org.easymock.EasyMock;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -489,4 +490,25 @@ public abstract class AbstractSWTRidgetTest extends RienaTestCase {
return PropertyChangeEventEquals.eqPropertyChangeEvent(propertyChangeEvent);
}
+ protected void assertMarkerIgnored(IMarker marker) {
+ AbstractSWTWidgetRidget ridgetImpl = (AbstractSWTWidgetRidget) getRidget();
+ Control control = (Control) getWidget();
+ Color originalForegroundColor = control.getForeground();
+ Color originalBackgroundColor = control.getBackground();
+
+ ridgetImpl.addMarker(marker);
+
+ assertTrue(control.isVisible());
+ assertTrue(control.isEnabled());
+ assertEquals(originalForegroundColor, control.getForeground());
+ assertEquals(originalBackgroundColor, control.getBackground());
+
+ ridgetImpl.removeMarker(marker);
+
+ assertTrue(control.isVisible());
+ assertTrue(control.isEnabled());
+ assertEquals(originalForegroundColor, control.getForeground());
+ assertEquals(originalBackgroundColor, control.getBackground());
+ }
+
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java
index e933225..143ad25 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ActionRidgetTest.java
@@ -18,6 +18,10 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.ui.core.marker.ErrorMarker;
+import org.eclipse.riena.ui.core.marker.MandatoryMarker;
+import org.eclipse.riena.ui.core.marker.NegativeMarker;
+import org.eclipse.riena.ui.core.marker.OutputMarker;
import org.eclipse.riena.ui.ridgets.IActionListener;
import org.eclipse.riena.ui.ridgets.IActionRidget;
import org.eclipse.riena.ui.ridgets.swt.uibinding.SwtControlRidgetMapper;
@@ -233,61 +237,14 @@ public class ActionRidgetTest extends AbstractSWTRidgetTest {
}
/**
- * Tests that control is hidden when the ActionRidget is "output only".
+ * Tests that markers that are irrelavant for this type of Ridget do not
+ * change the widget.
*/
- public void testOutputRidgetNotVisible() {
- IActionRidget ridget = getRidget();
- Button control = getWidget();
-
- assertFalse(ridget.isOutputOnly());
- assertTrue(control.isVisible());
-
- ridget.setOutputOnly(true);
-
- assertTrue(ridget.isOutputOnly());
- assertFalse(control.isVisible());
-
- ridget.setOutputOnly(false);
-
- assertFalse(ridget.isOutputOnly());
- assertTrue(control.isVisible());
-
- ridget.setOutputOnly(true);
- ridget.setVisible(true);
-
- assertTrue(ridget.isOutputOnly());
- assertTrue(ridget.isVisible());
- assertFalse(control.isVisible());
-
- ridget.setVisible(false);
- ridget.setOutputOnly(false);
-
- assertFalse(ridget.isOutputOnly());
- assertFalse(ridget.isVisible());
- assertFalse(control.isVisible());
-
- ridget.setVisible(true);
- ridget.setOutputOnly(false);
-
- assertFalse(ridget.isOutputOnly());
- assertTrue(ridget.isVisible());
- assertTrue(control.isVisible());
-
- ridget.setVisible(false);
- ridget.setOutputOnly(true);
-
- assertTrue(ridget.isOutputOnly());
- assertFalse(ridget.isVisible());
- assertFalse(control.isVisible());
-
- ridget.setVisible(true);
- ridget.setOutputOnly(true);
- ridget.setVisible(false);
- ridget.setVisible(true);
-
- assertTrue(ridget.isOutputOnly());
- assertTrue(ridget.isVisible());
- assertFalse(control.isVisible());
+ public void testUnsupportedMarkersIgnored() {
+ assertMarkerIgnored(new ErrorMarker());
+ assertMarkerIgnored(new MandatoryMarker());
+ assertMarkerIgnored(new OutputMarker());
+ assertMarkerIgnored(new NegativeMarker());
}
// helping methods
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidgetTest.java
index ef6273c..baed3a3 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidgetTest.java
@@ -11,15 +11,20 @@
package org.eclipse.riena.internal.ui.ridgets.swt;
import org.eclipse.core.databinding.BindingException;
-import org.eclipse.riena.core.util.ReflectionUtils;
-import org.eclipse.riena.ui.ridgets.IRidget;
-import org.eclipse.riena.ui.swt.EmbeddedTitleBar;
-import org.eclipse.riena.ui.swt.utils.SwtUtilities;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.ui.core.marker.ErrorMarker;
+import org.eclipse.riena.ui.core.marker.MandatoryMarker;
+import org.eclipse.riena.ui.core.marker.NegativeMarker;
+import org.eclipse.riena.ui.core.marker.OutputMarker;
+import org.eclipse.riena.ui.ridgets.IRidget;
+import org.eclipse.riena.ui.swt.EmbeddedTitleBar;
+import org.eclipse.riena.ui.swt.utils.SwtUtilities;
+
/**
* Tests of the class {@code EmbeddedTitleBarRidget}.
*/
@@ -130,4 +135,15 @@ public class EmbeddedTitleBarRidgetTest extends AbstractSWTRidgetTest {
}
+ /**
+ * Tests that markers that are irrelavant for this type of Ridget do not
+ * change the widget.
+ */
+ public void testUnsupportedMarkersIgnored() {
+ assertMarkerIgnored(new ErrorMarker());
+ assertMarkerIgnored(new MandatoryMarker());
+ assertMarkerIgnored(new OutputMarker());
+ assertMarkerIgnored(new NegativeMarker());
+ }
+
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java
index f86e0ca..33a9c08 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/LabelRidgetTest.java
@@ -15,15 +15,20 @@ import java.net.URL;
import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.riena.beans.common.TestBean;
-import org.eclipse.riena.core.util.ReflectionUtils;
-import org.eclipse.riena.ui.ridgets.ILabelRidget;
-import org.eclipse.riena.ui.ridgets.swt.uibinding.SwtControlRidgetMapper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.riena.beans.common.TestBean;
+import org.eclipse.riena.core.util.ReflectionUtils;
+import org.eclipse.riena.ui.core.marker.ErrorMarker;
+import org.eclipse.riena.ui.core.marker.MandatoryMarker;
+import org.eclipse.riena.ui.core.marker.NegativeMarker;
+import org.eclipse.riena.ui.core.marker.OutputMarker;
+import org.eclipse.riena.ui.ridgets.ILabelRidget;
+import org.eclipse.riena.ui.ridgets.swt.uibinding.SwtControlRidgetMapper;
+
/**
* Tests for the {@link LabelRidget}.
*/
@@ -357,4 +362,15 @@ public class LabelRidgetTest extends AbstractSWTRidgetTest {
}
+ /**
+ * Tests that markers that are irrelavant for this type of Ridget do not
+ * change the widget.
+ */
+ public void testUnsupportedMarkersIgnored() {
+ assertMarkerIgnored(new ErrorMarker());
+ assertMarkerIgnored(new MandatoryMarker());
+ assertMarkerIgnored(new OutputMarker());
+ assertMarkerIgnored(new NegativeMarker());
+ }
+
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidgetTest.java
index 1d781e8..89cbfd7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidgetTest.java
@@ -15,6 +15,10 @@ import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.riena.ui.core.marker.ErrorMarker;
+import org.eclipse.riena.ui.core.marker.MandatoryMarker;
+import org.eclipse.riena.ui.core.marker.NegativeMarker;
+import org.eclipse.riena.ui.core.marker.OutputMarker;
import org.eclipse.riena.ui.ridgets.IRidget;
import org.eclipse.riena.ui.ridgets.IStatuslineNumberRidget;
import org.eclipse.riena.ui.swt.StatuslineNumber;
@@ -107,4 +111,15 @@ public class StatuslineNumberRidgetTest extends AbstractSWTRidgetTest {
}
+ /**
+ * Tests that markers that are irrelavant for this type of Ridget do not
+ * change the widget.
+ */
+ public void testUnsupportedMarkersIgnored() {
+ assertMarkerIgnored(new ErrorMarker());
+ assertMarkerIgnored(new MandatoryMarker());
+ assertMarkerIgnored(new OutputMarker());
+ assertMarkerIgnored(new NegativeMarker());
+ }
+
}
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/BasicMarkerSupport.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/BasicMarkerSupport.java
new file mode 100644
index 0000000..9f44a4d
--- /dev/null
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/BasicMarkerSupport.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.internal.ui.ridgets.swt;
+
+import java.beans.PropertyChangeSupport;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Table;
+
+import org.eclipse.riena.ui.ridgets.AbstractMarkerSupport;
+import org.eclipse.riena.ui.ridgets.IMarkableRidget;
+
+/**
+ * Helper class for Ridgets to delegate their marker issues to that just handles
+ * the basic markers for uneditable Ridgets: the HiddenMarker to toggle
+ * visibility and the DisabledMarker that toggles the enabled state.
+ */
+public class BasicMarkerSupport extends AbstractMarkerSupport {
+
+ public BasicMarkerSupport(IMarkableRidget ridget, PropertyChangeSupport propertyChangeSupport) {
+ super(ridget, propertyChangeSupport);
+ }
+
+ @Override
+ public void updateMarkers() {
+ updateUIControl();
+ }
+
+ @Override
+ protected void handleMarkerAttributesChanged() {
+ updateUIControl();
+ super.handleMarkerAttributesChanged();
+ }
+
+ private void updateUIControl() {
+ Control control = (Control) ridget.getUIControl();
+ if (control != null) {
+ stopRedraw(control);
+ try {
+ updateUIControl(control);
+ } finally {
+ startRedraw(control);
+ }
+ }
+ }
+
+ protected void updateUIControl(Control control) {
+ updateVisible(control);
+ updateDisabled(control);
+ }
+
+ protected void updateVisible(Control control) {
+ control.setVisible(ridget.isVisible());
+ }
+
+ protected void updateDisabled(Control control) {
+ control.setEnabled(ridget.isEnabled());
+ }
+
+ private void startRedraw(Control control) {
+ if (!skipRedrawForBug258176(control)) {
+ control.setRedraw(true);
+ control.redraw();
+ }
+ }
+
+ private void stopRedraw(Control control) {
+ if (!skipRedrawForBug258176(control)) {
+ control.setRedraw(false);
+ }
+ }
+
+ /**
+ * These controls are affected by bug 258176 in SWT.
+ */
+ private boolean skipRedrawForBug258176(Control control) {
+ return (control instanceof Combo) || (control instanceof Table) || (control instanceof List);
+ }
+
+}
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidget.java
index fffa708..7b2a71e 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/EmbeddedTitleBarRidget.java
@@ -10,15 +10,17 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Image;
+
import org.eclipse.riena.core.util.ListenerList;
+import org.eclipse.riena.ui.ridgets.AbstractMarkerSupport;
import org.eclipse.riena.ui.ridgets.ILabelRidget;
import org.eclipse.riena.ui.ridgets.IWindowRidget;
import org.eclipse.riena.ui.ridgets.listener.IWindowRidgetListener;
import org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget;
import org.eclipse.riena.ui.swt.EmbeddedTitleBar;
import org.eclipse.riena.ui.swt.IEmbeddedTitleBarListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Image;
/**
* Ridget for {@link EmbeddedTitleBar}.
@@ -55,6 +57,11 @@ public class EmbeddedTitleBarRidget extends AbstractSWTRidget implements IWindow
setUIControl(window);
}
+ @Override
+ protected AbstractMarkerSupport createMarkerSupport() {
+ return new BasicMarkerSupport(this, propertyChangeSupport);
+ }
+
/**
* @see org.eclipse.riena.ui.ridgets.IRidget#getUIControl()
*/
@@ -103,8 +110,7 @@ public class EmbeddedTitleBarRidget extends AbstractSWTRidget implements IWindow
}
/**
- * @see org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget#bindUIControl
- * ()
+ * @see org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget#bindUIControl ()
*/
@Override
protected void bindUIControl() {
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 f2470c0..4647511 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
@@ -14,12 +14,13 @@ import java.net.URL;
import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.riena.ui.ridgets.ILabelRidget;
-import org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget;
-
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.riena.ui.ridgets.AbstractMarkerSupport;
+import org.eclipse.riena.ui.ridgets.ILabelRidget;
+import org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget;
+
/**
* Ridget for an SWT {@link Label} widget.
*/
@@ -43,6 +44,11 @@ public class LabelRidget extends AbstractValueRidget implements ILabelRidget {
}
@Override
+ protected AbstractMarkerSupport createMarkerSupport() {
+ return new BasicMarkerSupport(this, propertyChangeSupport);
+ }
+
+ @Override
IObservableValue getRidgetObservable() {
return BeansObservables.observeValue(this, ILabelRidget.PROPERTY_TEXT);
}
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkerSupport.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkerSupport.java
index 5f77031..7e66eca 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkerSupport.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkerSupport.java
@@ -19,21 +19,17 @@ import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Table;
import org.eclipse.riena.ui.core.marker.MandatoryMarker;
import org.eclipse.riena.ui.core.marker.NegativeMarker;
-import org.eclipse.riena.ui.ridgets.AbstractMarkerSupport;
import org.eclipse.riena.ui.ridgets.IMarkableRidget;
import org.eclipse.riena.ui.ridgets.swt.AbstractActionRidget;
/**
* Helper class for SWT Ridgets to delegate their marker issues to.
*/
-public class MarkerSupport extends AbstractMarkerSupport {
+public class MarkerSupport extends BasicMarkerSupport {
private static final String PRE_MANDATORY_BACKGROUND_KEY = "org.eclipse.riena.MarkerSupport.preMandatoryBackground"; //$NON-NLS-1$
private static final String PRE_OUTPUT_BACKGROUND_KEY = "org.eclipse.riena.MarkerSupport.preOutputBackground"; //$NON-NLS-1$
@@ -61,17 +57,6 @@ public class MarkerSupport extends AbstractMarkerSupport {
super(ridget, propertyChangeSupport);
}
- @Override
- public void updateMarkers() {
- updateUIControl();
- }
-
- @Override
- protected void handleMarkerAttributesChanged() {
- updateUIControl();
- super.handleMarkerAttributesChanged();
- }
-
protected void addError(Control control) {
if (errorDecoration == null) {
errorDecoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP);
@@ -154,14 +139,6 @@ public class MarkerSupport extends AbstractMarkerSupport {
return result;
}
- private void updateVisible(Control control) {
- control.setVisible(ridget.isVisible());
- }
-
- private void updateDisabled(Control control) {
- control.setEnabled(ridget.isEnabled());
- }
-
private void updateError(Control control) {
if (ridget.isErrorMarked() && ridget.isEnabled() && ridget.isVisible()) {
if (!(isButton(control) && ridget.isOutputOnly())) {
@@ -217,41 +194,14 @@ public class MarkerSupport extends AbstractMarkerSupport {
* <li>negative on - negative decoration is shown</li>
* <ol>
*/
- private void updateUIControl() {
- Control control = (Control) ridget.getUIControl();
- if (control != null) {
- stopRedraw(control);
- try {
- updateVisible(control);
- updateDisabled(control);
- updateOutput(control);
- updateMandatory(control);
- updateError(control);
- updateNegative(control);
- } finally {
- startRedraw(control);
- }
- }
- }
-
- private void startRedraw(Control control) {
- if (!skipRedrawForBug258176(control)) {
- control.setRedraw(true);
- control.redraw();
- }
- }
-
- private void stopRedraw(Control control) {
- if (!skipRedrawForBug258176(control)) {
- control.setRedraw(false);
- }
- }
-
- /**
- * These controls are affected by bug 258176 in SWT.
- */
- private boolean skipRedrawForBug258176(Control control) {
- return (control instanceof Combo) || (control instanceof Table) || (control instanceof List);
+ @Override
+ protected void updateUIControl(Control control) {
+ updateVisible(control);
+ updateDisabled(control);
+ updateOutput(control);
+ updateMandatory(control);
+ updateError(control);
+ updateNegative(control);
}
private boolean isButton(Control control) {
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidget.java
index 2d63d97..41ca973 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/StatuslineNumberRidget.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.riena.internal.ui.ridgets.swt;
+import org.eclipse.riena.ui.ridgets.AbstractMarkerSupport;
import org.eclipse.riena.ui.ridgets.IStatuslineNumberRidget;
import org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget;
import org.eclipse.riena.ui.swt.StatuslineNumber;
@@ -23,6 +24,11 @@ public class StatuslineNumberRidget extends AbstractSWTRidget implements IStatus
private Integer number;
private String numberString;
+ @Override
+ protected AbstractMarkerSupport createMarkerSupport() {
+ return new BasicMarkerSupport(this, propertyChangeSupport);
+ }
+
/**
* @see org.eclipse.riena.ui.ridgets.IStatuslineNumberRidget#getNumber()
*/
@@ -89,8 +95,7 @@ public class StatuslineNumberRidget extends AbstractSWTRidget implements IStatus
}
/**
- * @see org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget#bindUIControl
- * ()
+ * @see org.eclipse.riena.ui.ridgets.swt.AbstractSWTRidget#bindUIControl ()
*/
@Override
protected void bindUIControl() {
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractActionRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractActionRidget.java
index 48e1310..bacbe35 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractActionRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/ui/ridgets/swt/AbstractActionRidget.java
@@ -15,6 +15,8 @@ import java.beans.EventHandler;
import org.eclipse.swt.graphics.Image;
import org.eclipse.riena.internal.ui.ridgets.swt.ActionObserver;
+import org.eclipse.riena.internal.ui.ridgets.swt.BasicMarkerSupport;
+import org.eclipse.riena.ui.ridgets.AbstractMarkerSupport;
import org.eclipse.riena.ui.ridgets.IActionListener;
import org.eclipse.riena.ui.ridgets.IActionRidget;
@@ -37,6 +39,11 @@ public abstract class AbstractActionRidget extends AbstractSWTRidget implements
useRidgetIcon = false;
}
+ @Override
+ protected AbstractMarkerSupport createMarkerSupport() {
+ return new BasicMarkerSupport(this, propertyChangeSupport);
+ }
+
/**
* If the text of the ridget has no value, initialize it with the text of
* the UI control.