本文整理汇总了Java中org.eclipse.swt.accessibility.AccessibleAdapter类的典型用法代码示例。如果您正苦于以下问题:Java AccessibleAdapter类的具体用法?Java AccessibleAdapter怎么用?Java AccessibleAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AccessibleAdapter类属于org.eclipse.swt.accessibility包,在下文中一共展示了AccessibleAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAccessibleListener
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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;
}
}
}
}
};
}
示例2: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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;
}
} );
}
示例3: initButton
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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;
}
});
}
示例4: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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;
}
});
}
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:15,代码来源:HTMLAngularEditorSyntaxColoringPreferencePage.java
示例5: setAccessibilityText
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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;
}
});
}
示例6: setAccessibilityText
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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;
}
}
});
}
示例7: addAccessibleListeners
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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;
}
});
}
示例8: addAccessibleListeners
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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;
}
});
}
示例9: addScreenReaderAccessbility
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
/**
* 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$
}
} );
}
}
}
示例10: setAccessibilityText
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
private void setAccessibilityText( Control control, final String text )
{
control.getAccessible( )
.addAccessibleListener( new AccessibleAdapter( ) {
public void getName( AccessibleEvent e )
{
e.result = text;
}
} );
}
示例11: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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();
}
}
}
} );
}
}
示例12: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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( );
}
}
}
} );
}
}
示例13: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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( );
}
}
}
} );
}
}
示例14: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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( );
}
}
} );
}
}
示例15: setAccessible
import org.eclipse.swt.accessibility.AccessibleAdapter; //导入依赖的package包/类
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$
}
}
} );
}
}