本文整理了Java中org.eclipse.swt.widgets.Text.<init>()
方法的一些代码示例,展示了Text.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.<init>()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Text
类名称:Text
方法名:<init>
[英]Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
The style value is either one of the style constants defined in class SWT
which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int
"|" operator) two or more of those SWT
style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.
[中]根据该类的父类和描述其行为和外观的样式值,构造该类的新实例。
样式值可以是类SWT
中定义的样式常量之一,该类适用于该类的实例,或者必须通过位或组合(即使用int
“|”运算符)两个或多个SWT
样式常量来构建。类描述列出了适用于该类的样式常量。样式位也继承自超类。
代码示例来源:origin: caoxinyu/RedisClient
@Override
protected void initData(Composite dataComposite) {
Label label = new Label(dataComposite, SWT.NONE);
label.setText(RedisClient.i18nFile.getText(I18nFile.VALUE));
label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
text_value = new Text(dataComposite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);
text_value.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
}
public Text getText() {
代码示例来源:origin: pentaho/pentaho-kettle
private void setWarningText( String message, int maxTextWidth ) {
description = new Text( shell, SWT.MULTI | SWT.LEFT | SWT.WRAP | SWT.NO_FOCUS | SWT.HIDE_SELECTION );
description.setText( message );
description.setEditable( false );
FormData fdlDesc = new FormData();
fdlDesc.left = new FormAttachment( warningIcon, margin ); // Text should be right of the icon and at the top
fdlDesc.top = new FormAttachment( 0, 0 );
fdlDesc.width = maxTextWidth;
description.setLayoutData( fdlDesc );
props.setLook( description );
}
代码示例来源:origin: pentaho/pentaho-kettle
public Composite getComposite( Composite parent, ImportRuleInterface importRule ) {
PropsUI props = PropsUI.getInstance();
composite = new Composite( parent, SWT.NONE );
props.setLook( composite );
composite.setLayout( new FillLayout() );
Label label = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
props.setLook( label );
label.setText( "Minimum length: " );
text = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
props.setLook( text );
return composite;
}
代码示例来源:origin: pentaho/pentaho-kettle
this.setLayout( formLayout );
Button button = new Button( this, SWT.PUSH );
PropsUI.getInstance().setLook( button );
button.setText( "..." );
FormData fdButton = new FormData();
fdButton.top = new FormAttachment( 0, 0 );
fdButton.right = new FormAttachment( 100, 0 );
wText = new Text( this, flags );
controlDecoration = new ControlDecoration( wText, SWT.CENTER | SWT.RIGHT, this );
Image image = GUIResource.getInstance().getImageVariable();
wText.addKeyListener( controlSpaceKeyAdapter );
FormData fdText = new FormData();
fdText.top = new FormAttachment( 0, 0 );
fdText.left = new FormAttachment( 0, 0 );
fdText.right = new FormAttachment( button, -image.getBounds().width );
wText.setLayoutData( fdText );
代码示例来源:origin: pentaho/pentaho-kettle
@Override
protected Control createMessageArea( Composite composite ) {
GridLayout gridLayout = (GridLayout) composite.getLayout();
gridLayout.numColumns = 1;
composite.setLayout( gridLayout );
if ( this.message != null ) {
this.messageLabel = new Label( composite, this.getMessageLabelStyle() );
this.messageLabel.setText( this.message );
}
if ( this.details != null ) {
this.detailsText = new Text( composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL );
this.detailsText.pack();
this.detailsText.setText( this.details );
GridData gridData = new GridData( );
gridData.widthHint = 1024;
gridData.heightHint = 300;
this.detailsText.setLayoutData( gridData );
this.detailsText.setSelection( this.details.length() );
}
return composite;
}
代码示例来源:origin: pentaho/pentaho-kettle
wText = new Text( this, flags );
FormData fdText = new FormData();
fdText.top = new FormAttachment( 0, 0 );
fdText.left = new FormAttachment( 0, 0 );
fdText.right = new FormAttachment( 100, -warningImage.getBounds().width );
wText.setLayoutData( fdText );
代码示例来源:origin: pentaho/pentaho-kettle
public Composite getComposite( Composite parent, ImportRuleInterface importRule ) {
PropsUI props = PropsUI.getInstance();
composite = new Composite( parent, SWT.NONE );
props.setLook( composite );
composite.setLayout( new FillLayout() );
Label label = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
props.setLook( label );
label.setText( "Minimum length: " );
text = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
props.setLook( text );
return composite;
}
代码示例来源:origin: caoxinyu/RedisClient
composite.setLayout(new GridLayout(2, false));
btnExpire = new Button(composite, SWT.CHECK);
btnExpire.setText(RedisClient.i18nFile.getText(I18nFile.EXPIRE));
labelTTL = new Label(composite, SWT.NONE);
labelTTL.setEnabled(false);
labelTTL.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
labelTTL.setText(RedisClient.i18nFile.getText(I18nFile.TTLS));
ttl = new Text(composite, SWT.BORDER);
ttl.setEnabled(false);
ttl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
代码示例来源:origin: pentaho/pentaho-kettle
FormData fdSash = new FormData();
fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner
fdSash.top = new FormAttachment( 0, 0 );
logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY );
spoon.props.setLook( logDisplayText );
logDisplayText.setVisible( true );
FormData fdText = new FormData();
fdText.left = new FormAttachment( 0, 0 );
fdText.top = new FormAttachment( 0, 0 );
fdText.right = new FormAttachment( 100, 0 );
fdText.bottom = new FormAttachment( 100, 0 );
logDisplayText.setLayoutData( fdText );
代码示例来源:origin: caoxinyu/RedisClient
ttlComposite.setLayout(new GridLayout(2, false));
btnExpire = new Button(ttlComposite, SWT.CHECK);
btnExpire.setText(RedisClient.i18nFile.getText(I18nFile.EXPIRE));
labelTTL = new Label(ttlComposite, SWT.NONE);
labelTTL.setEnabled(false);
labelTTL.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
labelTTL.setText(RedisClient.i18nFile.getText(I18nFile.TTLS));
ttl = new Text(ttlComposite, SWT.BORDER);
ttl.setEnabled(false);
ttl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
代码示例来源:origin: pentaho/pentaho-kettle
FormData fdSash = new FormData();
fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner
fdSash.top = new FormAttachment( 0, 0 );
logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY );
spoon.props.setLook( logDisplayText );
logDisplayText.setVisible( true );
FormData fdText = new FormData();
fdText.left = new FormAttachment( 0, 0 );
fdText.top = new FormAttachment( 0, 0 );
fdText.right = new FormAttachment( 100, 0 );
fdText.bottom = new FormAttachment( 100, 0 );
logDisplayText.setLayoutData( fdText );
代码示例来源:origin: caoxinyu/RedisClient
private void initNamespace(TabFolder tabFolder) {
TabItem tbtmNamespace = new TabItem(tabFolder, SWT.NONE);
tbtmNamespace.setText(RedisClient.i18nFile.getText(I18nFile.NAMESPACE));
Composite composite = new Composite(tabFolder, SWT.NONE);
tbtmNamespace.setControl(composite);
composite.setLayout(new GridLayout(2, false));
Label lblSeparator = new Label(composite, SWT.NONE);
lblSeparator.setText(RedisClient.i18nFile.getText(I18nFile.SEPARATOR));
separator = new Text(composite, SWT.BORDER);
separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
separator.setText(ConfigFile.getSeparator());
separator.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
separator.setData(true);
}
});
separator.setData(false);
}
代码示例来源:origin: pentaho/pentaho-kettle
wText = new Text( this, flags );
controlDecoration = new ControlDecoration( wText, SWT.CENTER | SWT.RIGHT, this );
Image image = GUIResource.getInstance().getImageVariable();
wText.addKeyListener( controlSpaceKeyAdapter );
FormData fdText = new FormData();
fdText.top = new FormAttachment( 0, 0 );
fdText.left = new FormAttachment( 0, 0 );
fdText.right = new FormAttachment( 100, -image.getBounds().width );
fdText.bottom = new FormAttachment( 100, 0 );
wText.setLayoutData( fdText );
代码示例来源:origin: caoxinyu/RedisClient
private void initPaging(TabFolder tabFolder) {
TabItem tbtmPaging = new TabItem(tabFolder, SWT.NONE);
tbtmPaging.setText(RedisClient.i18nFile.getText(I18nFile.PAGING));
Composite composite = new Composite(tabFolder, SWT.NONE);
tbtmPaging.setControl(composite);
composite.setLayout(new GridLayout(2, false));
Label lblPaging = new Label(composite, SWT.NONE);
lblPaging.setText(RedisClient.i18nFile.getText(I18nFile.PAGESIZE));
size = new Text(composite, SWT.BORDER);
size.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
size.setText(String.valueOf(ConfigFile.getPagesize()));
size.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
size.setData(true);
}
});
size.setData(false);
}
代码示例来源:origin: caoxinyu/RedisClient
protected Composite initDataTabItem(){
dataTabItem = new TabItem(tabFolder, SWT.NONE);
dataTabItem.setText(RedisClient.i18nFile.getText(dataTitle));
Composite dataComposite = new Composite(tabFolder, SWT.NONE);
dataTabItem.setControl(dataComposite);
dataComposite.setLayout(new GridLayout(4, true));
label = new Label(dataComposite, SWT.NONE);
label.setText(RedisClient.i18nFile.getText(I18nFile.SERVER));
Label label_1 = new Label(dataComposite, SWT.NONE);
label_1.setText(server);
label_2 = new Label(dataComposite, SWT.NONE);
label_2.setText(RedisClient.i18nFile.getText(I18nFile.DATABASE));
Label label_3 = new Label(dataComposite, SWT.NONE);
label_3.setText(String.valueOf(db));
lblKey = new Label(dataComposite, SWT.NONE);
lblKey.setText(RedisClient.i18nFile.getText(I18nFile.KEY));
inputKey = new Text(dataComposite, SWT.BORDER);
inputKey.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
inputKey.setText(key);
inputKey.selectAll();
inputKey.setFocus();
return dataComposite;
}
代码示例来源:origin: caoxinyu/RedisClient
final Text text_value = new Text(dataComposite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);
text_value.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
text_value.setFocus();
new Label(dataComposite, SWT.NONE);
new Label(dataComposite, SWT.NONE);
new Label(dataComposite, SWT.NONE);
composite.setLayout(new GridLayout(4, false));
btnOk = new Button(composite, SWT.NONE);
btnOk.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
btnOk.setText(RedisClient.i18nFile.getText(I18nFile.APPLY));
setApply(false);
btnRefresh = new Button(composite, SWT.NONE);
btnRefresh.addSelectionListener(new SelectionAdapter() {
@Override
false, 1, 1));
btnRefresh.setEnabled(true);
btnRefresh.setText(RedisClient.i18nFile.getText(I18nFile.REFRESH));
btnWatch = new Button(composite, SWT.NONE);
代码示例来源:origin: caoxinyu/RedisClient
composite.setLayout(new GridLayout(2, false));
Label lblt1 = new Label(composite, SWT.NONE);
lblt1.setText(RedisClient.i18nFile.getText(I18nFile.COMMANDTIMEOUT));
t1 = new Text(composite, SWT.BORDER);
t1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
t1.setText(String.valueOf(ConfigFile.getT1()));
t1.setFocus();
t1.setData(false);
Label lblt12 = new Label(composite, SWT.NONE);
lblt12.setText(RedisClient.i18nFile.getText(I18nFile.CONSOLETIMEOUT));
t2 = new Text(composite, SWT.BORDER);
t2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
t2.setText(String.valueOf(ConfigFile.getT2()));
t2.addModifyListener(new ModifyListener() {
代码示例来源:origin: caoxinyu/RedisClient
composite.setLayout(new GridLayout(2, false));
Label lblName = new Label(composite, SWT.NONE);
lblName.setText(RedisClient.i18nFile.getText(I18nFile.NAME));
text_3 = new Text(composite, SWT.BORDER);
text_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text_3.setFocus();
Label lblHost = new Label(composite, SWT.NONE);
lblHost.setText(RedisClient.i18nFile.getText(I18nFile.HOST));
text_4 = new Text(composite, SWT.BORDER);
text_4.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text_5 = new Text(composite, SWT.BORDER);
text_5.setText("6379");
text_5.selectAll();
lblPassword.setText(RedisClient.i18nFile.getText(I18nFile.PASSWORD));
text_6 = new Text(composite, SWT.BORDER | SWT.PASSWORD);
text_6.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
text_6.selectAll();
composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
btnOk.setText(RedisClient.i18nFile.getText(I18nFile.OK));
代码示例来源:origin: pentaho/pentaho-kettle
composite.setLayout( compLayout );
wlTNS = new Label( composite, SWT.RIGHT );
wlTNS.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageOCI.TNS.Label" ) );
props.setLook( wlTNS );
fdlTNS = new FormData();
fdlTNS.left = new FormAttachment( 0, 0 );
fdlTNS.right = new FormAttachment( middle, 0 );
wlTNS.setLayoutData( fdlTNS );
wTNS = new Text( composite, SWT.SINGLE | SWT.BORDER );
props.setLook( wTNS );
fdTNS = new FormData();
fdTNS.left = new FormAttachment( middle, margin );
fdTNS.right = new FormAttachment( 100, 0 );
wTNS.setLayoutData( fdTNS );
wTNS.addModifyListener( new ModifyListener() {
public void modifyText( ModifyEvent arg0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
composite.setLayout( compLayout );
wlDSN = new Label( composite, SWT.RIGHT );
wlDSN.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageODBC.DSN.Label" ) );
props.setLook( wlDSN );
fdlDSN = new FormData();
fdlDSN.left = new FormAttachment( 0, 0 );
fdlDSN.right = new FormAttachment( middle, 0 );
wlDSN.setLayoutData( fdlDSN );
wDSN = new Text( composite, SWT.SINGLE | SWT.BORDER );
props.setLook( wDSN );
fdDSN = new FormData();
fdDSN.left = new FormAttachment( middle, margin );
fdDSN.right = new FormAttachment( 100, 0 );
wDSN.setLayoutData( fdDSN );
wDSN.addModifyListener( new ModifyListener() {
public void modifyText( ModifyEvent arg0 ) {
内容来源于网络,如有侵权,请联系作者删除!