Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java
index e8cec3ed6..766ac78f6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorCommentPart.java
@@ -524,14 +524,26 @@ public class TaskEditorCommentPart extends AbstractTaskEditorPart {
String replyText = taskComment.getText();
if (hasTextControl()) {
Control textControl = commentTextEditor.getControl();
- if (textControl instanceof StyledText) {
- String selectedText = ((StyledText) textControl).getSelectionText();
+ String selectedText = getSelectedText(textControl);
+ if (!Strings.isNullOrEmpty(selectedText)) {
+ replyText = selectedText;
+ }
+ }
+ return replyText;
+ }
+
+ private String getSelectedText(Control control) {
+ if (control instanceof StyledText) {
+ return ((StyledText) control).getSelectionText();
+ } else if (control instanceof Composite) {
+ for (Control child : ((Composite) control).getChildren()) {
+ String selectedText = getSelectedText(child);
if (!Strings.isNullOrEmpty(selectedText)) {
- replyText = selectedText;
+ return selectedText;
}
}
}
- return replyText;
+ return null;
}
private boolean hasTextControl() {

Back to the top