本文整理汇总了Java中org.eclipse.swt.widgets.Text.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java Text.addListener方法的具体用法?Java Text.addListener怎么用?Java Text.addListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.addListener方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTextBoxInTable
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Text addTextBoxInTable(TableViewer tableViewer, TableItem tableItem, String textBoxName,
String valueTextPane, String editorName, int columnIndex, Listener listener) {
final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
buttonPane.setLayout(new FillLayout());
final Text text = new Text(buttonPane, SWT.NONE);
text.addListener(SWT.Modify, listener);
text.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
tableItem.setData(textBoxName, text);
tableItem.setData(valueTextPane, buttonPane);
//text.addModifyListener(FilterHelper.INSTANCE.getTextModifyListener());
final TableEditor editor = new TableEditor(tableViewer.getTable());
editor.grabHorizontal = true;
editor.grabVertical = true;
editor.setEditor(buttonPane, tableItem, columnIndex);
editor.layout();
text.setData(editorName, editor);
return text;
}
示例2: createControl
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
// project specification group
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// new project label
Label label = new Label(composite, SWT.NONE);
label.setText("Language name");
label.setFont(parent.getFont());
// new project name entry field
_nameField = new Text(composite, SWT.BORDER);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = SIZING_TEXT_FIELD_WIDTH;
_nameField.setLayoutData(data);
_nameField.setFont(parent.getFont());
// Set the initial value first before listener
// to avoid handling an event during the creation.
if (_initialLanguageName != null) {
_nameField.setText(_initialLanguageName);
}
_nameField.addListener(SWT.Modify, nameModifyListener);
BidiUtils.applyBidiProcessing(_nameField, BidiUtils.BTD_DEFAULT);
setControl(composite);
}
示例3: validateWidgetText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* Validate text
* @param text
*/
public void validateWidgetText(Text text, PropertyDialogButtonBar propertyDialogButtonBar, Cursor cursor,
ControlDecoration controlDecoration) {
controlDecoration.setMarginWidth(2);
ModifyAlphaNumbericTextListener alphaNumbericTextListener = new ModifyAlphaNumbericTextListener();
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, controlDecoration);
text.addListener(SWT.Modify, alphaNumbericTextListener.getListener(propertyDialogButtonBar, helper, text));
}
示例4: validateEmptyWidgetText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* @param text
* @param propertyDialogButtonBar
* @param cursor
*/
public void validateEmptyWidgetText(Text text, PropertyDialogButtonBar propertyDialogButtonBar, Cursor cursor,
ControlDecoration controlDecoration){
controlDecoration.setMarginWidth(2);
ELTModifyListener eltModifyListener = new ELTModifyListener();
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, controlDecoration);
text.addListener(SWT.Modify, eltModifyListener.getListener(propertyDialogButtonBar, helper, text));
}
示例5: addListenerToAdditionalParameter
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void addListenerToAdditionalParameter(Text additionalParameterTextBox) {
ExtraURLParameterValidationForDBComponents extraURLParameterValidation = new ExtraURLParameterValidationForDBComponents();
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, additionalParameterControlDecoration);
additionalParameterTextBox.addListener(SWT.Modify,extraURLParameterValidation.getListener(propertyDialogButtonBar, helper, additionalParameterTextBox));
}
示例6: addValidationToAdditionalParameterWidget
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void addValidationToAdditionalParameterWidget(Text additionalParameterTextBox,
ControlDecoration additionalParameterControlDecoration) {
ExtraURLParameterValidationForDBComponents extraURLParameterValidation = new ExtraURLParameterValidationForDBComponents();
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, additionalParameterControlDecoration);
additionalParameterTextBox.addListener(SWT.Modify,
extraURLParameterValidation.getListener(propertyDialogButtonBar, helper, additionalParameterTextBox));
}
示例7: addValidationToWidgets
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void addValidationToWidgets(Text textBox, ControlDecoration txtDecorator) {
VerifyNumericAndParameterForDBComponents numericValidationForDBComponents = new VerifyNumericAndParameterForDBComponents();
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, txtDecorator);
textBox.addListener(SWT.Modify,
numericValidationForDBComponents.getListener(propertyDialogButtonBar, helper, textBox));
}
示例8: attachListeners
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void attachListeners(Text textBox) {
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, txtDecorator);
textBox.addListener(SWT.CHANGED,
new ELTEventChangeListener().getListener(propertyDialogButtonBar, helper, textBox));
textBox.addListener(SWT.Modify, new ELTModifyListener().getListener(propertyDialogButtonBar, helper, textBox));
textBox.addListener(SWT.FocusIn, new FocusInListener().getListener(propDialogButtonBar, helper, textBox));
textBox.addListener(SWT.FocusOut,
new ELTNormalFocusOutListener().getListener(propDialogButtonBar, helper, textBox));
}
示例9: addListenerToChunkSize
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void addListenerToChunkSize(Text chunkSizeTextBox) {
VerifyNumericAndParameterForDBComponents numericValidationForDBComponents = new VerifyNumericAndParameterForDBComponents();
ListenerHelper helper = new ListenerHelper();
helper.put(HelperType.CONTROL_DECORATION, controlDecoration);
chunkSizeTextBox.addListener(SWT.Modify,numericValidationForDBComponents.getListener(propertyDialogButtonBar, helper, chunkSizeTextBox));
}
示例10: PasswordParameter
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public
PasswordParameter(
Composite composite,
final String name,
final int encoding )
{
super(name);
this.name = name;
inputField = new Text(composite, SWT.BORDER);
inputField.setEchoChar('*');
byte[] value = COConfigurationManager.getByteParameter(name, "".getBytes());
if(value.length > 0)
inputField.setText("***");
inputField.addListener(SWT.Modify, new Listener() {
@Override
public void handleEvent(Event event) {
try{
String password_string = inputField.getText();
byte[] password = password_string.getBytes();
byte[] encoded;
if(password.length > 0 ){
if ( encoding == com.biglybt.pif.ui.config.PasswordParameter.ET_PLAIN ){
encoded = password;
}else if ( encoding == com.biglybt.pif.ui.config.PasswordParameter.ET_SHA1 ){
SHA1Hasher hasher = new SHA1Hasher();
encoded = hasher.calculateHash(password);
}else{
// newly added, might as well go for UTF-8
encoded = MessageDigest.getInstance( "md5").digest( password_string.getBytes( "UTF-8" ));
}
}else{
encoded = password;
}
COConfigurationManager.setParameter(name, encoded);
} catch(Exception e) {
Debug.printStackTrace( e );
}
}
});
}