protected AccessibleEditPart getAccessibleEditPart() { if (accPart == null) accPart = new AccessibleGraphicalEditPart() { public void getDescription(AccessibleEvent e) { if (getRulerProvider() != null) getRulerProvider().getAccGuideDescription(e, getModel()); } public void getName(AccessibleEvent e) { if (getRulerProvider() != null) getRulerProvider().getAccGuideName(e, getModel()); } public void getValue(AccessibleControlEvent e) { if (getRulerProvider() != null) getRulerProvider().getAccGuideValue(e, getModel()); } }; return accPart; }
protected AccessibleEditPart getAccessibleEditPart() { if (accPart == null) accPart = new AccessibleGraphicalEditPart() { public void getDescription(AccessibleEvent e) { if (getRulerProvider() != null) getRulerProvider() .getAccGuideDescription(e, getModel()); } public void getName(AccessibleEvent e) { if (getRulerProvider() != null) getRulerProvider().getAccGuideName(e, getModel()); } public void getValue(AccessibleControlEvent e) { if (getRulerProvider() != null) getRulerProvider().getAccGuideValue(e, getModel()); } }; return accPart; }
/** * Get the accessible listener for the tool bar. * * @return AccessibleListener * * @since 3.1 */ private AccessibleListener getAccessibleListener() { return new AccessibleAdapter() { public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { ToolItem item = toolBar.getItem(e.childID); if (item != null) { String toolTip = item.getToolTipText(); if (toolTip != null) { e.result = toolTip; } } } } }; }
/** * Specifically set the reporting name of a control for accessibility */ private void setAccessible( Control control, String name ) { if ( control == null ) return; final String n = name; control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { if ( e.childID == ACC.CHILDID_SELF ) e.result = n; } } ); }
private void initButton(Image im, final String tt) { toolButton.setImage(im); toolButton.setToolTipText(tt); toolbar.setVisible(true); toolbar.getParent().layout(); // must layout toolbar.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(AccessibleEvent e) { e.result = tt; } }); }
/** * Specifically set the reporting name of a control for accessibility */ private void setAccessible(Control control, String name) { if (control == null) return; final String n = name; control.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent e) { if (e.childID == ACC.CHILDID_SELF) e.result = n; } }); }
/** * Adds an accessibility listener returning the given fixed name. * * @param control * the control to add the accessibility support to * @param text * the name */ public static void setAccessibilityText(Control control, final String text) { control.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(AccessibleEvent e) { e.result = text; } }); }
/** * @generated */ protected AccessibleEditPart getAccessibleEditPart() { if (accessibleEP == null) { accessibleEP = new AccessibleGraphicalEditPart() { public void getName(AccessibleEvent e) { e.result = getLabelTextHelper(getFigure()); } }; } return accessibleEP; }
protected AccessibleEditPart getAccessibleEditPart() { if (accPart == null) accPart = new AccessibleGraphicalEditPart() { public void getName(AccessibleEvent e) { e.result = isHorizontal() ? "Horizontal" : "Vertical"; //$NON-NLS-1$ //$NON-NLS-2$ } public void getDescription(AccessibleEvent e) { e.result = "Ruler"; //$NON-NLS-1$ } }; return accPart; }
/** * Adds an accessibility listener returning the given fixed name. * * @param control the control to add the accessibility support to * @param text the name */ public static void setAccessibilityText(Control control, final String text) { control.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(AccessibleEvent e) { if (e.childID == ACC.CHILDID_SELF) { e.result= text; } } }); }
private void addAccessibleListeners(Label label, final Image image) { label.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent event) { final String accessibleMessage = getAccessibleMessageFor(image); if (accessibleMessage == null) { return; } event.result = accessibleMessage; } }); }
protected AccessibleEditPart getAccessibleEditPart() { if (accPart == null) accPart = new AccessibleGraphicalEditPart() { public void getName(AccessibleEvent e) { e.result = isHorizontal() ? GEFMessages.Ruler_Horizontal_Label : GEFMessages.Ruler_Vertical_Label; } public void getDescription(AccessibleEvent e) { e.result = GEFMessages.Ruler_Desc; } }; return accPart; }
/** @see AccessibleListener#getDescription(AccessibleEvent) */ public void getDescription(AccessibleEvent e) { EventDispatcher.AccessibilityDispatcher ad; ad = getEventDispatcher().getAccessibilityDispatcher(); if (ad != null) ad.getDescription(e); }
/** @see AccessibleListener#getHelp(AccessibleEvent) */ public void getHelp(AccessibleEvent e) { EventDispatcher.AccessibilityDispatcher ad; ad = getEventDispatcher().getAccessibilityDispatcher(); if (ad != null) ad.getHelp(e); }
/** @see AccessibleListener#getKeyboardShortcut(AccessibleEvent) */ public void getKeyboardShortcut(AccessibleEvent e) { EventDispatcher.AccessibilityDispatcher ad; ad = getEventDispatcher().getAccessibilityDispatcher(); if (ad != null) ad.getKeyboardShortcut(e); }
/** @see AccessibleListener#getName(AccessibleEvent) */ public void getName(AccessibleEvent e) { EventDispatcher.AccessibilityDispatcher ad; ad = getEventDispatcher().getAccessibilityDispatcher(); if (ad != null) ad.getName(e); }
/** * Add an accessible listener to the label if it can be inferred from the * image. * * @param label * @param image */ private void addAccessibleListeners(Label label, final Image image) { label.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent event) { final String accessibleMessage = getAccessibleMessageFor(image); if (accessibleMessage == null) { return; } event.result = accessibleMessage; } }); }
@Override protected AccessibleEditPart createAccessible() { return new AccessibleGraphicalEditPart() { @Override public void getName(AccessibleEvent e) { e.result = InstallOptionsPlugin.getResourceString("install.options.dialog.name"); //$NON-NLS-1$ } }; }
/** * Add specified description to composite to support Screen Reader tool. * * @param composite composite * @param description description */ public static void addScreenReaderAccessbility( Control composite, final String description ) { if ( composite == null ) { // if control component is null, do nothing. return; } if ( description != null ) { if ( composite instanceof Spinner ) { addSpinnerScreenReaderAccessbility( (Spinner) composite, description ); } else { composite.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { e.result = description.replaceAll( "&", IConstants.EMPTY_STRING ) //$NON-NLS-1$ .replaceAll( ":", IConstants.EMPTY_STRING ) //$NON-NLS-1$ .replaceAll( "\\*", IConstants.EMPTY_STRING ); //$NON-NLS-1$ } } ); } } }
private void setAccessibilityText( Control control, final String text ) { control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { e.result = text; } } ); }
protected AccessibleEditPart getAccessibleEditPart( ) { if ( accPart == null ) accPart = new AccessibleGraphicalEditPart( ) { public void getDescription( AccessibleEvent e ) { if ( getRulerProvider( ) != null ) getRulerProvider( ).getAccGuideDescription( e, getModel( ) ); } public void getName( AccessibleEvent e ) { if ( getRulerProvider( ) != null ) getRulerProvider( ).getAccGuideName( e, getModel( ) ); } public void getValue( AccessibleControlEvent e ) { if ( getRulerProvider( ) != null ) getRulerProvider( ).getAccGuideValue( e, getModel( ) ); } }; return accPart; }
private void setAccessible (final Control control) { if ( control instanceof Composite ) { Composite parent = (Composite)control; if ( parent != null && parent.getTabList( ) != null ) { Control[] children = parent.getTabList( ); for ( int i = 0; i < children.length; i++ ) { setAccessible( children[i] ); } } } else { control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { Label lbl = getLabelControl( ); if ( lbl != null ) { if (control instanceof Text) { e.result = UIUtil.stripMnemonic( getLabelControl( ).getText( )) + ((Text) control).getText(); } } } } ); } }
private void setAccessible( final Control control ) { if ( control instanceof Composite ) { Composite parent = (Composite) control; if ( parent != null && parent.getTabList( ) != null ) { Control[] children = parent.getTabList( ); for ( int i = 0; i < children.length; i++ ) { setAccessible( children[i] ); } } } else { control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { Label lbl = getLabelControl( ); if ( lbl != null ) { if (control instanceof Text) { e.result = UIUtil.stripMnemonic( getLabelControl( ).getText( ) ) + ((Text) control).getText( ); } } } } ); } }
private void setAccessible (final Control control) { if ( control instanceof Composite ) { Composite parent = (Composite)control; if ( parent != null && parent.getTabList( ) != null ) { Control[] children = parent.getTabList( ); for ( int i = 0; i < children.length; i++ ) { setAccessible( children[i] ); } } } else { control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { Label lbl = getLabelControl( ); if ( lbl != null ) { if (control instanceof Button) { e.result = UIUtil.stripMnemonic( getLabelControl( ).getText( )) + JFaceResources.getString( "ColorSelector.Name" ); //$NON-NLS-1$ } else if (control instanceof Text) { e.result = UIUtil.stripMnemonic( getLabelControl( ).getText( )) + ((Text) control).getText( ); } } } } ); } }
private void setAccessible( Control control ) { if ( control instanceof Composite ) { Composite parent = (Composite)control; if ( parent != null && parent.getTabList( ) != null ) { Control[] children = parent.getTabList( ); for ( int i = 0; i < children.length; i++ ) { setAccessible( children[i] ); } } } else { control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { Label lbl = getLabelControl( ); if ( lbl != null ) { e.result = UIUtil.stripMnemonic( getLabelControl( ).getText( )) + fontSize.getFontSizeValue( ); } } } ); } }
private void setAccessible(final Control control) { if ( control instanceof Composite ) { Composite parent = (Composite)control; if ( parent != null && parent.getTabList( ) != null ) { Control[] children = parent.getTabList( ); for ( int i = 0; i < children.length; i++ ) { setAccessible( children[i] ); } } } else { control.getAccessible( ) .addAccessibleListener( new AccessibleAdapter( ) { public void getName( AccessibleEvent e ) { if ( control instanceof Text && control.getParent( ) instanceof ExpressionComposite ) { e.result = UIUtil.stripMnemonic(Messages.getString( "VisibilityPage.Label.Expression" )) + ((Text)control).getText( ); //$NON-NLS-1$ } } } ); } }