summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2012-08-01 11:31:32 (EDT)
committerRoberto E. Escobar2012-08-01 11:31:32 (EDT)
commitc76defd4e9202dbeba28d6a5d169d2a889dae8d6 (patch)
tree6bd0db6b3b0a6d56f3619c6d4cd20ffe96fca02c
parent742a64277fd0fc21df66305132df3e79df10ae9a (diff)
downloadorg.eclipse.osee-c76defd4e9202dbeba28d6a5d169d2a889dae8d6.zip
org.eclipse.osee-c76defd4e9202dbeba28d6a5d169d2a889dae8d6.tar.gz
org.eclipse.osee-c76defd4e9202dbeba28d6a5d169d2a889dae8d6.tar.bz2
feature[ats_04296]: Move XText specific functionality in SwtXWidgetRenderer to XText
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XText.java29
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/SwtXWidgetRenderer.java20
2 files changed, 26 insertions, 23 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 87fe1ed..3127085 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
@@ -57,6 +57,7 @@ public class XText extends XWidget {
private XTextSpellModifyDictionary modDict;
private Font font;
Composite composite = null;
+ private boolean dynamicallyCreated = false;
public XText() {
this("XText");
@@ -70,6 +71,10 @@ public class XText extends XWidget {
sText.setEnabled(enabled);
}
+ public void setDynamicallyCreated(boolean value) {
+ dynamicallyCreated = value;
+ }
+
public void setSize(int width, int height) {
this.width = width;
this.height = height;
@@ -154,21 +159,33 @@ public class XText extends XWidget {
sText = new StyledText(composite, getTextStyle());
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
if (verticalLabel) {
gd.horizontalSpan = horizontalSpan;
} else {
gd.horizontalSpan = horizontalSpan - 1;
}
-
- if (!fillVertically) {
- gd.grabExcessVerticalSpace = false;
- } else {
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalAlignment = GridData.FILL;
+ if (fillVertically) {
+ gd.grabExcessVerticalSpace = true;
+ gd.verticalAlignment = GridData.FILL;
if (height > 0) {
gd.heightHint = height;
}
+ if (dynamicallyCreated) {
+ if (height > 0) {
+ gd.minimumHeight = height;
+ } else {
+ gd.minimumHeight = 60;
+ }
+ }
}
- // gd.widthHint = 200;
+ if (fillHorizontally && dynamicallyCreated) {
+ gd.grabExcessHorizontalSpace = true;
+ gd.minimumWidth = 60;
+ }
+
sText.setLayoutData(gd);
sText.setMenu(getDefaultMenu());
sText.addModifyListener(textListener);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/SwtXWidgetRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/SwtXWidgetRenderer.java
index 333c0d0..63366df 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/SwtXWidgetRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/SwtXWidgetRenderer.java
@@ -155,7 +155,6 @@ public class SwtXWidgetRenderer {
continue;
}
if (inGroupComposite) {
- System.out.println("debug: groupcomp is " + groupComp);
currentComp = groupComp;
if (xWidgetLayoutData.isEndGroupComposite()) {
inGroupComposite = false;
@@ -186,8 +185,6 @@ public class SwtXWidgetRenderer {
}
if (inChildComposite) {
- System.out.println("debug: childcomp is " + childComp);
-
currentComp = childComp;
if (xWidgetLayoutData.isEndComposite()) {
inChildComposite = false;
@@ -217,18 +214,14 @@ public class SwtXWidgetRenderer {
if (xWidgetLayoutData.getXOptionHandler().contains(XOption.FILL_VERTICALLY)) {
xText.setFillVertically(true);
}
- }
-
- xWidget.createWidgets(managedForm, currentComp, 2);
-
- if (xWidget instanceof XText) {
- XText xText = (XText) xWidget;
-
if (xWidgetLayoutData.isHeightSet()) {
xText.setHeight(xWidgetLayoutData.getHeight());
}
+ xText.setDynamicallyCreated(true);
}
+ xWidget.createWidgets(managedForm, currentComp, 2);
+
if (xModListener != null) {
xWidget.addXModifiedListener(xModListener);
}
@@ -243,13 +236,6 @@ public class SwtXWidgetRenderer {
}
topLevelComp.layout();
- if (inChildComposite) {
- System.out.println("debug: unclosed child");
- }
- if (inGroupComposite) {
- System.out.println("debug: unclosed group");
- }
-
Displays.ensureInDisplayThread(new Runnable() {
@Override
public void run() {