本文整理了Java中org.eclipse.swt.widgets.Spinner.getTextLimit()
方法的一些代码示例,展示了Spinner.getTextLimit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.getTextLimit()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Spinner
类名称:Spinner
方法名:getTextLimit
[英]Returns the maximum number of characters that the receiver's text field is capable of holding. If this has not been changed by setTextLimit()
, it will be the constant Spinner.LIMIT
.
[中]返回接收方文本字段能够容纳的最大字符数。如果该值未被setTextLimit()
更改,则它将是常量Spinner.LIMIT
。
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static Integer getTextLimit( Spinner spinner ) {
Integer result = null;
int textLimit = spinner.getTextLimit();
if( textLimit > 0 && textLimit != Spinner.LIMIT ) {
result = Integer.valueOf( textLimit );
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static void writeTextLimit( final Spinner spinner ) throws IOException
{
JSWriter writer = JSWriter.getWriterFor( spinner );
Integer newValue = new Integer( spinner.getTextLimit() );
Integer defValue = DEFAULT_TEXT_LIMIT;
String prop = PROP_TEXT_LIMIT;
if( WidgetLCAUtil.hasChanged( spinner, prop, newValue, defValue ) ) {
// Negative values are treated as 'no limit' which is achieved by passing
// null to the client-side maxLength property
if( newValue.intValue() < 0 ) {
newValue = null;
}
writer.set( "maxLength", newValue );
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public void preserveValues( final Widget widget ) {
Spinner spinner = ( Spinner )widget;
ControlLCAUtil.preserveValues( spinner );
IWidgetAdapter adapter = WidgetUtil.getAdapter( widget );
adapter.preserve( PROP_SELECTION, new Integer( spinner.getSelection() ) );
adapter.preserve( PROP_MINIMUM, new Integer( spinner.getMinimum() ) );
adapter.preserve( PROP_MAXIMUM, new Integer( spinner.getMaximum() ) );
adapter.preserve( PROP_DIGITS, new Integer( spinner.getDigits() ) );
adapter.preserve( PROP_INCREMENT, new Integer( spinner.getIncrement() ) );
adapter.preserve( PROP_PAGE_INCREMENT,
new Integer( spinner.getPageIncrement() ) );
adapter.preserve( PROP_MODIFY_LISTENER,
Boolean.valueOf( ModifyEvent.hasListener( spinner ) ) );
adapter.preserve( PROP_SELECTION_LISTENER,
Boolean.valueOf( SelectionEvent.hasListener( spinner ) ) );
adapter.preserve( PROP_TEXT_LIMIT, new Integer( spinner.getTextLimit() ) );
adapter.preserve( PROP_DECIMAL_SEPARATOR, getDecimalSeparator() );
WidgetLCAUtil.preserveCustomVariant( spinner );
}
内容来源于网络,如有侵权,请联系作者删除!