use of javax.swing.text.DefaultEditorKit in project adempiere by adempiere.
the class CompiereTextAreaUI method updateFocusTraversalKeysX.
// propertyChange
/**
* UpdateFocusTraversalKeysX
*/
void updateFocusTraversalKeysX() {
if (m_editor == null)
return;
//
EditorKit editorKit = getEditorKit(m_editor);
if (editorKit != null && editorKit instanceof DefaultEditorKit) {
Set<AWTKeyStroke> storedForwardTraversalKeys = m_editor.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
Set<AWTKeyStroke> storedBackwardTraversalKeys = m_editor.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
Set<AWTKeyStroke> forwardTraversalKeys = new HashSet<AWTKeyStroke>(storedForwardTraversalKeys);
Set<AWTKeyStroke> backwardTraversalKeys = new HashSet<AWTKeyStroke>(storedBackwardTraversalKeys);
//
forwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
forwardTraversalKeys.remove(s_stroke);
backwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
//
LookAndFeel.installProperty(m_editor, "focusTraversalKeysForward", forwardTraversalKeys);
LookAndFeel.installProperty(m_editor, "focusTraversalKeysBackward", backwardTraversalKeys);
}
}
Aggregations