当前位置: 首页>>代码示例>>Java>>正文


Java Text.addListener方法代码示例

本文整理汇总了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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例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);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:31,代码来源:AskLanguageNameWizardPage.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:13,代码来源:FTPWidgetUtility.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:FTPWidgetUtility.java

示例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));
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:8,代码来源:OutputAdditionalParametersDialog.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:InputAdditionalParametersDialog.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:InputAdditionalParametersDialog.java

示例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));
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:WorksheetWidget.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:7,代码来源:OutputAdditionalParametersDialog.java

示例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 );
       }
     }
   });
 }
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:50,代码来源:PasswordParameter.java


注:本文中的org.eclipse.swt.widgets.Text.addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。