Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Szijjarto2013-11-25 15:45:38 -0500
committerRoberto Escobar2013-11-25 17:19:31 -0500
commit80d977c636be498b7d7f8b5605a0fa87931a03c5 (patch)
tree5f9b80abca333b2ed5935030bfb5298f8d738ee8
parent166832b7e7d777b88755939d6c094258de40e31e (diff)
downloadorg.eclipse.osee-80d977c636be498b7d7f8b5605a0fa87931a03c5.tar.gz
org.eclipse.osee-80d977c636be498b7d7f8b5605a0fa87931a03c5.tar.xz
org.eclipse.osee-80d977c636be498b7d7f8b5605a0fa87931a03c5.zip
bug[ats_0N0ZS]: AdaName validation XText fix0.15.0.v201311261614_REL0.15.0.v201311260032_RC
Change-Id: I8af4044f41f39465a067849be03ac61ecfd45ab4 Signed-off-by: John Szijjarto <john.j.szijjarto@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java49
1 files changed, 28 insertions, 21 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
index 3127085660..2f558562cf 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java
@@ -22,6 +22,8 @@ import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -117,20 +119,6 @@ public class XText extends XWidget {
}
this.parent = parent;
-
- ModifyListener textListener = new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- if (sText != null) {
- debug("modifyText");
- text = sText.getText();
- validate();
- notifyXModifiedListeners();
- }
- }
- };
-
if (fillVertically) {
composite = new Composite(parent, SWT.NONE);
GridLayout layout = ALayout.getZeroMarginLayout(1, false);
@@ -188,7 +176,26 @@ public class XText extends XWidget {
sText.setLayoutData(gd);
sText.setMenu(getDefaultMenu());
- sText.addModifyListener(textListener);
+ sText.addModifyListener(new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ if (Widgets.isAccessible(sText)) {
+ text = sText.getText();
+ notifyXModifiedListeners();
+ }
+ }
+ });
+ sText.addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusLost(org.eclipse.swt.events.FocusEvent e) {
+ if (Widgets.isAccessible(sText)) {
+ text = sText.getText();
+ validate();
+ }
+ }
+ });
if (text != null) {
sText.setText(text);
}
@@ -412,6 +419,12 @@ public class XText extends XWidget {
}
}
+ public void addFocusListener(FocusListener focusListener) {
+ if (sText != null) {
+ sText.addFocusListener(focusListener);
+ }
+ }
+
public String get() {
if (debug) {
System.err.println("text set *" + text + "*");
@@ -511,12 +524,6 @@ public class XText extends XWidget {
this.dragableArtifact = dragableArtifact;
}
- public void debug(String str) {
- if (debug) {
- System.err.println("AText :" + str);
- }
- }
-
@Override
public IStatus isValid() {
IStatus status = super.isValid();

Back to the top