List of usage examples for org.eclipse.swt.custom StyledText getKeyBinding
public int getKeyBinding(int key)
From source file:StyledTextKeyBound.java
public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); StyledText styledText = new StyledText(shell, SWT.V_SCROLL | SWT.BORDER); styledText.setText("12345"); int zAction = styledText.getKeyBinding('z'); styledText.setBounds(10, 10, 100, 100); shell.open();/*from w w w . j a va2s . c o m*/ while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:StyledTextActionBound.java
public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); StyledText styledText = new StyledText(shell, SWT.V_SCROLL | SWT.BORDER); styledText.setText("12345"); int altEAction = styledText.getKeyBinding('e' | SWT.ALT); styledText.setBounds(10, 10, 100, 100); shell.open();/* w w w .j av a 2 s . co m*/ while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }
From source file:StyledTextActionBoundArrowShift.java
public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); StyledText styledText = new StyledText(shell, SWT.V_SCROLL | SWT.BORDER); styledText.setText("12345"); int shiftLeftAction = styledText.getKeyBinding(SWT.ARROW_LEFT | SWT.SHIFT); styledText.setBounds(10, 10, 100, 100); shell.open();/*from w w w . j a v a2s. c o m*/ while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); }