Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2012-07-23 22:34:37 +0000
committerRoberto E. Escobar2012-07-23 22:34:37 +0000
commiteff6c85b92116f9e596739b0e21e3b10d633a815 (patch)
tree7adfb4d4cdf86e2697dc47756711a5b27990fd1d
parent41ca46032448b0430c4eea3a68618fb853e2f33e (diff)
downloadorg.eclipse.osee-eff6c85b92116f9e596739b0e21e3b10d633a815.tar.gz
org.eclipse.osee-eff6c85b92116f9e596739b0e21e3b10d633a815.tar.xz
org.eclipse.osee-eff6c85b92116f9e596739b0e21e3b10d633a815.zip
feature[ats_04296]: Update SwtXwidgetRenderer for performance/readability
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DynamicXWidgetLayout.java46
1 files changed, 24 insertions, 22 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DynamicXWidgetLayout.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DynamicXWidgetLayout.java
index 9a9057cdb84..15056b9bfcb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DynamicXWidgetLayout.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/util/DynamicXWidgetLayout.java
@@ -102,6 +102,18 @@ public class DynamicXWidgetLayout {
for (DynamicXWidgetLayoutData xWidgetLayoutData : getLayoutDatas()) {
Composite useComp = attrComp;
+ GridData gd = new GridData();
+ useComp.setLayoutData(gd);
+ gd.horizontalAlignment = SWT.FILL;
+ gd.verticalAlignment = SWT.FILL;
+
+ // defaults to grab horizontal, causes scrollbars on items that extend past the provided window space
+ gd.grabExcessHorizontalSpace = true;
+
+ if (xWidgetLayoutData.getXOptionHandler().contains(XOption.FILL_VERTICALLY)) {
+ gd.grabExcessVerticalSpace = true;
+ }
+
if (xWidgetLayoutData.getBeginGroupComposite() > 0) {
groupComp = new Group(attrComp, SWT.None);
if (Strings.isValid(xWidgetLayoutData.getName())) {
@@ -201,38 +213,28 @@ public class DynamicXWidgetLayout {
XText xText = (XText) xWidget;
if (xWidgetLayoutData.getXOptionHandler().contains(XOption.FILL_HORIZONTALLY) && xWidgetLayoutData.getXOptionHandler().contains(
XOption.FILL_VERTICALLY)) {
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.minimumWidth = 60;
- gd.minimumHeight = 60;
- useComp.setLayoutData(gd);
-
- gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.minimumWidth = 60;
- gd.minimumHeight = 60;
- xText.getStyledText().setLayoutData(gd);
+
+ GridData gdi = new GridData(SWT.FILL, SWT.FILL, true, true);
+ //gdi.minimumWidth = 60;
+ //gdi.minimumHeight = 60;
+ xText.getStyledText().setLayoutData(gdi);
} else if (xWidgetLayoutData.getXOptionHandler().contains(XOption.FILL_HORIZONTALLY)) {
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.minimumWidth = 60;
- useComp.setLayoutData(gd);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.minimumWidth = 60;
- xText.getStyledText().setLayoutData(gd);
+ GridData gdi = new GridData(SWT.FILL, SWT.FILL, true, false);
+ //gdi.minimumWidth = 60;
+ xText.getStyledText().setLayoutData(gdi);
} else if (xWidgetLayoutData.getXOptionHandler().contains(XOption.FILL_VERTICALLY)) {
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.minimumHeight = 60;
- useComp.setLayoutData(gd);
- gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.minimumHeight = 60;
- xText.getStyledText().setLayoutData(gd);
+ GridData gdi = new GridData(SWT.FILL, SWT.FILL, true, true);
+ //gdi.minimumHeight = 60;
+ xText.getStyledText().setLayoutData(gdi);
}
if (xWidgetLayoutData.isHeightSet()) {
xText.setHeight(xWidgetLayoutData.getHeight());
}
}
- useComp.layout();
+ //useComp.layout();
if (xModListener != null) {
xWidget.addXModifiedListener(xModListener);

Back to the top