当前位置: 首页>>代码示例>>Java>>正文


Java AccessibleAdapter类代码示例

本文整理汇总了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;
					}
				}
			}
		}
	};

}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:24,代码来源:ToolBarManager.java

示例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;
				}
			} );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ExpressionSyntaxColoringPage.java

示例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;
       	}
       });
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:14,代码来源:ProgressAnimationItem.java

示例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;
		}
	});
}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:SWTUtil.java

示例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;
			}
		}
	});
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:SWTUtil.java

示例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;
		}
	});
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:12,代码来源:CustomMessageDialog.java

示例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;
		}
	});
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:IconAndMessageDialog.java

示例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$
						}
					} );
		}
		
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:37,代码来源:ChartUIUtil.java

示例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;
				}
			} );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:BreadcrumbItemDropDown.java

示例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();
							}
						}
					}

				} );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:MarignSection.java

示例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( );
							}
						}
					}

				} );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:ComplexUnitSection.java

示例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( );
							}
						}
					}

				} );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:41,代码来源:ColorSection.java

示例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( );
						}
					}

				} );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:33,代码来源:FontSizeSection.java

示例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$
						}
					}
				} );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:30,代码来源:OutputSection.java


注:本文中的org.eclipse.swt.accessibility.AccessibleAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。