本文整理汇总了Java中org.eclipse.swt.widgets.Text.addKeyListener方法的典型用法代码示例。如果您正苦于以下问题:Java Text.addKeyListener方法的具体用法?Java Text.addKeyListener怎么用?Java Text.addKeyListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.addKeyListener方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTitleControl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
protected Control createTitleControl(Composite parent) {
text = new Text(parent, SWT.NONE);
GridData textLayoutData = new GridData();
textLayoutData.horizontalAlignment = GridData.FILL;
textLayoutData.verticalAlignment = GridData.FILL;
textLayoutData.grabExcessHorizontalSpace = true;
textLayoutData.grabExcessVerticalSpace = false;
textLayoutData.horizontalSpan = 2;
text.setLayoutData(textLayoutData);
text.addKeyListener(new FilterKeyListener());
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(DO_SHOW_DIALOG ? 1 : 2, 1)
.applyTo(text);
return text;
}
示例2: createComponents
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void createComponents ()
{
final FillLayout layout = new FillLayout ( SWT.VERTICAL );
layout.marginHeight = 12;
layout.marginWidth = 12;
setLayout ( layout );
final Text filterTextField = new Text ( this, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL );
filterTextField.setText ( this.filter );
filterTextField.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
verifyFilter ( filterTextField.getText () );
}
} );
}
示例3: createAttributeText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Text createAttributeText ( final String attribute )
{
final Text t = new Text ( this, SWT.BORDER );
final Fields field = Fields.byField ( attribute );
if ( field == null )
{
t.setEditable ( true );
t.setMessage ( Messages.custom_field );
}
else
{
t.setEditable ( false );
t.setText ( field.getName () );
}
t.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
};
} );
final RowData rowData = new RowData ();
rowData.width = 132;
t.setLayoutData ( rowData );
return t;
}
示例4: createValueText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Text createValueText ()
{
final Text t = new Text ( this, SWT.BORDER );
t.setMessage ( Messages.argument );
t.addKeyListener ( new KeyAdapter () {
@Override
public void keyReleased ( final KeyEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
}
} );
final RowData rowData = new RowData ();
rowData.width = 132;
t.setLayoutData ( rowData );
return t;
}
示例5: createControl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected Control createControl() {
m_Text = new Text(m_Table, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
m_Text.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
try {
onKeyPressed(e);
} catch (Exception ex) {
}
}
});
m_Text.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent arg0) {
onTraverse(arg0);
}
});
return m_Text;
}
示例6: createControl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected Control createControl() {
// System.out.println("Created a new one.");
m_Text = new Text(m_Table, SWT.NONE);
m_Text.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
try {
onKeyPressed(e);
} catch (Exception ex) {
}
}
});
m_Text.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent arg0) {
onTraverse(arg0);
}
});
return m_Text;
}
示例7: createControl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected Control createControl() {
m_Text = new Text(m_Table, SWT.MULTI | SWT.V_SCROLL);
m_Text.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
try {
onKeyPressed(e);
} catch (Exception ex) {
}
}
});
m_Text.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent arg0) {
onTraverse(arg0);
}
});
return m_Text;
}
示例8: TextValidator
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public TextValidator(Text control, int position, IInputValidator validator, IValueChangeListener valueChangeListener) {
this.validator = validator;
this.valueChangeListener = valueChangeListener;
this.deco = new ControlDecoration(control, position, control.getParent());
this.deco.setMarginWidth(2);
this.errorImg = AvroSchemaEditorActivator.getImage(AvroSchemaEditorImages.ERROR_OVERLAY);
control.addModifyListener(this);
control.addFocusListener(this);
control.addKeyListener(this);
}