本文整理了Java中org.eclipse.swt.widgets.Scrollable.getAdapter()
方法的一些代码示例,展示了Scrollable.getAdapter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scrollable.getAdapter()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Scrollable
类名称:Scrollable
方法名:getAdapter
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter( Class<T> adapter ) {
if( adapter == ICompositeAdapter.class ) {
return ( T )compositeAdapter;
}
if( adapter == WidgetLCA.class ) {
return ( T )CompositeLCA.INSTANCE;
}
return super.getAdapter( adapter );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter( Class<T> adapter ) {
if( adapter == ITextAdapter.class ) {
if( textAdapter == null ) {
textAdapter = new ITextAdapter() {
@Override
public void setText( String text ) {
if( internalSetText( text ) ) {
adjustSelection();
notifyListeners( SWT.Modify, new Event() );
}
}
};
}
return ( T )textAdapter;
}
if( adapter == WidgetLCA.class ) {
return ( T )TextLCA.INSTANCE;
}
return super.getAdapter( adapter );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter( Class<T> adapter ) {
if( adapter == IListAdapter.class ) {
if( listAdapter == null ) {
listAdapter = new IListAdapter() {
@Override
public void setFocusIndex( int focusIndex ) {
List.this.setFocusIndex( focusIndex );
}
@Override
public Point getItemDimensions() {
return List.this.getItemDimensions();
}
};
}
return ( T )listAdapter;
}
if( adapter == WidgetLCA.class ) {
return ( T )ListLCA.INSTANCE;
}
return super.getAdapter( adapter );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* Compute the area required for trim.
*
* @param area
* @param scrollable
* @param currentWidth
* @return int
*/
private int computeTrim(Rectangle area, Scrollable scrollable,
int currentWidth) {
int trim;
if (currentWidth > 1) {
trim = currentWidth - scrollable.getClientArea().width;
} else {
// initially, the table has no extend and no client area - use the
// border with
// plus some padding as educated guess
ControlThemeAdapter themeAdapter = scrollable.getAdapter( ControlThemeAdapter.class );
BoxDimensions border = themeAdapter.getBorder( scrollable );
trim = border.left + border.right + 1;
}
return trim;
}
内容来源于网络,如有侵权,请联系作者删除!