本文整理了Java中org.eclipse.swt.widgets.Text.getTextLimit()
方法的一些代码示例,展示了Text.getTextLimit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.getTextLimit()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Text
类名称:Text
方法名:getTextLimit
[英]Returns the maximum number of characters that the receiver is capable of holding.
If this has not been changed by setTextLimit()
, it will be the constant Text.LIMIT
.
[中]返回接收器能够容纳的最大字符数。
如果该值未被setTextLimit()
更改,则它将是常量Text.LIMIT
。
代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls
public int getTextLimit() {
return m_text.getTextLimit();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static Integer getTextLimit( Text text ) {
Integer result = null;
int textLimit = text.getTextLimit();
if( textLimit > 0 && textLimit != Text.LIMIT ) {
result = Integer.valueOf( textLimit );
}
return result;
}
代码示例来源:origin: BiglySoftware/BiglyBT
public void
setText(
String text )
{
txtInfo.setText( text);
txtInfo.setSelection( txtInfo.getTextLimit());
}
代码示例来源:origin: BiglySoftware/BiglyBT
public void
append(
String str )
{
txtInfo.setText( txtInfo.getText() + str );
txtInfo.setSelection( txtInfo.getTextLimit());
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* Returns the maximum number of characters that the receiver's
* text field is capable of holding. If this has not been changed
* by <code>setTextLimit()</code>, it will be the constant
* <code>Combo.LIMIT</code>.
*
* @return the text limit
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getTextLimit () {
checkWidget ();
return text.getTextLimit ();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Returns the maximum number of characters that the receiver's
* text field is capable of holding. If this has not been changed
* by <code>setTextLimit()</code>, it will be the constant
* <code>Combo.LIMIT</code>.
*
* @return the text limit
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getTextLimit () {
checkWidget ();
return text.getTextLimit ();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Returns the maximum number of characters that the receiver's
* text field is capable of holding. If this has not been changed
* by <code>setTextLimit()</code>, it will be the constant
* <code>Combo.LIMIT</code>.
*
* @return the text limit
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getTextLimit () {
checkWidget ();
return text.getTextLimit ();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Returns the maximum number of characters that the receiver's
* text field is capable of holding. If this has not been changed
* by <code>setTextLimit()</code>, it will be the constant
* <code>Combo.LIMIT</code>.
*
* @return the text limit
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getTextLimit () {
checkWidget ();
return text.getTextLimit ();
}
/**
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Returns the maximum number of characters that the receiver's
* text field is capable of holding. If this has not been changed
* by <code>setTextLimit()</code>, it will be the constant
* <code>Combo.LIMIT</code>.
*
* @return the text limit
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getTextLimit () {
checkWidget ();
return text.getTextLimit ();
}
/**
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
/**
* Returns the maximum number of characters that the receiver's
* text field is capable of holding. If this has not been changed
* by <code>setTextLimit()</code>, it will be the constant
* <code>Combo.LIMIT</code>.
*
* @return the text limit
*
* @exception org.eclipse.swt.SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public int getTextLimit () {
checkWidget ();
return text.getTextLimit ();
}
/**
代码示例来源:origin: BiglySoftware/BiglyBT
public void
append2(
String str )
{
txtInfo.append( str );
if ( str.contains( "\n" )){
// only scroll if the newly added text contains a new-line
// otherwise things get twitchy
txtInfo.setSelection( txtInfo.getTextLimit());
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
static void writeTextLimit( final Text text ) throws IOException {
JSWriter writer = JSWriter.getWriterFor( text );
Integer newValue = new Integer( text.getTextLimit() );
Integer defValue = DEFAULT_TEXT_LIMIT;
if( WidgetLCAUtil.hasChanged( text, PROP_TEXT_LIMIT, 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( JS_PROP_MAX_LENGTH, newValue );
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
static void preserveValues( final Text text ) {
IWidgetAdapter adapter = WidgetUtil.getAdapter( text );
adapter.preserve( PROP_TEXT, text.getText() );
adapter.preserve( PROP_SELECTION, text.getSelection() );
adapter.preserve( PROP_TEXT_LIMIT, new Integer( text.getTextLimit() ) );
adapter.preserve( PROP_READ_ONLY, Boolean.valueOf( ! text.getEditable() ) );
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
public void activate() {
Object element = fTreeItem.getData();
String value = cellModifier.getValue(element, fProperty).toString();
if (fControl instanceof Text) {
Text text = (Text) fControl;
int requiredSize = value.length() + 100;
if (text.getTextLimit() < requiredSize) {
text.setTextLimit(requiredSize);
}
}
Rectangle r = fTreeItem.getBounds();
if (r != null) {
fControl.setBounds(columnPosition + 5, r.y + 1, fTree1.getClientArea().width - (columnPosition + 5), r.height - 1);
fControl.setVisible(true);
fCellEditor.setValue(value);
fCellEditor.addListener(this);
fCellEditor.setFocus();
fControl.addFocusListener(this);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
textTriggerSequenceManager.insert(trappedKey);
textTriggerSequence.setFocus();
textTriggerSequence.setSelection(textTriggerSequence.getTextLimit());
}));
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
activeBinding.setTrigger(keySequence);
fBindingText.setSelection(fBindingText.getTextLimit());
fKeySequenceText.insert(trappedKey);
fBindingText.setFocus();
fBindingText.setSelection(fBindingText.getTextLimit());
}));
内容来源于网络,如有侵权,请联系作者删除!