diff options
author | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2013-04-30 14:33:26 -0400 |
---|---|---|
committer | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2013-04-30 14:34:01 -0400 |
commit | aa3e919a69599b43400f732f0451789bbcd36cfe (patch) | |
tree | 5dec38f17405f043317f9b4a50dc9a6405fc1078 /examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java | |
parent | cc80e55a08b4e7765273631a1bcb40a5d6248668 (diff) | |
download | eclipse.platform.swt-aa3e919a69599b43400f732f0451789bbcd36cfe.tar.gz eclipse.platform.swt-aa3e919a69599b43400f732f0451789bbcd36cfe.tar.xz eclipse.platform.swt-aa3e919a69599b43400f732f0451789bbcd36cfe.zip |
added setTopIndex
Diffstat (limited to 'examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java')
-rw-r--r-- | examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java index f0de4af62b..7b414c8fa3 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet12.java @@ -11,7 +11,8 @@ package org.eclipse.swt.snippets; /* - * Text example snippet: set the selection (start, end) + * Text example snippet: set the selection (start, end), + * and then scroll the selection to the top of the client area * * For a list of all SWT example snippets see * http://www.eclipse.org/swt/snippets/ @@ -33,7 +34,9 @@ public static void main (String [] args) { } shell.open (); text.setSelection (30, 38); + text.setTopIndex(30); System.out.println ("selection=" + text.getSelection ()); + System.out.println ("selection text=" + text.getSelectionText ()); System.out.println ("caret position=" + text.getCaretPosition ()); System.out.println ("caret location=" + text.getCaretLocation ()); while (!shell.isDisposed ()) { |