Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-07-15 00:13:51 +0000
committerRyan D. Brooks2011-07-15 00:13:51 +0000
commit5e11404d5ec635fdac5ead50ca8d30b648a09ca8 (patch)
tree2b87aeae203226b3b63032da3d6e887887c6e52e
parent983babb0f3de45a197b042b362b2f80a763cf67a (diff)
downloadorg.eclipse.osee-0.9.8.v201107141202_SR2_RC.tar.gz
org.eclipse.osee-0.9.8.v201107141202_SR2_RC.tar.xz
org.eclipse.osee-0.9.8.v201107141202_SR2_RC.zip
bug: Fix running out of graphics objects in EmailGroupsBlam0.9.8.v201107181202_SR2_RC0.9.8.v201107181202_SR20.9.8.v201107141202_SR2_RC
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java51
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java33
2 files changed, 38 insertions, 46 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java
index 84e3cc43e8e..0c53d56525c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/EmailGroupsBlam.java
@@ -48,18 +48,21 @@ import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.HtmlDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Ryan D. Brooks
*/
-public class EmailGroupsBlam extends AbstractBlam implements XModifiedListener {
+public class EmailGroupsBlam extends AbstractBlam {
private XArtifactList templateList, groupsList;
private XText bodyTextBox;
private XText subjectTextBox;
private XCheckBox isBodyHtmlCheckbox;
private ExecutorService emailTheadPool;
private final Collection<Future<String>> futures = new ArrayList<Future<String>>(300);
+ private final XModifiedListener listener = new ModificationListerner();
@Override
public String getName() {
@@ -135,10 +138,10 @@ public class EmailGroupsBlam extends AbstractBlam implements XModifiedListener {
ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.UserGroup, BranchManager.getCommonBranch());
Collections.sort(groups);
listViewer.setInputArtifacts(groups);
- listViewer.addXModifiedListener(this);
+ listViewer.addXModifiedListener(listener);
} else if (xWidget.getLabel().equals("Template")) {
templateList = (XArtifactList) xWidget;
- templateList.addXModifiedListener(this);
+ templateList.addXModifiedListener(listener);
} else if (xWidget.getLabel().equals("Body")) {
bodyTextBox = (XText) xWidget;
} else if (xWidget.getLabel().equals("Body is html")) {
@@ -164,6 +167,13 @@ public class EmailGroupsBlam extends AbstractBlam implements XModifiedListener {
}
});
}
+ if (xWidget.getLabel().equals("Body")) {
+ XText xText = ((XText) xWidget);
+ GridData data1 = new GridData(SWT.FILL, SWT.FILL, true, true);
+ data1.heightHint = 300;
+ data1.widthHint = 300;
+ xText.getStyledText().setLayoutData(data1);
+ }
}
private void handlePreviewMessage() {
@@ -209,24 +219,27 @@ public class EmailGroupsBlam extends AbstractBlam implements XModifiedListener {
return Arrays.asList("Util");
}
- @Override
- public void widgetModified(XWidget xWidget) {
- try {
- if (xWidget == templateList) {
- Artifact template = (Artifact) templateList.getSelected().iterator().next();
- subjectTextBox.set(template.getName());
- String body = template.getSoleAttributeValue(CoreAttributeTypes.GeneralStringData);
- bodyTextBox.set(body);
- } else {
- XArtifactList groupList = (XArtifactList) xWidget;
- Collection<Artifact> templates = new ArrayList<Artifact>();
- for (Object group : groupList.getSelected()) {
- templates.addAll(((Artifact) group).getChildren());
+ private class ModificationListerner implements XModifiedListener {
+
+ @Override
+ public void widgetModified(XWidget xWidget) {
+ try {
+ if (xWidget == templateList) {
+ Artifact template = (Artifact) templateList.getSelected().iterator().next();
+ subjectTextBox.set(template.getName());
+ String body = template.getSoleAttributeValue(CoreAttributeTypes.GeneralStringData);
+ bodyTextBox.set(body);
+ } else {
+ XArtifactList groupList = (XArtifactList) xWidget;
+ Collection<Artifact> templates = new ArrayList<Artifact>();
+ for (Object group : groupList.getSelected()) {
+ templates.addAll(((Artifact) group).getChildren());
+ }
+ templateList.setInputArtifacts(templates);
}
- templateList.setInputArtifacts(templates);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
}
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java
index d6267d8c612..095acd8b078 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/sections/BlamInputSection.java
@@ -18,11 +18,9 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
-import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidgetUtility;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
-import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
import org.eclipse.osee.framework.ui.swt.Widgets;
@@ -40,12 +38,10 @@ import org.eclipse.ui.forms.widgets.Section;
* @author Roberto E. Escobar
*/
public class BlamInputSection extends BaseBlamSection {
-
- private final Collection<DynamicXWidgetLayoutData> dynamicInputLayouts;
+ private final Collection<DynamicXWidgetLayoutData> dynamicInputLayouts = new ArrayList<DynamicXWidgetLayoutData>();
public BlamInputSection(FormEditor editor, AbstractBlam abstractBlam, Composite parent, FormToolkit toolkit, int style) {
super(editor, abstractBlam, parent, toolkit, style);
- this.dynamicInputLayouts = new ArrayList<DynamicXWidgetLayoutData>();
}
@Override
@@ -54,7 +50,9 @@ public class BlamInputSection extends BaseBlamSection {
Section section = getSection();
section.setText("Parameters");
section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ section.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ updateDataPart();
}
public VariableMap getData() {
@@ -77,7 +75,7 @@ public class BlamInputSection extends BaseBlamSection {
}
Composite sectionBody = toolkit.createComposite(section, toolkit.getBorderStyle());
sectionBody.setLayout(new GridLayout());
- sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ sectionBody.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
createWidgets(sectionBody);
@@ -86,21 +84,13 @@ public class BlamInputSection extends BaseBlamSection {
section.layout(true);
form.getForm().getBody().layout(true);
-
}
private void createWidgets(Composite parent) {
try {
List<DynamicXWidgetLayoutData> layoutDatas = getDynamicXWidgetLayouts();
WorkPage workPage = new WorkPage(layoutDatas, new DefaultXWidgetOptionResolver(), getAbstractBlam());
- workPage.createBody(getManagedForm(), parent, null, new XModifiedListener() {
-
- @Override
- public void widgetModified(XWidget widget) {
- getManagedForm().reflow(true);
- }
-
- }, true);
+ workPage.createBody(getManagedForm(), parent, null, null, true);
} catch (Exception ex) {
OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
}
@@ -116,16 +106,5 @@ public class BlamInputSection extends BaseBlamSection {
@Override
public void refresh() {
super.refresh();
- updateDataPart();
- }
-
- public void setDynamicXWidgetLayouts(Collection<DynamicXWidgetLayout> layouts) {
- if (layouts != null) {
- this.dynamicInputLayouts.clear();
- for (DynamicXWidgetLayout layout : layouts) {
- this.dynamicInputLayouts.addAll(layout.getLayoutDatas());
- }
- refresh();
- }
}
}

Back to the top