summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-03-20 03:52:43 (EDT)
committerCarsten Drossel2009-03-20 03:52:43 (EDT)
commitdfd5cb64850da6c35e0050a5b523442f9bc20d70 (patch)
tree7f9c1997a2de1ca962d8b27706dde236e987f287
parent826ba6f3464fbb4e5578d6635a95a52bdfc248f2 (diff)
downloadorg.eclipse.riena-dfd5cb64850da6c35e0050a5b523442f9bc20d70.zip
org.eclipse.riena-dfd5cb64850da6c35e0050a5b523442f9bc20d70.tar.gz
org.eclipse.riena-dfd5cb64850da6c35e0050a5b523442f9bc20d70.tar.bz2
now recognizing custom buttons
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkerSupport.java20
1 files changed, 13 insertions, 7 deletions
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 8c2692d..2a5198b 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
@@ -14,10 +14,6 @@ import java.beans.PropertyChangeSupport;
import java.util.Iterator;
import org.eclipse.jface.fieldassist.ControlDecoration;
-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.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -28,6 +24,12 @@ 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.
*/
@@ -113,7 +115,7 @@ public class MarkerSupport extends AbstractMarkerSupport {
preOutputBg = control.getBackground();
control.setBackground(color);
}
- if (control instanceof Button) {
+ if (isButton(control)) {
control.setVisible(false);
}
}
@@ -137,7 +139,7 @@ public class MarkerSupport extends AbstractMarkerSupport {
control.setBackground(preOutputBg);
preOutputBg = null;
}
- if (control instanceof Button) {
+ if (isButton(control)) {
control.setVisible(ridget.isVisible());
}
}
@@ -161,7 +163,7 @@ public class MarkerSupport extends AbstractMarkerSupport {
private void updateError(Control control) {
if (ridget.isErrorMarked() && ridget.isEnabled() && ridget.isVisible()) {
- if (!(control instanceof Button && ridget.isOutputOnly())) {
+ if (!(isButton(control) && ridget.isOutputOnly())) {
addError(control);
} else {
clearError(control);
@@ -251,4 +253,8 @@ public class MarkerSupport extends AbstractMarkerSupport {
return (control instanceof Combo) || (control instanceof Table) || (control instanceof List);
}
+ private boolean isButton(Control control) {
+ return control instanceof Button || ridget instanceof AbstractActionRidget;
+ }
+
}