Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 174467 Details for
Bug 320064
StyledText and CCombo should also use preceding CLabel as accessible name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for StyledText and CCombo to use CLabel as name
patch.txt (text/plain), 4.21 KB, created by
Carolyn MacLeod
on 2010-07-16 01:29:02 EDT
(
hide
)
Description:
patch for StyledText and CCombo to use CLabel as name
Filename:
MIME Type:
Creator:
Carolyn MacLeod
Created:
2010-07-16 01:29:02 EDT
Size:
4.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java,v >retrieving revision 1.139 >diff -u -r1.139 CCombo.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 31 May 2010 16:44:12 -0000 1.139 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java 16 Jul 2010 05:26:56 -0000 >@@ -610,17 +610,20 @@ > * Return the Label immediately preceding the receiver in the z-order, > * or null if none. > */ >-Label getAssociatedLabel () { >+Control getAssociatedLabel () { > Control[] siblings = getParent ().getChildren (); > for (int i = 0; i < siblings.length; i++) { > if (siblings [i] == this) { >- if (i > 0 && siblings [i-1] instanceof Label) { >- return (Label) siblings [i-1]; >+ if (i > 0 && (siblings [i-1] instanceof Label || siblings [i-1] instanceof CLabel)) { >+ return siblings [i-1]; > } > } > } > return null; > } >+String getLabelText(Control label) { >+ return label instanceof Label ? ((Label)label).getText () : ((CLabel)label).getText (); >+} > public Control [] getChildren () { > checkWidget(); > return new Control [0]; >@@ -937,17 +940,17 @@ > AccessibleAdapter accessibleAdapter = new AccessibleAdapter () { > public void getName (AccessibleEvent e) { > String name = null; >- Label label = getAssociatedLabel (); >+ Control label = getAssociatedLabel (); > if (label != null) { >- name = stripMnemonic (label.getText()); >+ name = stripMnemonic (getLabelText(label)); > } > e.result = name; > } > public void getKeyboardShortcut(AccessibleEvent e) { > String shortcut = null; >- Label label = getAssociatedLabel (); >+ Control label = getAssociatedLabel (); > if (label != null) { >- String text = label.getText (); >+ String text = getLabelText(label); > if (text != null) { > char mnemonic = _findMnemonic (text); > if (mnemonic != '\0') { >Index: Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java,v >retrieving revision 1.529 >diff -u -r1.529 StyledText.java >--- Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java 7 Jul 2010 14:07:46 -0000 1.529 >+++ Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java 16 Jul 2010 05:26:59 -0000 >@@ -6336,9 +6336,9 @@ > accessible.addAccessibleListener(new AccessibleAdapter() { > public void getName (AccessibleEvent e) { > String name = null; >- Label label = getAssociatedLabel (); >+ Control label = getAssociatedLabel (); > if (label != null) { >- name = stripMnemonic (label.getText()); >+ name = stripMnemonic (getLabelText(label)); > } > e.result = name; > } >@@ -6347,9 +6347,9 @@ > } > public void getKeyboardShortcut(AccessibleEvent e) { > String shortcut = null; >- Label label = getAssociatedLabel (); >+ Control label = getAssociatedLabel (); > if (label != null) { >- String text = label.getText (); >+ String text = getLabelText(label); > if (text != null) { > char mnemonic = _findMnemonic (text); > if (mnemonic != '\0') { >@@ -6799,17 +6799,20 @@ > * Return the Label immediately preceding the receiver in the z-order, > * or null if none. > */ >-Label getAssociatedLabel () { >+Control getAssociatedLabel () { > Control[] siblings = getParent ().getChildren (); > for (int i = 0; i < siblings.length; i++) { > if (siblings [i] == StyledText.this) { >- if (i > 0 && siblings [i-1] instanceof Label) { >- return (Label) siblings [i-1]; >+ if (i > 0 && (siblings [i-1] instanceof Label || siblings [i-1] instanceof CLabel)) { >+ return siblings [i-1]; > } > } > } > return null; > } >+String getLabelText(Control label) { >+ return label instanceof Label ? ((Label)label).getText () : ((CLabel)label).getText (); >+} > String stripMnemonic (String string) { > int index = 0; > int length = string.length ();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 320064
:
174467
|
175895