當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。