当前位置: 首页>>代码示例>>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;未经允许,请勿转载。