} public void getKeyboardShortcut(AccessibleEvent e) { String shortcut = null; Label label = getAssociatedLabel (); if (label != null) { String text = label.getText (); if (text != null) { char mnemonic = _findMnemonic (text); if (mnemonic != '\0') { shortcut = "Alt+"+mnemonic; } } } e.result = shortcut;
void initializeAccessible() {	final Accessible accessible = getAccessible();	accessible.addAccessibleListener(new AccessibleAdapter() {		public void getHelp(AccessibleEvent e) {			e.result = getToolTipText();		}	});	accessible.addAccessibleTextListener(new AccessibleTextAdapter() {		public void getCaretOffset(AccessibleTextEvent e) {			e.offset = StyledText.this.getCaretOffset();		}		public void getSelectionRange(AccessibleTextEvent e) {			Point selection = StyledText.this.getSelectionRange();			e.offset = selection.x;			e.length = selection.y;		}	});	accessible.addAccessibleControlListener(new AccessibleControlAdapter() {		public void getRole(AccessibleControlEvent e) {			e.detail = ACC.ROLE_TEXT;		}		public void getState(AccessibleControlEvent e) {			int state = 0;			if (isEnabled()) state |= ACC.STATE_FOCUSABLE;			if (isFocusControl()) state |= ACC.STATE_FOCUSED;			if (!isVisible()) state |= ACC.STATE_INVISIBLE;			if (!getEditable()) state |= ACC.STATE_READONLY;			e.detail = state;		}		public void getValue(AccessibleControlEvent e) {			e.result = StyledText.this.getText();		}	});			addListener(SWT.FocusIn, new Listener() {		public void handleEvent(Event event) {			accessible.setFocus(ACC.CHILDID_SELF);		}	});}