當前位置: 首頁>>代碼示例>>Java>>正文


Java Text.getData方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Text.getData方法的典型用法代碼示例。如果您正苦於以下問題:Java Text.getData方法的具體用法?Java Text.getData怎麽用?Java Text.getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Text的用法示例。


在下文中一共展示了Text.getData方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTextBoxValue1Listener

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
/**
 * Gets the text box value 1 listener.
 * 
 * @param conditionsList
 *            the conditions list
 * @param fieldsAndTypes
 *            the fields and types
 * @param fieldNames
 *            the field names
 * @param saveButton
 *            the save button
 * @param displayButton
 *            the display button
 * @return the text box value 1 listener
 */
public  Listener getTextBoxValue1Listener(final List<Condition> conditionsList, 
		final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
	Listener listener = new Listener() {
		
		@Override
		public void handleEvent(Event event) {
			Text text = (Text)event.widget;
			int index = (int) text.getData(FilterConstants.ROW_INDEX);
			Condition filterConditions = conditionsList.get(index);
			filterConditions.setValue1(text.getText());
			validateText(text, filterConditions.getFieldName(), fieldsAndTypes, filterConditions.getConditionalOperator());
			toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:32,代碼來源:FilterHelper.java

示例2: getTextBoxValue2Listener

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
/**
 * Gets the text box value 2 listener.
 * 
 * @param conditionsList
 *            the conditions list
 * @param fieldsAndTypes
 *            the fields and types
 * @param fieldNames
 *            the field names
 * @param saveButton
 *            the save button
 * @param displayButton
 *            the display button
 * @return the text box value 2 listener
 */
public  Listener getTextBoxValue2Listener(final List<Condition> conditionsList, 
		final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
	Listener listener = new Listener() {
		
		@Override
		public void handleEvent(Event event) {
			Text text = (Text)event.widget;
			int index = (int) text.getData(FilterConstants.ROW_INDEX);
			Condition filterConditions = conditionsList.get(index);
			filterConditions.setValue2(text.getText());
			validateText(text, filterConditions.getFieldName(), fieldsAndTypes,filterConditions.getConditionalOperator());
			toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:32,代碼來源:FilterHelper.java

示例3: checkState

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
/**
 * Checks if all values are correct and enable/disable ok button
 */
private void checkState() {
	if (editorList != null) {
		int size = editorList.size();
		for (int i = 0; i < size; i++) {
			Text fieldEditor = editorList.get(i);
			String errorMessage = (String) fieldEditor.getData(ERROR_KEY);
			if (StringUtils.isNotBlank(errorMessage)) {
				executionTrackPreference.setErrorMessage(errorMessage);
				executionTrackPreference.setValid(false);
				break;
			} else {
				executionTrackPreference.setErrorMessage(null);
				executionTrackPreference.setValid(true);
			}
		}
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:21,代碼來源:ExecutionTrackingPreferanceComposite.java

示例4: modifyText

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
@Override
public void modifyText(ModifyEvent event) {
	Text textBox = (Text)event.getSource();
	Button btnRemoteMode = (Button)textBox.getData(RunConfigDialog.SELECTION_BUTTON_KEY);
	String txt= textBox.getText();

	if (StringUtils.isBlank(txt)) {
		if(errorDecorator==null){
		errorDecorator = WidgetUtility.addDecorator(textBox,Messages.bind(Messages.EMPTY_FIELD, fieldName));
		}
		if(btnRemoteMode!=null){
			if(btnRemoteMode.getSelection()){
				errorDecorator.show();
			}else
				errorDecorator.hide();
		}else{
			errorDecorator.show();
		}
		errorDecorator.setMarginWidth(3);

	} else {
		if(errorDecorator!=null)
			errorDecorator.hide();

	}

}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:28,代碼來源:EmptyTextListener.java


注:本文中的org.eclipse.swt.widgets.Text.getData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。