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; |