View | Details | Raw Unified | Return to bug 320064 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java (-14 / +14 lines)
Lines 610-622 Link Here
610
 * Return the Label immediately preceding the receiver in the z-order, 
610
 * Return the Label immediately preceding the receiver in the z-order, 
611
 * or null if none. 
611
 * or null if none. 
612
 */
612
 */
613
Label getAssociatedLabel () {
613
String getAssociatedLabel () {
614
	Control[] siblings = getParent ().getChildren ();
614
	Control[] siblings = getParent ().getChildren ();
615
	for (int i = 0; i < siblings.length; i++) {
615
	for (int i = 0; i < siblings.length; i++) {
616
		if (siblings [i] == this) {
616
		if (siblings [i] == this) {
617
			if (i > 0 && siblings [i-1] instanceof Label) {
617
			if (i > 0) {
618
				return (Label) siblings [i-1];
618
				Control sibling = siblings [i-1];
619
				if (sibling instanceof Label) return ((Label) sibling).getText();
620
				if (sibling instanceof CLabel) return ((CLabel) sibling).getText();
619
			}
621
			}
622
			break;
620
		}
623
		}
621
	}
624
	}
622
	return null;
625
	return null;
Lines 937-958 Link Here
937
	AccessibleAdapter accessibleAdapter = new AccessibleAdapter () {
940
	AccessibleAdapter accessibleAdapter = new AccessibleAdapter () {
938
		public void getName (AccessibleEvent e) {
941
		public void getName (AccessibleEvent e) {
939
			String name = null;
942
			String name = null;
940
			Label label = getAssociatedLabel ();
943
			String text = getAssociatedLabel ();
941
			if (label != null) {
944
			if (text != null) {
942
				name = stripMnemonic (label.getText());
945
				name = stripMnemonic (text);
943
			}
946
			}
944
			e.result = name;
947
			e.result = name;
945
		}
948
		}
946
		public void getKeyboardShortcut(AccessibleEvent e) {
949
		public void getKeyboardShortcut(AccessibleEvent e) {
947
			String shortcut = null;
950
			String shortcut = null;
948
			Label label = getAssociatedLabel ();
951
			String text = getAssociatedLabel ();
949
			if (label != null) {
952
			if (text != null) {
950
				String text = label.getText ();
953
				char mnemonic = _findMnemonic (text);
951
				if (text != null) {
954
				if (mnemonic != '\0') {
952
					char mnemonic = _findMnemonic (text);
955
					shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
953
					if (mnemonic != '\0') {
954
						shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
955
					}
956
				}
956
				}
957
			}
957
			}
958
			e.result = shortcut;
958
			e.result = shortcut;
(-)Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java (-14 / +14 lines)
Lines 6336-6344 Link Here
6336
	accessible.addAccessibleListener(new AccessibleAdapter() {
6336
	accessible.addAccessibleListener(new AccessibleAdapter() {
6337
		public void getName (AccessibleEvent e) {
6337
		public void getName (AccessibleEvent e) {
6338
			String name = null;
6338
			String name = null;
6339
			Label label = getAssociatedLabel ();
6339
			String text = getAssociatedLabel ();
6340
			if (label != null) {
6340
			if (text != null) {
6341
				name = stripMnemonic (label.getText());
6341
				name = stripMnemonic (text);
6342
			}
6342
			}
6343
			e.result = name;
6343
			e.result = name;
6344
		}
6344
		}
Lines 6347-6360 Link Here
6347
		}
6347
		}
6348
		public void getKeyboardShortcut(AccessibleEvent e) {
6348
		public void getKeyboardShortcut(AccessibleEvent e) {
6349
			String shortcut = null;
6349
			String shortcut = null;
6350
			Label label = getAssociatedLabel ();
6350
			String text = getAssociatedLabel ();
6351
			if (label != null) {
6351
			if (text != null) {
6352
				String text = label.getText ();
6352
				char mnemonic = _findMnemonic (text);
6353
				if (text != null) {
6353
				if (mnemonic != '\0') {
6354
					char mnemonic = _findMnemonic (text);
6354
					shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
6355
					if (mnemonic != '\0') {
6356
						shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
6357
					}
6358
				}
6355
				}
6359
			}
6356
			}
6360
			e.result = shortcut;
6357
			e.result = shortcut;
Lines 6799-6811 Link Here
6799
 * Return the Label immediately preceding the receiver in the z-order, 
6796
 * Return the Label immediately preceding the receiver in the z-order, 
6800
 * or null if none. 
6797
 * or null if none. 
6801
 */
6798
 */
6802
Label getAssociatedLabel () {
6799
String getAssociatedLabel () {
6803
	Control[] siblings = getParent ().getChildren ();
6800
	Control[] siblings = getParent ().getChildren ();
6804
	for (int i = 0; i < siblings.length; i++) {
6801
	for (int i = 0; i < siblings.length; i++) {
6805
		if (siblings [i] == StyledText.this) {
6802
		if (siblings [i] == StyledText.this) {
6806
			if (i > 0 && siblings [i-1] instanceof Label) {
6803
			if (i > 0) {
6807
				return (Label) siblings [i-1];
6804
				Control sibling = siblings [i-1];
6805
				if (sibling instanceof Label) return ((Label) sibling).getText();
6806
				if (sibling instanceof CLabel) return ((CLabel) sibling).getText();
6808
			}
6807
			}
6808
			break;
6809
		}
6809
		}
6810
	}
6810
	}
6811
	return null;
6811
	return null;

Return to bug 320064