summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2011-05-31 09:29:46 (EDT)
committerSteffen Kriese2011-05-31 09:29:46 (EDT)
commit358e0d5929fe16443df237068a7cb65ab86aa744 (patch)
tree778e348d15dec2c0712ee55fc44cb77e13eaa697
parent14aa2bf88a87f173f8a7f03b6061c73264e28f6b (diff)
downloadorg.eclipse.riena-358e0d5929fe16443df237068a7cb65ab86aa744.zip
org.eclipse.riena-358e0d5929fe16443df237068a7cb65ab86aa744.tar.gz
org.eclipse.riena-358e0d5929fe16443df237068a7cb65ab86aa744.tar.bz2
added systemproperty to enable textridget.setDirectWriting() for all ridgets
-rw-r--r--org.eclipse.riena.core/src/org/eclipse/riena/core/RienaStatus.java23
-rw-r--r--org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java5
2 files changed, 27 insertions, 1 deletions
diff --git a/org.eclipse.riena.core/src/org/eclipse/riena/core/RienaStatus.java b/org.eclipse.riena.core/src/org/eclipse/riena/core/RienaStatus.java
index 51f0150..df9aa8d 100644
--- a/org.eclipse.riena.core/src/org/eclipse/riena/core/RienaStatus.java
+++ b/org.eclipse.riena.core/src/org/eclipse/riena/core/RienaStatus.java
@@ -26,6 +26,12 @@ public final class RienaStatus {
public static final String RIENA_DEVELOPMENT_SYSTEM_PROPERTY = "riena.development"; //$NON-NLS-1$
/**
+ * This system property controls
+ * {@code RienaStatus.getDefaultTextRidgetDirectWritingEnabled}
+ */
+ public static final String RIENA_TEXT_RIDGET_DIRECTWRITING_PROPERTY = "riena.textridget.directwriting"; //$NON-NLS-1$
+
+ /**
* This system property controls {@code RienaStatus.isTest()}
*/
public static final String RIENA_TEST_SYSTEM_PROPERTY = "riena.test"; //$NON-NLS-1$
@@ -36,6 +42,8 @@ public final class RienaStatus {
*/
public static final String DEVELOPMENT_DEFAULT = "true"; //$NON-NLS-1$
+ public static final String DIRECTWRITING_DEFAULT = "false"; //$NON-NLS-1$
+
/**
* This is the default value (i.e. if the value is not explicitly defined)
* for the system property {@code RIENA_TEST_SYSTEM_PROPERTY}
@@ -98,6 +106,21 @@ public final class RienaStatus {
}
/**
+ * Checks if the systemproperty <code>riena.textridget.directwriting</code>
+ * was given, that indicates that every TextRidget has per default
+ * directwriting enabled.
+ *
+ * @return <code>true</code> if per default directwriting is enabled in
+ * TextRidgets, otherwise <code>false</code>
+ *
+ * @since 3.0
+ */
+ public static boolean getDefaultTextRidgetDirectWritingEnabled() {
+ return Boolean
+ .parseBoolean(System.getProperty(RIENA_TEXT_RIDGET_DIRECTWRITING_PROPERTY, DIRECTWRITING_DEFAULT));
+ }
+
+ /**
* Are we running a <i>test case</i>?<br>
* If {@code true} certain services/functionalities behave more appropriate
* for testing, e.g. ridgets are created on the fly
diff --git a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java
index 3272e81..e1961fc 100644
--- a/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java
+++ b/org.eclipse.riena.ui.ridgets.swt/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidget.java
@@ -31,6 +31,7 @@ import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.riena.core.RienaStatus;
import org.eclipse.riena.ui.ridgets.IMarkableRidget;
import org.eclipse.riena.ui.ridgets.IRidget;
import org.eclipse.riena.ui.ridgets.ITextRidget;
@@ -64,13 +65,15 @@ public class TextRidget extends AbstractEditableRidget implements ITextRidget {
private String textValue = EMPTY_STRING;
private boolean isDirectWriting;
private IConverter inputConverter;
+ private final static boolean DEFAULT_DIRECTWRITING = RienaStatus.getDefaultTextRidgetDirectWritingEnabled();
public TextRidget() {
crKeyListener = new CRKeyListener();
focusListener = new FocusManager();
modifyListener = new SyncModifyListener();
verifyListener = new ValidationListener();
- isDirectWriting = false;
+ isDirectWriting = DEFAULT_DIRECTWRITING;
+
addPropertyChangeListener(IRidget.PROPERTY_ENABLED, new PropertyChangeListener() {
public void propertyChange(final PropertyChangeEvent evt) {
forceTextToControl(textValue);