summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
diff options
context:
space:
mode:
authorMarkus Keller <markus_keller@ch.ibm.com>2012-10-22 16:22:32 +0200
committerMarkus Keller <markus_keller@ch.ibm.com>2012-10-22 16:22:32 +0200
commit9178084226d22a2dac6ad6639328d7eae3f4d9f6 (patch)
tree4576b2dd1069e3b1ceff4c96beab74539525e62e /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
parent2d2d6b12ada2e41a3b2177637d29211bf88279af (diff)
downloadeclipse.platform.swt-9178084226d22a2dac6ad6639328d7eae3f4d9f6.tar.gz
eclipse.platform.swt-9178084226d22a2dac6ad6639328d7eae3f4d9f6.tar.xz
eclipse.platform.swt-9178084226d22a2dac6ad6639328d7eae3f4d9f6.zip
Bug 250174: [BlockSelection] fix keyhandling in block selection mode
added "Select to content start/end"
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 408c869a43..d381f8e089 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -2306,6 +2306,12 @@ void doBlockColumn(boolean next) {
showLocation(rect, true);
}
}
+void doBlockContentStartEnd(boolean end) {
+ if (blockXLocation == -1) setBlockSelectionOffset(caretOffset, false);
+ int offset = end ? content.getCharCount() : 0;
+ setBlockSelectionOffset(offset, true);
+ showCaret();
+}
void doBlockWord(boolean next) {
if (blockXLocation == -1) setBlockSelectionOffset(caretOffset, false);
int x = blockXLocation - horizontalScrollOffset;
@@ -7054,10 +7060,14 @@ boolean invokeBlockAction(int action) {
return true;
case ST.SELECT_ALL:
return false;
- case ST.SELECT_PAGE_UP:
- case ST.SELECT_PAGE_DOWN:
case ST.SELECT_TEXT_START:
+ doBlockContentStartEnd(false);
+ break;
case ST.SELECT_TEXT_END:
+ doBlockContentStartEnd(true);
+ break;
+ case ST.SELECT_PAGE_UP:
+ case ST.SELECT_PAGE_DOWN:
case ST.SELECT_WINDOW_START:
case ST.SELECT_WINDOW_END:
//blocked actions